本文整理汇总了C#中CmsEquipmentDatabase.Classes.NodeView类的典型用法代码示例。如果您正苦于以下问题:C# NodeView类的具体用法?C# NodeView怎么用?C# NodeView使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
NodeView类属于CmsEquipmentDatabase.Classes命名空间,在下文中一共展示了NodeView类的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: ElectricalEquipmentConfigControl
public ElectricalEquipmentConfigControl(Tab tab)
{
if (DesignerProperties.IsInDesignTool) { return; }
InitializeComponent();
mTab = tab;
ConfigurationTreeView.LoadOnDemand += ConfigurationTreeViewLoadOnDemand;
ObservableCollection<NodeView> configurationRootNode = new ObservableCollection<NodeView>();
NodeView electricalTypeNode = new NodeView(null) { Name = "Electrical Equipment Types", HasChildren = true, Type = NodeType.ElectricalTypesNode, Icon = "/CmsEquipmentDatabase;component/Images/Configuration.png" };
NodeView electricalComponentTypesNode = new NodeView(null) { Name = "Electrical Equipment Component Types", HasChildren = true, Type = NodeType.ElectricalComponentTypes, Icon = "/CmsEquipmentDatabase;component/Images/Configuration.png" };
NodeView standardComponentPropertiesNode = new NodeView(null) { Name = "Electrical Equipment Properties", HasChildren = true, Type = NodeType.ElectricalProperties, Icon = "/CmsEquipmentDatabase;component/Images/Configuration.png" };
NodeView reportsNode = new NodeView(null) { Name = "Reports", HasChildren = true, Type = NodeType.ReportsNode, Icon = "/CmsEquipmentDatabase;component/Images/Configuration.png" };
NodeView manufacturersNode = new NodeView(null) { Name = "Manufacturers", HasChildren = true, Type = NodeType.ManufacturersNode, Icon = "/CmsEquipmentDatabase;component/Images/Configuration.png" };
configurationRootNode.Add(electricalTypeNode);
configurationRootNode.Add(electricalComponentTypesNode);
configurationRootNode.Add(standardComponentPropertiesNode);
configurationRootNode.Add(reportsNode);
configurationRootNode.Add(manufacturersNode);
ConfigurationTreeView.ItemsSource = configurationRootNode;
}
示例3: AddExistingMobilePlantComponentProperty
private void AddExistingMobilePlantComponentProperty(NodeView nodeView)
{
int electricalEquipmentComponentTypeId = nodeView.Id;
CmsWebServiceClient cmsWebServiceClient = new CmsWebServiceClient(Utils.WcfBinding, Utils.WcfEndPoint);
cmsWebServiceClient.GetMobilePlantComponentTypeCompleted +=
(s, e) =>
{
AddEditExistingMobilePlantComponentPropertyDialog dialog = new AddEditExistingMobilePlantComponentPropertyDialog(e.Result);
dialog.Show();
dialog.Closed += (s1, e1) =>
{
if (dialog.DialogResult.HasValue && dialog.DialogResult.Value)
{
EventHandler<AddMobilePlantComponentTypePropertyCompletedEventArgs> addCompleted = null;
addCompleted = (s2, eventArgs) =>
{
MobilePlantComponentTypeProperty pcpt = eventArgs.Result;
if (pcpt != null)
{
NodeView child = new NodeView(nodeView)
{
Id = pcpt.Id,
Name = dialog.MobilePlantComponentTypeProperty.MobilePlantProperty.Name,
Description = dialog.MobilePlantComponentTypeProperty.MobilePlantProperty.Description,
Icon = "/CmsEquipmentDatabase;component/Images/Configuration.png",
Type = NodeType.MobilePlantComponentTypeProperty,
HasChildren = false,
SortField = dialog.MobilePlantComponentTypeProperty.Ordinal.ToString()
};
if (nodeView.ChildrenLoaded)
{
nodeView.Children.Add(child);
nodeView.Sort();
}
}
cmsWebServiceClient.AddMobilePlantComponentTypePropertyCompleted -= addCompleted;
};
cmsWebServiceClient.AddMobilePlantComponentTypePropertyCompleted += addCompleted;
MobilePlantComponentTypeProperty electricalEquipmentComponentTypeProperty = new MobilePlantComponentTypeProperty
{
MobilePlantComponentTypeId = electricalEquipmentComponentTypeId,
MobilePlantPropertyId = dialog.MobilePlantComponentTypeProperty.MobilePlantPropertyId,
Ordinal = dialog.MobilePlantComponentTypeProperty.Ordinal
};
cmsWebServiceClient.AddMobilePlantComponentTypePropertyAsync(electricalEquipmentComponentTypeProperty);
}
};
};
cmsWebServiceClient.GetMobilePlantComponentTypeAsync(electricalEquipmentComponentTypeId);
}
示例4: DocumentConfigControl
public DocumentConfigControl(Tab tab)
{
if (DesignerProperties.IsInDesignTool){return;}
// Required to initialize variables
InitializeComponent();
mTab = tab;
ConfigurationTreeView.LoadOnDemand += ConfigurationTreeView_LoadOnDemand;
RadTreeViewItem treeViewItem = ConfigurationTreeView.SelectedContainer;
ObservableCollection<NodeView> configurationRootNode = new ObservableCollection<NodeView>();
NodeView authorsNode = new NodeView(null) { Name = "Authors", HasChildren = true, Type = NodeType.DocumentAuthorsNode, Icon = "/CmsEquipmentDatabase;component/Images/Configuration.png" };
NodeView disciplinesNode = new NodeView(null) { Name = "Disciplines", HasChildren = true, Type = NodeType.DocumentDisciplinesNode, Icon = "/CmsEquipmentDatabase;component/Images/Configuration.png" };
NodeView locationsNode = new NodeView(null) { Name = "Locations", HasChildren = true, Type = NodeType.DocumentLocationsNode, Icon = "/CmsEquipmentDatabase;component/Images/Configuration.png" };
NodeView purchaseOrdersNode = new NodeView(null) { Name = "Purchase Orders", HasChildren = true, Type = NodeType.DocumentPurchaseOrdersNode, Icon = "/CmsEquipmentDatabase;component/Images/Configuration.png" };
NodeView reportsNode = new NodeView(null) { Name = "Reports", HasChildren = true, Type = NodeType.ReportsNode, Icon = "/CmsEquipmentDatabase;component/Images/Configuration.png" };
NodeView typesNode = new NodeView(null) { Name = "Types", HasChildren = true, Type = NodeType.DocumentTypesNode, Icon = "/CmsEquipmentDatabase;component/Images/Configuration.png" };
//alpha
configurationRootNode.Add(authorsNode);
configurationRootNode.Add(disciplinesNode);
configurationRootNode.Add(locationsNode);
configurationRootNode.Add(purchaseOrdersNode);
configurationRootNode.Add(reportsNode);
configurationRootNode.Add(typesNode);
ConfigurationTreeView.ItemsSource = configurationRootNode;
}
示例5: 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();
}
}
};
}
示例6: MobilePlantConfigControl
public MobilePlantConfigControl(Tab tab)
{
if (DesignerProperties.IsInDesignTool) { return; }
// Required to initialize variables
InitializeComponent();
mTab = tab;
ConfigurationTreeView.LoadOnDemand += ConfigurationTreeView_LoadOnDemand;
RadTreeViewItem treeViewItem = ConfigurationTreeView.SelectedContainer;
ObservableCollection<NodeView> configurationRootNode = new ObservableCollection<NodeView>();
NodeView mobilePlantTypesNode = new NodeView(null) { Name = "Mobile Plant Types", HasChildren = true, Type = NodeType.MobilePlantTypesNode, Icon = "/CmsEquipmentDatabase;component/Images/Configuration.png" };
NodeView mobilePlantComponentTypesNode = new NodeView(null) { Name = "Mobile Plant Component Types", HasChildren = true, Type = NodeType.MobilePlantComponentTypes, Icon = "/CmsEquipmentDatabase;component/Images/Configuration.png" };
NodeView standardComponentPropertiesNode = new NodeView(null) { Name = "Mobile Plant Properties", HasChildren = true, Type = NodeType.MobilePropertiesNode, Icon = "/CmsEquipmentDatabase;component/Images/Configuration.png" };
NodeView mobilePlantHirersNode = new NodeView(null) { Name = "Mobile Plant MobileHirers", HasChildren = true, Type = NodeType.MobileHirersNode, Icon = "/CmsEquipmentDatabase;component/Images/Configuration.png" };
NodeView mobilePlantOwnersNode = new NodeView(null) { Name = "Mobile Plant Owners", HasChildren = true, Type = NodeType.MobileOwnersNode, Icon = "/CmsEquipmentDatabase;component/Images/Configuration.png" };
NodeView reportsNode = new NodeView(null) { Name = "Reports", HasChildren = true, Type = NodeType.ReportsNode, Icon = "/CmsEquipmentDatabase;component/Images/Configuration.png" };
NodeView manufacturersNode = new NodeView(null) { Name = "Manufacturers", HasChildren = true, Type = NodeType.ManufacturersNode, Icon = "/CmsEquipmentDatabase;component/Images/Configuration.png" };
configurationRootNode.Add(mobilePlantTypesNode);
configurationRootNode.Add(mobilePlantComponentTypesNode);
configurationRootNode.Add(standardComponentPropertiesNode);
configurationRootNode.Add(mobilePlantHirersNode);
configurationRootNode.Add(mobilePlantOwnersNode);
configurationRootNode.Add(reportsNode);
configurationRootNode.Add(manufacturersNode);
ConfigurationTreeView.ItemsSource = configurationRootNode;
}
示例7: InstrumentConfigControl
public InstrumentConfigControl(Tab tab)
{
if (DesignerProperties.IsInDesignTool) { return; }
InitializeComponent();
mTab = tab;
ConfigurationTreeView.LoadOnDemand += ConfigurationTreeViewLoadOnDemand;
ObservableCollection<NodeView> configurationRootNode = new ObservableCollection<NodeView>();
NodeView instrumentTypesNode = new NodeView(null) { Name = "Instrument Types ", HasChildren = true, Type = NodeType.InstrumentTypesNode, Icon = "/CmsEquipmentDatabase;component/Images/Configuration.png" };
NodeView instrumentComponentTypesNode = new NodeView(null) { Name = "Instrument Component Types", HasChildren = true, Type = NodeType.InstrumentComponentTypes, Icon = "/CmsEquipmentDatabase;component/Images/Configuration.png" };
NodeView instrumentPropertiesNode = new NodeView(null) { Name = "Instrument Properties", HasChildren = true, Type = NodeType.InstrumentProperties, Icon = "/CmsEquipmentDatabase;component/Images/Configuration.png" };
NodeView calibrationComponentTypesNode = new NodeView(null) { Name = "Calibration Component Types", HasChildren = true, Type = NodeType.CalibrationComponentTypes, Icon = "/CmsEquipmentDatabase;component/Images/Configuration.png" };
NodeView calibrationPropertiesNode = new NodeView(null) { Name = "Calibration Properties", HasChildren = true, Type = NodeType.CalibrationPropertiesNode, Icon = "/CmsEquipmentDatabase;component/Images/Configuration.png" };
NodeView reportsNode = new NodeView(null) { Name = "Reports", HasChildren = true, Type = NodeType.ReportsNode, Icon = "/CmsEquipmentDatabase;component/Images/Configuration.png" };
NodeView manufacturersNode = new NodeView(null) { Name = "Manufacturers", HasChildren = true, Type = NodeType.ManufacturersNode, Icon = "/CmsEquipmentDatabase;component/Images/Configuration.png" };
NodeView engineeringUnits = new NodeView(null) { Name = "Calibration Engineering Units", HasChildren = true, Type = NodeType.EngineeeringUnitsNode, Icon = "/CmsEquipmentDatabase;component/Images/Configuration.png" };
configurationRootNode.Add(instrumentTypesNode);
configurationRootNode.Add(instrumentComponentTypesNode);
configurationRootNode.Add(instrumentPropertiesNode);
configurationRootNode.Add(calibrationComponentTypesNode);
configurationRootNode.Add(calibrationPropertiesNode);
configurationRootNode.Add(reportsNode);
configurationRootNode.Add(manufacturersNode);
configurationRootNode.Add(engineeringUnits);
ConfigurationTreeView.ItemsSource = configurationRootNode;
}
示例8: 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);
}
};
}
示例9: AddExistingPipeProperty
private void AddExistingPipeProperty(NodeView nodeView)
{
AddExistingPipeComponentProperty dialog = new AddExistingPipeComponentProperty(nodeView.Id);
dialog.Show();
dialog.Closed += (s1, e1) =>
{
if (dialog.DialogResult.HasValue && dialog.DialogResult.Value)
{
EventHandler<AddPipeComponentTypePropertyCompletedEventArgs> addCompleted = null;
addCompleted = (s2, eventArgs) =>
{
PipeComponentTypeProperty pcpt = eventArgs.Result;
if (pcpt != null)
{
NodeView child = new NodeView(nodeView)
{
Id = pcpt.Id,
Name = dialog.ComponentTypeProperty.PipeProperty.Name,
Description = dialog.ComponentTypeProperty.PipeProperty.Description,
Icon = "/CmsEquipmentDatabase;component/Images/Configuration.png",
Type = NodeType.PipeComponentTypeProperty,
HasChildren = false,
SortField = pcpt.Ordinal.ToString()
};
if (nodeView.ChildrenLoaded)
{
nodeView.Children.Add(child);
nodeView.Sort(true);
}
}
mCmsWebServiceClient.AddPipeComponentTypePropertyCompleted -= addCompleted;
};
mCmsWebServiceClient.AddPipeComponentTypePropertyCompleted += addCompleted;
mCmsWebServiceClient.AddPipeComponentTypePropertyAsync(dialog.ComponentTypeProperty);
}
};
}
示例10: PipeConfigControl
public PipeConfigControl(Tab tab)
{
if (DesignerProperties.IsInDesignTool) { return; }
mCmsWebServiceClient = new CmsWebServiceClient(Utils.WcfBinding, Utils.WcfEndPoint);
// Required to initialize variables
InitializeComponent();
mTab = tab;
ConfigurationTreeView.LoadOnDemand += new EventHandler<Telerik.Windows.RadRoutedEventArgs>(ConfigurationTreeView_LoadOnDemand);
RadTreeViewItem treeViewItem = ConfigurationTreeView.SelectedContainer;
ObservableCollection<NodeView> configurationRootNode = new ObservableCollection<NodeView>();
NodeView pipePropertiesNode = new NodeView(null) { Name = "Pipe Properties", HasChildren = true, Type = NodeType.PipePropertiesNode, Icon = "/CmsEquipmentDatabase;component/Images/Configuration.png" };
NodeView pipingComponentTypesNode = new NodeView(null) { Name = "Pipe Component Types", HasChildren = true, Type = NodeType.PipingComponentTypesNode, Icon = "/CmsEquipmentDatabase;component/Images/Configuration.png" };
NodeView standardComponentPropertiesNode = new NodeView(null) { Name = "Pipe Component Properties", HasChildren = true, Type = NodeType.StandardComponentProperties, Icon = "/CmsEquipmentDatabase;component/Images/Configuration.png" };
NodeView reportsNode = new NodeView(null) { Name = "Reports", HasChildren = true, Type = NodeType.ReportsNode, Icon = "/CmsEquipmentDatabase;component/Images/Configuration.png" };
//Nodes under Pipe Properties
NodeView pipeClassNode = new NodeView(pipePropertiesNode) { Name = "Pipe Class", HasChildren = true, Type = NodeType.PipeClassRootNode, Icon = "/CmsEquipmentDatabase;component/Images/Configuration.png" };
NodeView pipeSizeNode = new NodeView(pipePropertiesNode) { Name = "Pipe Size", HasChildren = true, Type = NodeType.PipeSizeRootNode, Icon = "/CmsEquipmentDatabase;component/Images/Configuration.png" };
NodeView pipeFluidCodeNode = new NodeView(pipePropertiesNode) { Name = "Pipe Fluid Code", HasChildren = true, Type = NodeType.PipeFluidCodeRootNode, Icon = "/CmsEquipmentDatabase;component/Images/Configuration.png" };
NodeView specialFeatureNode = new NodeView(pipePropertiesNode) { Name = "Pipe Special Feature", HasChildren = true, Type = NodeType.PipeSpecialFeatureRootNode, Icon = "/CmsEquipmentDatabase;component/Images/Configuration.png" };
NodeView pipeCategoryNode = new NodeView(pipePropertiesNode) { Name = "Pipe Category", HasChildren = true, Type = NodeType.PipeCategoryRootNode, Icon = "/CmsEquipmentDatabase;component/Images/Configuration.png" };
NodeView manufacturersNode = new NodeView(null) { Name = "Manufacturers", HasChildren = true, Type = NodeType.ManufacturersNode, Icon = "/CmsEquipmentDatabase;component/Images/Configuration.png" };
pipePropertiesNode.Children.Add(pipeClassNode);
pipePropertiesNode.Children.Add(pipeSizeNode);
pipePropertiesNode.Children.Add(pipeFluidCodeNode);
pipePropertiesNode.Children.Add(specialFeatureNode);
pipePropertiesNode.Children.Add(pipeCategoryNode);
configurationRootNode.Add(pipePropertiesNode);
configurationRootNode.Add(pipingComponentTypesNode);
configurationRootNode.Add(standardComponentPropertiesNode);
configurationRootNode.Add(reportsNode);
configurationRootNode.Add(manufacturersNode);
ConfigurationTreeView.ItemsSource = configurationRootNode;
}
示例11: LoadReports
private void LoadReports(NodeView expandedNode)
{
var cmsWebServiceClient = new CmsWebServiceClient(Utils.WcfBinding, Utils.WcfEndPoint);
EventHandler<GetReportLinksByTabIdCompletedEventArgs> fetchCompleted = null;
fetchCompleted = (s, eventArgs) =>
{
var reportLinks = eventArgs.Result;
foreach (var reportLink in reportLinks)
{
var child = new NodeView(expandedNode)
{
Id = reportLink.Id,
Name = reportLink.ReportName,
Description = reportLink.Description,
Icon = "/CmsEquipmentDatabase;component/Images/Configuration.png",
Type = NodeType.ReportNode,
HasChildren = false,
SortField = reportLink.Ordinal.ToString()
};
expandedNode.Children.Add(child);
expandedNode.Sort();
cmsWebServiceClient.GetReportLinksByTabIdCompleted -= fetchCompleted;
}
Utils.HideSpinner(expandedNode);
};
cmsWebServiceClient.GetReportLinksByTabIdCompleted += fetchCompleted;
cmsWebServiceClient.GetReportLinksByTabIdAsync(mTab.Id);
}
示例12: 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);
}
示例13: AddInterlockType
private void AddInterlockType(NodeView nodeView)
{
var cmsWebServiceClient = new CmsWebServiceClient(Utils.WcfBinding, Utils.WcfEndPoint);
var dialog = new AddEditInterlockTypeDialog();
dialog.Show();
dialog.Closed += (s1, e1) =>
{
if (dialog.DialogResult.HasValue && dialog.DialogResult.Value)
{
EventHandler<AddInterlockTypeCompletedEventArgs> addCompleted = null;
addCompleted = (s2, eventArgs) =>
{
var mect = eventArgs.Result;
if (mect != null)
{
var child = new NodeView(nodeView)
{
Id = mect.Id,
Name = dialog.InterlockType.Name,
Description = dialog.InterlockType.Description,
Icon = "/CmsEquipmentDatabase;component/Images/Configuration.png",
Type = NodeType.InterlockType,
HasChildren = true,
SortField = dialog.InterlockType.Ordinal.ToString()
};
if (nodeView.ChildrenLoaded)
{
nodeView.Children.Add(child);
nodeView.Sort();
}
}
cmsWebServiceClient.AddInterlockTypeCompleted -= addCompleted;
};
cmsWebServiceClient.AddInterlockTypeCompleted += addCompleted;
cmsWebServiceClient.AddInterlockTypeAsync(dialog.InterlockType);
}
};
}
示例14: AddExistingSystemTypeTest
private void AddExistingSystemTypeTest(NodeView nodeView)
{
int? groupId = null;
var controlSystemTypeId = -1;
if (nodeView.Type == NodeType.ComponentTypeGroup)
{
groupId = nodeView.GroupId;
controlSystemTypeId = nodeView.Parent.Parent.Id;
}
else
{
controlSystemTypeId = nodeView.Parent.Id;
}
var cmsWebServiceClient = new CmsWebServiceClient(Utils.WcfBinding, Utils.WcfEndPoint);
cmsWebServiceClient.GetControlSystemTypeCompleted +=
(s, e) =>
{
var dialog = new AddEditExistingControlTypeTestingPropertyDialog(e.Result, groupId);
dialog.Show();
dialog.Closed += (s1, e1) =>
{
if (dialog.DialogResult.HasValue && dialog.DialogResult.Value)
{
EventHandler<AddUpdateControlSystemTypeTestingPropertyCompletedEventArgs> addCompleted = null;
addCompleted = (s2, eventArgs) =>
{
var pcpt = eventArgs.Result;
if (pcpt != null)
{
var child = new NodeView(nodeView)
{
Id = pcpt.Id,
Name = dialog.SystemTypeTestingProperty.ControlSystemTestingProperty.Name,
Description = dialog.SystemTypeTestingProperty.ControlSystemTestingProperty.Description,
Icon = "/CmsEquipmentDatabase;component/Images/Configuration.png",
Type = NodeType.SystemTypeTest,
HasChildren = false,
SortField = groupId.HasValue ? pcpt.GroupOrdinal.ToString() : pcpt.Ordinal.ToString()
};
nodeView.Children.Add(child);
nodeView.Sort(true);
}
cmsWebServiceClient.AddUpdateControlSystemTypeTestingPropertyCompleted -= addCompleted;
};
cmsWebServiceClient.AddUpdateControlSystemTypeTestingPropertyCompleted += addCompleted;
var controlSystemEquipmentComponentTypeProperty = new ControlSystemTypeTestingProperty
{
ControlSystemTypeId = controlSystemTypeId,
TestPropertyId = dialog.SystemTypeTestingProperty.TestPropertyId,
ComponentTypeGroupId = dialog.SystemTypeTestingProperty.ComponentTypeGroupId,
Ordinal = dialog.SystemTypeTestingProperty.Ordinal,
GroupOrdinal = dialog.SystemTypeTestingProperty.GroupOrdinal
};
if (dialog.GroupChanged)
{
//Group has changed, reload the Nodes
ReloadComponentTypeEquipmentProperties(CommonUtils.EquipmentPropertyType.SystemTestingProperty, nodeView, NodeType.SystemTypeTests);
}
cmsWebServiceClient.AddUpdateControlSystemTypeTestingPropertyAsync(controlSystemEquipmentComponentTypeProperty);
}
};
};
cmsWebServiceClient.GetControlSystemTypeAsync(controlSystemTypeId);
}
示例15: AddExistingControlSystemComponentTypeAlarmProperty
private void AddExistingControlSystemComponentTypeAlarmProperty(NodeView nodeView)
{
var controlSystemEquipmentComponentTypeId = nodeView.Parent.Id;
var cmsWebServiceClient = new CmsWebServiceClient(Utils.WcfBinding, Utils.WcfEndPoint);
cmsWebServiceClient.GetControlSystemComponentTypeCompleted +=
(s, e) =>
{
var dialog = new AddEditExistingControlSystemComponentAlarmPropertyDialog(e.Result);
dialog.Show();
dialog.Closed += (s1, e1) =>
{
if (dialog.DialogResult.HasValue && dialog.DialogResult.Value)
{
EventHandler<SaveControlSystemComponentTypeAlarmPropertyCompletedEventArgs> addCompleted = null;
addCompleted = (s2, eventArgs) =>
{
var entityResult = eventArgs.Result.EntityResult;
if (eventArgs.Result.HasErrors)
{
var popup = new PopupDialog(PopupDialogType.Error, Utils.DisplayErrorMessages(eventArgs.Result.ServerErrorMessages));
popup.Show();
return;
}
if (entityResult != null)
{
var child = new NodeView(nodeView)
{
Id = entityResult.Id,
Name = dialog.ControlSystemComponentTypeAlarmProperty.ControlSystemAlarmProperty.Name,
Description = dialog.ControlSystemComponentTypeAlarmProperty.ControlSystemAlarmProperty.Description,
Icon = "/CmsEquipmentDatabase;component/Images/Configuration.png",
Type = NodeType.ControlSystemComponentTypeAlarmProperty,
HasChildren = false,
SortField = entityResult.Ordinal.ToString()
};
if (nodeView.ChildrenLoaded)
{
nodeView.Children.Add(child);
nodeView.Sort();
}
}
cmsWebServiceClient.SaveControlSystemComponentTypeAlarmPropertyCompleted -= addCompleted;
};
cmsWebServiceClient.SaveControlSystemComponentTypeAlarmPropertyCompleted += addCompleted;
var systemComponentTypeTuningProperty = new ControlSystemComponentTypeAlarmProperty
{
ComponentTypeId = controlSystemEquipmentComponentTypeId,
AlarmPropertyId = dialog.ControlSystemComponentTypeAlarmProperty.AlarmPropertyId,
Ordinal = dialog.ControlSystemComponentTypeAlarmProperty.Ordinal
};
cmsWebServiceClient.SaveControlSystemComponentTypeAlarmPropertyAsync(systemComponentTypeTuningProperty);
}
};
};
cmsWebServiceClient.GetControlSystemComponentTypeAsync(controlSystemEquipmentComponentTypeId);
}