Exemplo n.º 1
0
        void client_GetNodeListCompleted(object sender, GetNodeListCompletedEventArgs e)
        {
            if (e.Error == null)
            {
                ListBoxNodeList.ItemsSource = e.Result;
                if (ListBoxNodeList.Items.Count > 0 && m_selectFirst)
                {
                    ListBoxNodeList.SelectedIndex = 0;
                    m_selectFirst = false;
                }
            }
            else
            {
                SystemMessages sm;
                if (e.Error is FaultException<CustomServiceFault>)
                {
                    FaultException<CustomServiceFault> fault = e.Error as FaultException<CustomServiceFault>;
                    sm = new SystemMessages(new Message() { UserMessage = fault.Detail.UserMessage, SystemMessage = fault.Detail.SystemMessage, UserMessageType = MessageType.Error },
                        ButtonType.OkOnly);
                }
                else
                    sm = new SystemMessages(new Message() { UserMessage = "Failed to Retrieve Node List", SystemMessage = e.Error.Message, UserMessageType = MessageType.Error },
                        ButtonType.OkOnly);

                sm.ShowPopup();
            }

            if (m_activityWindow != null)
                m_activityWindow.Close();
        }
Exemplo n.º 2
0
        void m_client_GetNodeListCompleted(object sender, GetNodeListCompletedEventArgs e)
        {
            if (e.Error == null)
            {
                ComboboxNode.ItemsSource = e.Result;
                SetGlobalVariables();
            }
            else
            {
                SystemMessages sm;
                if (e.Error is FaultException <CustomServiceFault> )
                {
                    FaultException <CustomServiceFault> fault = e.Error as FaultException <CustomServiceFault>;
                    sm = new SystemMessages(new Message()
                    {
                        UserMessage = fault.Detail.UserMessage, SystemMessage = fault.Detail.SystemMessage, UserMessageType = MessageType.Error
                    },
                                            ButtonType.OkOnly);
                }
                else
                {
                    sm = new SystemMessages(new Message()
                    {
                        UserMessage = "Failed to Retrieve Nodes", SystemMessage = e.Error.Message, UserMessageType = MessageType.Error
                    },
                                            ButtonType.OkOnly);
                }

                sm.ShowPopup();
            }
            m_raiseNodesCollectionChanged = false;
        }
Exemplo n.º 3
0
        void client_GetNodeListCompleted(object sender, GetNodeListCompletedEventArgs e)
        {
            if (e.Error == null)
            {
                ListBoxNodeList.ItemsSource = e.Result;
                if (ListBoxNodeList.Items.Count > 0 && m_selectFirst)
                {
                    ListBoxNodeList.SelectedIndex = 0;
                    m_selectFirst = false;
                }
            }
            else
            {
                SystemMessages sm;
                if (e.Error is FaultException <CustomServiceFault> )
                {
                    FaultException <CustomServiceFault> fault = e.Error as FaultException <CustomServiceFault>;
                    sm = new SystemMessages(new Message()
                    {
                        UserMessage = fault.Detail.UserMessage, SystemMessage = fault.Detail.SystemMessage, UserMessageType = MessageType.Error
                    },
                                            ButtonType.OkOnly);
                }
                else
                {
                    sm = new SystemMessages(new Message()
                    {
                        UserMessage = "Failed to Retrieve Node List", SystemMessage = e.Error.Message, UserMessageType = MessageType.Error
                    },
                                            ButtonType.OkOnly);
                }

                sm.ShowPopup();
            }

            if (m_activityWindow != null)
            {
                m_activityWindow.Close();
            }
        }
Exemplo n.º 4
0
        void m_client_GetNodeListCompleted(object sender, GetNodeListCompletedEventArgs e)
        {
            if (e.Error == null)
            {
                ComboboxNode.ItemsSource = e.Result;
                App app = (App)Application.Current;
                if (ComboboxNode.Items.Count > 0)
                {
                    if (!string.IsNullOrEmpty(app.NodeValue))
                    {
                        foreach (Node item in ComboboxNode.Items)
                        {
                            if (item.ID == app.NodeValue)
                            {
                                ComboboxNode.SelectedItem = item;
                                break;
                            }

                        }
                    }
                    else
                        ComboboxNode.SelectedIndex = 0;

                    Node node = (Node)ComboboxNode.SelectedItem;
                    app.NodeValue = node.ID;
                    app.NodeName = node.Name;
                    app.TimeSeriesDataServiceUrl = node.TimeSeriesDataServiceUrl;
                    app.RemoteStatusServiceUrl = node.RemoteStatusServiceUrl;
                    app.RealTimeStatisticServiceUrl = node.RealTimeStatisticServiceUrl;
                }
                else
                    app.NodeValue = string.Empty;
            }
            else
            {
                SystemMessages sm;
                if (e.Error is FaultException<CustomServiceFault>)
                {
                    FaultException<CustomServiceFault> fault = e.Error as FaultException<CustomServiceFault>;
                    sm = new SystemMessages(new Message() { UserMessage = fault.Detail.UserMessage, SystemMessage = fault.Detail.SystemMessage, UserMessageType = MessageType.Error },
                        ButtonType.OkOnly);
                }
                else
                    sm = new SystemMessages(new Message() { UserMessage = "Failed to Retrieve Nodes", SystemMessage = e.Error.Message, UserMessageType = MessageType.Error },
                        ButtonType.OkOnly);

                sm.ShowPopup();
            }
            m_raiseNodesCollectionChanged = false;
        }
Exemplo n.º 5
0
        void m_client_GetNodeListCompleted(object sender, GetNodeListCompletedEventArgs e)
        {
            if (e.Error == null)
            {
                ComboboxNode.ItemsSource = e.Result;
                App app = (App)Application.Current;
                if (ComboboxNode.Items.Count > 0)
                {
                    if (!string.IsNullOrEmpty(app.NodeValue))
                    {
                        foreach (Node item in ComboboxNode.Items)
                        {
                            if (item.ID == app.NodeValue)
                            {
                                ComboboxNode.SelectedItem = item;
                                break;
                            }
                        }
                    }
                    else
                    {
                        ComboboxNode.SelectedIndex = 0;
                    }

                    Node node = (Node)ComboboxNode.SelectedItem;
                    app.NodeValue = node.ID;
                    app.NodeName  = node.Name;
                    app.TimeSeriesDataServiceUrl    = node.TimeSeriesDataServiceUrl;
                    app.RemoteStatusServiceUrl      = node.RemoteStatusServiceUrl;
                    app.RealTimeStatisticServiceUrl = node.RealTimeStatisticServiceUrl;
                }
                else
                {
                    app.NodeValue = string.Empty;
                }
            }
            else
            {
                SystemMessages sm;
                if (e.Error is FaultException <CustomServiceFault> )
                {
                    FaultException <CustomServiceFault> fault = e.Error as FaultException <CustomServiceFault>;
                    sm = new SystemMessages(new Message()
                    {
                        UserMessage = fault.Detail.UserMessage, SystemMessage = fault.Detail.SystemMessage, UserMessageType = MessageType.Error
                    },
                                            ButtonType.OkOnly);
                }
                else
                {
                    sm = new SystemMessages(new Message()
                    {
                        UserMessage = "Failed to Retrieve Nodes", SystemMessage = e.Error.Message, UserMessageType = MessageType.Error
                    },
                                            ButtonType.OkOnly);
                }

                sm.ShowPopup();
            }
            m_raiseNodesCollectionChanged = false;
        }