本文整理汇总了C#中CmsEquipmentDatabase.Classes.NodeView.Sort方法的典型用法代码示例。如果您正苦于以下问题:C# NodeView.Sort方法的具体用法?C# NodeView.Sort怎么用?C# NodeView.Sort使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类CmsEquipmentDatabase.Classes.NodeView
的用法示例。
在下文中一共展示了NodeView.Sort方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: AddElectricalComponentProperty
private void AddElectricalComponentProperty(NodeView nodeView)
{
AddEditEquipmentPropertyDialog dialog = new AddEditEquipmentPropertyDialog(CommonUtils.EquipmentPropertyType.ElectricalProperty);
dialog.Show();
dialog.Closed +=
(s1, e1) =>
{
if (dialog.DialogResult.HasValue && dialog.DialogResult.Value && dialog.ComponentProperty!=null)
{
NodeView child = new NodeView(nodeView)
{
Id = dialog.ComponentProperty.Id,
Name = dialog.ComponentProperty.Name,
Description = dialog.ComponentProperty.Description,
Icon = "/CmsEquipmentDatabase;component/Images/Configuration.png",
Type = NodeType.ElectricalProperty,
HasChildren = false,
SortField = dialog.ComponentProperty.Name
};
if (nodeView.ChildrenLoaded)
{
nodeView.Children.Add(child);
nodeView.Sort();
}
}
};
}
示例2: AddNewDocumentAuthor
private void AddNewDocumentAuthor(NodeView nodeView)
{
AddEditDocumentAuthorDialog dialog = new AddEditDocumentAuthorDialog();
dialog.Show();
dialog.Closed +=
(s1, e1) =>
{
if (dialog.DialogResult.HasValue && dialog.DialogResult.Value)
{
NodeView child = new NodeView(nodeView)
{
Id = dialog.DocumentAuthor.Id,
Name = dialog.DocumentAuthor.Name,
Description = dialog.DocumentAuthor.Description,
Icon = "/CmsEquipmentDatabase;component/Images/Configuration.png",
Type = NodeType.DocumentAuthorNode,
SortField = dialog.DocumentAuthor.Ordinal.ToString(),
HasChildren = false
};
if (nodeView.ChildrenLoaded)
{
nodeView.Children.Add(child);
nodeView.Sort();
}
}
};
}
示例3: AddInterlockProperty
private void AddInterlockProperty(NodeView nodeView)
{
var dialog = new AddEditEquipmentPropertyDialog(CommonUtils.EquipmentPropertyType.ControlInterlockProperty);
dialog.Show();
dialog.Closed +=
(s1, e1) =>
{
var parentNode = nodeView;
if (dialog.DialogResult.HasValue && dialog.DialogResult.Value)
{
var child = new NodeView(parentNode)
{
Id = dialog.ComponentProperty.Id,
Name = dialog.ComponentProperty.Name,
Description = dialog.ComponentProperty.Description,
Icon = "/CmsEquipmentDatabase;component/Images/Configuration.png",
Type = NodeType.InterlockProperty,
HasChildren = false,
SortField = dialog.ComponentProperty.Name
};
if (nodeView.ChildrenLoaded)
{
parentNode.Children.Add(child);
nodeView.Sort();
}
}
};
}
示例4: AddExistingInterlockProperty
private void AddExistingInterlockProperty(NodeView nodeView)
{
var interlockTypeId = nodeView.Id;
var cmsWebServiceClient = new CmsWebServiceClient(Utils.WcfBinding, Utils.WcfEndPoint);
cmsWebServiceClient.GetInterlockTypeCompleted +=
(s, e) =>
{
var addEditExistingInterlockProperty = new AddEditExistingInterlockPropertyDialog(e.Result);
addEditExistingInterlockProperty.Show();
addEditExistingInterlockProperty.Closed += (s1, e1) =>
{
if (addEditExistingInterlockProperty.DialogResult.HasValue && addEditExistingInterlockProperty.DialogResult.Value)
{
EventHandler<AddUpdateInterlockTypePropertyCompletedEventArgs> addCompleted = null;
addCompleted = (s2, eventArgs) =>
{
var pcpt = eventArgs.Result;
if (pcpt != null)
{
var child = new NodeView(nodeView)
{
Id = pcpt.Id,
Name = addEditExistingInterlockProperty.InterlockTypeProperty.InterlockProperty.Name,
Description = addEditExistingInterlockProperty.InterlockTypeProperty.InterlockProperty.Description,
Icon = "/CmsEquipmentDatabase;component/Images/Configuration.png",
Type = NodeType.InterlockTypeProperty,
HasChildren = false,
SortField = pcpt.Ordinal.ToString()
};
if (nodeView.ChildrenLoaded)
{
nodeView.Children.Add(child);
nodeView.Sort();
}
}
cmsWebServiceClient.AddUpdateInterlockTypePropertyCompleted -= addCompleted;
};
cmsWebServiceClient.AddUpdateInterlockTypePropertyCompleted += addCompleted;
var interlockTypeProperty = new InterlockTypeProperty
{
InterlockTypeId = interlockTypeId,
InterlockPropertyId = addEditExistingInterlockProperty.InterlockTypeProperty.InterlockPropertyId,
Ordinal = addEditExistingInterlockProperty.InterlockTypeProperty.Ordinal
};
cmsWebServiceClient.AddUpdateInterlockTypePropertyAsync(interlockTypeProperty);
}
};
};
cmsWebServiceClient.GetInterlockTypeAsync(interlockTypeId);
}
示例5: LoadSystemTests
private void LoadSystemTests(NodeView expandedNode)
{
var cmsWebServiceClient = new CmsWebServiceClient(Utils.WcfBinding, Utils.WcfEndPoint);
EventHandler<GetAllControlSystemTestingPropertiesCompletedEventArgs> fetchCompleted = null;
fetchCompleted = (s, eventArgs) =>
{
var properties = eventArgs.Result;
if (properties != null)
{
foreach (var property in properties)
{
var child = new NodeView(expandedNode)
{
Id = property.Id,
Name = property.Name,
Description = property.Description,
Icon = "/CmsEquipmentDatabase;component/Images/Configuration.png",
Type = NodeType.SystemTest,
HasChildren = false,
SortField = property.Name
};
expandedNode.Children.Add(child);
cmsWebServiceClient.GetAllControlSystemTestingPropertiesCompleted -= fetchCompleted;
}
expandedNode.Sort();
}
};
cmsWebServiceClient.GetAllControlSystemTestingPropertiesCompleted += fetchCompleted;
cmsWebServiceClient.GetAllControlSystemTestingPropertiesAsync();
}
示例6: LoadManufacturers
private void LoadManufacturers(NodeView expandedNode)
{
var cmsWebServiceClient = new CmsWebServiceClient(Utils.WcfBinding, Utils.WcfEndPoint);
EventHandler<GetManufacturersCompletedEventArgs> fetchCompleted = null;
fetchCompleted = (s, eventArgs) =>
{
var manufacturers = eventArgs.Result;
foreach (var manufacturer in manufacturers)
{
var child = new NodeView(expandedNode)
{
Id = manufacturer.Id,
Name = manufacturer.Name,
Description = manufacturer.Description,
Icon = "/CmsEquipmentDatabase;component/Images/Configuration.png",
Type = NodeType.ManufacturerNode,
HasChildren = true,
SortField = manufacturer.Ordinal.ToString()
};
expandedNode.Children.Add(child);
}
Utils.HideSpinner(expandedNode);
cmsWebServiceClient.GetManufacturersCompleted -= fetchCompleted;
expandedNode.Sort();
};
cmsWebServiceClient.GetManufacturersCompleted += fetchCompleted;
cmsWebServiceClient.GetManufacturersAsync((int)CommonUtils.EquipmentTypeCode.CONTR);
}
示例7: LoadInterlockTypeProperties
private void LoadInterlockTypeProperties(NodeView expandedNode)
{
var cmsWebServiceClient = new CmsWebServiceClient(Utils.WcfBinding, Utils.WcfEndPoint);
EventHandler<GetInterlockTypePropertiesCompletedEventArgs> fetchCompleted = null;
fetchCompleted = (s, eventArgs) =>
{
var interlockTypeProperties = eventArgs.Result;
foreach (var interlockTypeProperty in interlockTypeProperties)
{
var desc = interlockTypeProperty.InterlockProperty.Name;
if (!string.IsNullOrEmpty(interlockTypeProperty.InterlockProperty.Description))
{
desc = string.Format("{0} ({1})", interlockTypeProperty.InterlockProperty.Name,
interlockTypeProperty.InterlockProperty.Description);
}
var child = new NodeView(expandedNode)
{
Id = interlockTypeProperty.Id,
Name = desc,
Icon = "/CmsEquipmentDatabase;component/Images/Configuration.png",
Type = NodeType.InterlockTypeProperty,
HasChildren = false,
SortField = interlockTypeProperty.Ordinal.ToString()
};
expandedNode.Children.Add(child);
}
Utils.HideSpinner(expandedNode);
expandedNode.Sort();
cmsWebServiceClient.GetInterlockTypePropertiesCompleted -= fetchCompleted;
};
cmsWebServiceClient.GetInterlockTypePropertiesCompleted += fetchCompleted;
cmsWebServiceClient.GetInterlockTypePropertiesAsync(expandedNode.Id);
}
示例8: LoadControlSystemTypes
private void LoadControlSystemTypes(NodeView expandedNode)
{
var cmsWebServiceClient = new CmsWebServiceClient(Utils.WcfBinding, Utils.WcfEndPoint);
EventHandler<GetControlSystemTypesCompletedEventArgs> fetchCompleted = null;
fetchCompleted = (s, eventArgs) =>
{
var equipmentTypes = eventArgs.Result;
foreach (var equipmentType in equipmentTypes)
{
var systemTypeNode = new NodeView(expandedNode)
{
Id = equipmentType.Id,
Name = equipmentType.Name,
Description = equipmentType.Description,
Icon = "/CmsEquipmentDatabase;component/Images/Configuration.png",
Type = NodeType.ControlSystemTypeNode,
HasChildren = true,
SortField = equipmentType.Name
};
var systemTestsNode = new NodeView(systemTypeNode)
{
Name = "System Type Tests",
Icon = "/CmsEquipmentDatabase;component/Images/Configuration.png",
Type = NodeType.SystemTypeTests,
HasChildren = true
};
expandedNode.Children.Add(systemTypeNode);
systemTypeNode.Children.Add(systemTestsNode);
Utils.HideSpinner(expandedNode);
Utils.HideSpinner(systemTestsNode);
}
cmsWebServiceClient.GetControlSystemTypesCompleted -= fetchCompleted;
expandedNode.Sort();
};
cmsWebServiceClient.GetControlSystemTypesCompleted += fetchCompleted;
cmsWebServiceClient.GetControlSystemTypesAsync(false);
}
示例9: AddType
private void AddType(NodeView nodeView)
{
AddEditMobilePlantTypeDialog dialog = new AddEditMobilePlantTypeDialog();
AddEditMobilePlantTypeModel addEditMobilePlantTypeModel = new AddEditMobilePlantTypeModel();
addEditMobilePlantTypeModel.View = dialog;
dialog.DataContext = addEditMobilePlantTypeModel;
dialog.Show();
dialog.Closed +=
(s1, e1) =>
{
NodeView parentNode = nodeView;
if (dialog.DialogResult.HasValue && dialog.DialogResult.Value)
{
NodeView child = new NodeView(parentNode)
{
Id = dialog.MobilePlantType.Id,
Name = dialog.MobilePlantType.Name,
Description = dialog.MobilePlantType.Description,
Icon = "/CmsEquipmentDatabase;component/Images/Configuration.png",
Type = NodeType.MobilePlantTypeNode,
SortField = dialog.MobilePlantType.Ordinal.ToString(),
IsActive = dialog.MobilePlantType.IsActive,
HasChildren = true
};
parentNode.Children.Add(child);
nodeView.Sort(true);
}
};
}
示例10: AddProperty
private void AddProperty(NodeView nodeView)
{
AddEditEquipmentPropertyDialog dialog = new AddEditEquipmentPropertyDialog(CommonUtils.EquipmentPropertyType.MobilePlantProperty);
dialog.Show();
dialog.Closed +=
(s1, e1) =>
{
NodeView parentNode = nodeView;
if (dialog.DialogResult.HasValue && dialog.DialogResult.Value)
{
NodeView child = new NodeView(parentNode)
{
Id = dialog.ComponentProperty.Id,
Name = dialog.ComponentProperty.Name,
Description = dialog.ComponentProperty.Description,
Icon = "/CmsEquipmentDatabase;component/Images/Configuration.png",
Type = NodeType.MobilePropertyNode,
SortField = dialog.ComponentProperty.Name.ToString(),
HasChildren = false
};
parentNode.Children.Add(child);
nodeView.Sort();
}
};
}
示例11: AddOwner
private void AddOwner(NodeView nodeView)
{
AddEditMobileOwnerDialog dialog = new AddEditMobileOwnerDialog();
AddEditMobileOwnerModel addEditMobileOwnerModel = new AddEditMobileOwnerModel();
addEditMobileOwnerModel.View = dialog;
dialog.DataContext = addEditMobileOwnerModel;
dialog.Show();
dialog.Closed +=
(s1, e1) =>
{
NodeView parentNode = nodeView;
if (dialog.DialogResult.HasValue && dialog.DialogResult.Value)
{
NodeView child = new NodeView(parentNode)
{
Id = dialog.MobileOwner.Id,
Name = dialog.MobileOwner.Name,
Description = dialog.MobileOwner.Description,
Icon = "/CmsEquipmentDatabase;component/Images/Configuration.png",
Type = NodeType.MobileOwnerNode,
SortField = dialog.MobileOwner.Ordinal.ToString(),
HasChildren = false
};
if (nodeView.ChildrenLoaded)
{
parentNode.Children.Add(child);
nodeView.Sort();
}
}
};
}
示例12: LoadModels
private void LoadModels(NodeView expandedNode)
{
CmsWebServiceClient cmsWebServiceClient = new CmsWebServiceClient(Utils.WcfBinding, Utils.WcfEndPoint);
EventHandler<GetModelsCompletedEventArgs> fetchCompleted = null;
fetchCompleted = (s, eventArgs) =>
{
List<Model> models = eventArgs.Result;
foreach (Model model in models)
{
NodeView child = new NodeView(expandedNode)
{
Id = model.Id,
Name = model.Name,
Description = model.Description,
Icon = "/CmsEquipmentDatabase;component/Images/Configuration.png",
Type = NodeType.ModelNode,
HasChildren = false,
SortField = model.Ordinal.ToString()
};
expandedNode.Children.Add(child);
}
Utils.HideSpinner(expandedNode);
cmsWebServiceClient.GetModelsCompleted -= fetchCompleted;
expandedNode.Sort();
};
cmsWebServiceClient.GetModelsCompleted += fetchCompleted;
cmsWebServiceClient.GetModelsAsync(expandedNode.Id);
}
示例13: LoadMobileProperties
private void LoadMobileProperties(NodeView expandedNode)
{
CmsWebServiceClient cmsWebServiceClient = new CmsWebServiceClient(Utils.WcfBinding, Utils.WcfEndPoint);
EventHandler<GetAllMobilePlantPropertiesCompletedEventArgs> fetchCompleted = null;
fetchCompleted = (s, eventArgs) =>
{
List<MobilePlantProperty> mobileProperties = eventArgs.Result as List<MobilePlantProperty>;
foreach (MobilePlantProperty mobileProperty in mobileProperties)
{
NodeView child = new NodeView(expandedNode)
{
Id = mobileProperty.Id,
Name = mobileProperty.Name,
Description = mobileProperty.Description,
Icon = "/CmsEquipmentDatabase;component/Images/Configuration.png",
Type = NodeType.MobilePropertyNode,
SortField = mobileProperty.Name.ToString(),
HasChildren = false
};
expandedNode.Children.Add(child);
cmsWebServiceClient.GetAllMobilePlantPropertiesCompleted -= fetchCompleted;
}
expandedNode.Sort();
};
cmsWebServiceClient.GetAllMobilePlantPropertiesCompleted += fetchCompleted;
cmsWebServiceClient.GetAllMobilePlantPropertiesAsync();
}
示例14: LoadComponentTypeProperties
private void LoadComponentTypeProperties(NodeView expandedNode)
{
CmsWebServiceClient cmsWebServiceClient = new CmsWebServiceClient(Utils.WcfBinding, Utils.WcfEndPoint);
EventHandler<GetMobilePlantComponentTypePropertiesCompletedEventArgs> fetchCompleted = null;
fetchCompleted = (s, eventArgs) =>
{
List<MobilePlantComponentTypeProperty> electricalEquipmentComponentTypeProperties = eventArgs.Result;
foreach (MobilePlantComponentTypeProperty electricalEquipmentComponentProperty in electricalEquipmentComponentTypeProperties)
{
NodeView child = new NodeView(expandedNode)
{
Id = electricalEquipmentComponentProperty.Id,
Name = electricalEquipmentComponentProperty.MobilePlantProperty.Name,
Description = electricalEquipmentComponentProperty.MobilePlantProperty.Description,
Icon = "/CmsEquipmentDatabase;component/Images/Configuration.png",
Type = NodeType.MobilePlantComponentTypeProperty,
HasChildren = false,
SortField = electricalEquipmentComponentProperty.Ordinal.ToString()
};
expandedNode.Children.Add(child);
}
Utils.HideSpinner(expandedNode);
expandedNode.Sort();
cmsWebServiceClient.GetMobilePlantComponentTypePropertiesCompleted -= fetchCompleted;
};
cmsWebServiceClient.GetMobilePlantComponentTypePropertiesCompleted += fetchCompleted;
cmsWebServiceClient.GetMobilePlantComponentTypePropertiesAsync(expandedNode.Id);
}
示例15: AddCalibrationComponentType
private void AddCalibrationComponentType(NodeView nodeView)
{
CmsWebServiceClient cmsWebServiceClient = new CmsWebServiceClient(Utils.WcfBinding, Utils.WcfEndPoint);
AddEditCalibrationComponentTypeDialog dialog = new AddEditCalibrationComponentTypeDialog();
dialog.Show();
dialog.Closed += (s1, e1) =>
{
if (dialog.DialogResult.HasValue && dialog.DialogResult.Value)
{
EventHandler<AddCalibrationComponentTypeCompletedEventArgs> addCompleted = null;
addCompleted = (s2, e2) =>
{
if (e2.Result.HasErrors)
{
var errorDialog = new PopupDialog(PopupDialogType.Error, Utils.DisplayErrorMessages(e2.Result.ServerErrorMessages));
errorDialog.Show();
}
else
{
CalibrationComponentType calibrationComponentType = e2.Result.EntityResult;
if (calibrationComponentType != null)
{
NodeView child = new NodeView(nodeView)
{
Id = calibrationComponentType.Id,
Name = dialog.ComponentType.Name,
Description = dialog.ComponentType.Description,
Icon = "/CmsEquipmentDatabase;component/Images/Configuration.png",
Type = NodeType.CalibrationComponentType,
HasChildren = true,
SortField = dialog.ComponentType.Ordinal.ToString()
};
if (nodeView.ChildrenLoaded)
{
nodeView.Children.Add(child);
nodeView.Sort();
}
}
cmsWebServiceClient.AddCalibrationComponentTypeCompleted -= addCompleted;
}
};
cmsWebServiceClient.AddCalibrationComponentTypeCompleted += addCompleted;
cmsWebServiceClient.AddCalibrationComponentTypeAsync(dialog.ComponentType);
}
};
}