/******************************************************
//**设备管理类
//******************************************************/
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Windows;
using System.Windows.Controls;
using System.Windows.Data;
using System.Windows.Documents;
using System.Windows.Input;
using System.Windows.Media;
using System.Windows.Media.Imaging;
using System.Windows.Navigation;
using System.Windows.Shapes;
using System.IO;
public partial class Equipmentmanagement
{
// /// Tests for <see cref="AppointmentCalendarExporter"/> methods
//
// [TestClass]
/
/ public class AppointmentCalendarExporterTest
// {
// [TestMethod]
// public void CreateCalendarWithEveryDayRecurrence()
// {
// var app = new Appointment
// {
// Url = "lerik",
// Location = "Telerik Office",
// Subject = "Daily Appointment",
// Start = new DateTime( 2008, 7, 30, 13, 30, 0 ), // End = new DateTime(2008, 7, 30, 14, 30, 0),
/
/ RecurrencePattern =
// new RecurrencePattern
// {
// Frequency = RecurrenceFrequency.Daily,
// Interval = 1,
// DaysOfWeekMask = RecurrenceDays.EveryDay
// }
// };
// app.Attendees.Add( new Attendee( "Ivan Smith",
"ivan.smith@mail" ) );
// app.Attendees.Add( new Attendee( "John Doll", "john.doll@mail" ) );
/
/ var appointmentCollection = new List<Appointment>
// {
// app
// };
// using ( var stream = new MemoryStream() )
// {
// var exporter = new AppointmentCalendarExporter( stream );
// exporter.CreateCalendar( appointmentCollection );
// stream.Position = 0;
// var reader = new StreamReader( stream );
// string exportResult = reader.ReadToEnd();
/
/ StringAssert.Contains( exportResult, "DTSTART:20080730T103000Z" );
// StringAssert.Contains( exportResult, "DTEND:20080730T113000Z" );
// StringAssert.Contains( exportResult, "RRULE:FREQ=DAIL Y" );
// StringAssert.Contains( exportResult, "SUMMARY:Daily Appointment" );
// StringAssert.Contains( exportResult, "URL:\"lerik\"" );
// StringAssert.Contains( exportResult, "LOCATION:Telerik Office" );
// StringAssert.Contains(exportResult, "ATTENDEE;CN=Ivan Smith:MAILTO:ivan.smith@mail");
// StringAssert.Contains(exportResult, "ATTENDEE;CN=John Doll:MAILTO:john.doll@mail");
// }
// }
// }
/
/}
}
/******************************************************
//**添加设备类
//******************************************************/
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Windows;
using System.Windows.Controls;
using System.Windows.Data;
using System.Windows.Documents;
using System.Windows.Input;
using System.Windows.Media;
using System.Windows.Media.Imaging;
using System.Windows.Navigation;
using System.Windows.Shapes;
using System.IO;
public partial class Addequipment
{
/// A table definition which specifies the hierarchy in the RadTreeListView.
public class TreeListViewTableDefinition : TableDefinition
{
/// Creates a new instance of the TreeListViewTableDefinition class.
public TreeListViewTableDefinition()
{
this.Relation = new TreeListRelation(this);
}
/// Gets or sets the binding that will be be used to identify the hierarchy relation.
public Binding ItemsSource { get; set; }
/// Returns a string representation of the table definition.
/// <returns>The string representing the table definirion.</returns>
public override string ToString()
{
return string.Format("TreeListTableDefinition: {0}", this.ItemsSource);
}
/// Creates a new TreeListViewTableDefinition.
/// <returns></returns>
protected override TableDefinition CreateChildTableDefinition()
{
return new TreeListViewTableDefinition();
}
/// Represents a relation used in a tree list. The data source is generated
/
// using the ItemSource binding of the parent TreeListViewTableDefinition.
public class TreeListRelation : RelationBase
{
private TreeListViewTableDefinition tableDefinition;
/// Creates a new instance of the TreeListRelation class.
public TreeListRelation(TreeListViewTableDefinition tableDefinition)
{
this.tableDefinition = tableDefinition;
}
/// Gets the child hierarchy items.
/// <param name="context">The parent data item.</param>
public IEnumerable GetDataSource(object context)
社交软件源码{
return this.GetDataSource(context, null) as IEnumerable;
}
Dictionary<Type, Func<object, object>> resolvers = new Dictionary<Type, Func<object, object>>();
/// Gets the child hierarchy items.
/// <param name="context">The parent data item.</param>
/// <param name="parentItems">The parent items collection.</param>
public override object GetDataSource(object context, DataItemCollection parentItems)
{
if (context != null
&& tableDefinition != null
&& tableDefinition.ItemsSource != null)
{
var contextType = context.GetType();
Func<object, object> resolver;
if (!solvers.TryGetValue(contextType, out resolver))
{
resolver = tableDefinition.ItemsSource.CreateMemberAccessFunc(context.GetType(),
typeof(IEnumerable));
resolvers[contextType] = resolver;
}
if (resolver != null)
{
return resolver(context);
}
}
return null;
}
}
internal static bool IsPropertyPathValid(string propertyPath)
{
return !string.IsNullOrEmpty(propertyPath) && propertyPath.Trim() != ".";
}
}
}
}
/******************************************************
//**删除设备类
//******************************************************/
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Windows;
using System.Windows.Controls;
using System.Windows.Data;
using System.Windows.Documents;
using System.Windows.Input;
using System.Windows.Media;
using System.Windows.Media.Imaging;
using System.Windows.Navigation;
using System.Windows.Shapes;
using System.IO;
public partial class Removeequipment
{
版权声明:本站内容均来自互联网,仅供演示用,请勿用于商业和其他非法用途。如果侵犯了您的权益请与我们联系QQ:729038198,我们将在24小时内删除。
发表评论