当前位置: 首页>>代码示例>>C#>>正文


C# CmsWebServiceClient.GetControlSystemComponentTypeAsync方法代码示例

本文整理汇总了C#中CmsWebServiceClient.GetControlSystemComponentTypeAsync方法的典型用法代码示例。如果您正苦于以下问题:C# CmsWebServiceClient.GetControlSystemComponentTypeAsync方法的具体用法?C# CmsWebServiceClient.GetControlSystemComponentTypeAsync怎么用?C# CmsWebServiceClient.GetControlSystemComponentTypeAsync使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在CmsWebServiceClient的用法示例。


在下文中一共展示了CmsWebServiceClient.GetControlSystemComponentTypeAsync方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。

示例1: 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);
        }
开发者ID:barrett2474,项目名称:CMS2,代码行数:63,代码来源:ControlSystemConfigControl.xaml.cs

示例2: AddExistingControlSystemComponentTypeTuningProperty

        private void AddExistingControlSystemComponentTypeTuningProperty(NodeView nodeView)
        {
            int? groupId = null;
            var controlSystemEquipmentComponentTypeId = -1;

            if (nodeView.Type == NodeType.ComponentTypeGroup)
            {
                groupId = nodeView.Id;
                controlSystemEquipmentComponentTypeId = nodeView.Parent.Parent.Id;
            }
            else
            {
                controlSystemEquipmentComponentTypeId = nodeView.Parent.Id;
            }

            var cmsWebServiceClient = new CmsWebServiceClient(Utils.WcfBinding, Utils.WcfEndPoint);

            cmsWebServiceClient.GetControlSystemComponentTypeCompleted +=
                (s, e) =>
                {
                    var dialog = new AddEditExistingControlSystemComponentTuningPropertyDialog(e.Result);
                    dialog.Show();

                    dialog.Closed += (s1, e1) =>
                    {
                        if (dialog.DialogResult.HasValue && dialog.DialogResult.Value)
                        {
                            EventHandler<AddUpdateControlSystemComponentTypeTuningPropertyCompletedEventArgs> addCompleted = null;
                            addCompleted = (s2, eventArgs) =>
                            {
                                var pcpt = eventArgs.Result;

                                if (pcpt != null)
                                {
                                    var child = new NodeView(nodeView)
                                    {
                                        Id = pcpt.Id,
                                        Name = dialog.ControlSystemComponentTypeTuningProperty.ControlSystemTuningProperty.Name,
                                        Description = dialog.ControlSystemComponentTypeTuningProperty.ControlSystemTuningProperty.Description,
                                        Icon = "/CmsEquipmentDatabase;component/Images/Configuration.png",
                                        Type = NodeType.ControlSystemComponentTypeTuningProperty,
                                        HasChildren = false,
                                        SortField = groupId.HasValue ? pcpt.GroupOrdinal.ToString() : pcpt.Ordinal.ToString()
                                    };
                                    if (nodeView.ChildrenLoaded)
                                    {
                                        nodeView.Children.Add(child);
                                        nodeView.Sort();
                                    }
                                }

                                cmsWebServiceClient.AddUpdateControlSystemComponentTypeTuningPropertyCompleted -= addCompleted;
                            };
                            cmsWebServiceClient.AddUpdateControlSystemComponentTypeTuningPropertyCompleted += addCompleted;

                            var systemComponentTypeTuningProperty = new ControlSystemComponentTypeTuningProperty
                            {
                                ControlSystemComponentTypeId = controlSystemEquipmentComponentTypeId,
                                ControlSystemTuningPropertyId = dialog.ControlSystemComponentTypeTuningProperty.ControlSystemTuningPropertyId,
                                ComponentTypeGroupId = groupId,
                                Ordinal = groupId.HasValue ? int.Parse(nodeView.SortField) : dialog.ControlSystemComponentTypeTuningProperty.Ordinal,
                                GroupOrdinal = groupId.HasValue ? dialog.ControlSystemComponentTypeTuningProperty.Ordinal : 0
                            };

                            cmsWebServiceClient.AddUpdateControlSystemComponentTypeTuningPropertyAsync(systemComponentTypeTuningProperty);
                        }
                    };
                };
            cmsWebServiceClient.GetControlSystemComponentTypeAsync(controlSystemEquipmentComponentTypeId);
        }
开发者ID:barrett2474,项目名称:CMS2,代码行数:70,代码来源:ControlSystemConfigControl.xaml.cs

示例3: EditControlSystemComponentType

        private void EditControlSystemComponentType(NodeView nodeView)
        {
            var cmsWebServiceClient = new CmsWebServiceClient(Utils.WcfBinding, Utils.WcfEndPoint);
            EventHandler<GetControlSystemComponentTypeCompletedEventArgs> getControlSystemComponentCompleted = null;
            getControlSystemComponentCompleted = (s, eventArgs) =>
            {
                var mc = eventArgs.Result;

                var dialog = new AddEditControlSystemComponentTypeDialog(mc);
                dialog.Show();
                dialog.Closed += (s1, e1) =>
                {
                    if (dialog.DialogResult.HasValue && dialog.DialogResult.Value)
                    {
                        EventHandler<AddControlSystemComponentTypeCompletedEventArgs> addCompleted = null;
                        addCompleted = (s2, e2) =>
                        {
                            var controlSystemEquipmentComponentType = e2.Result;
                            nodeView.Name = controlSystemEquipmentComponentType.Name;
                            nodeView.Description = controlSystemEquipmentComponentType.Description;
                            nodeView.SortField = controlSystemEquipmentComponentType.Ordinal.ToString();

                            cmsWebServiceClient.AddControlSystemComponentTypeCompleted -= addCompleted;
                            nodeView.Parent.Sort();
                        };

                        cmsWebServiceClient.AddControlSystemComponentTypeCompleted += addCompleted;
                        cmsWebServiceClient.AddControlSystemComponentTypeAsync(dialog.ComponentType);
                    }
                };
                cmsWebServiceClient.GetControlSystemComponentTypeCompleted -= getControlSystemComponentCompleted;
            };
            cmsWebServiceClient.GetControlSystemComponentTypeCompleted += getControlSystemComponentCompleted;
            cmsWebServiceClient.GetControlSystemComponentTypeAsync(nodeView.Id);
        }
开发者ID:barrett2474,项目名称:CMS2,代码行数:35,代码来源:ControlSystemConfigControl.xaml.cs


注:本文中的CmsWebServiceClient.GetControlSystemComponentTypeAsync方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。