示例#1
0
        void client_GetWizardConfigurationInfoCompleted(object sender, GetWizardConfigurationInfoCompletedEventArgs e)
        {
            if (e.Error == null)
            {
                m_wizardDeviceInfoList            = e.Result;
                ItemControlDeviceList.ItemsSource = m_wizardDeviceInfoList;
                if (m_wizardDeviceInfoList.Count > 1)
                {
                    CheckboxConnectToPDC.IsChecked = true;
                    SystemMessages sm = new SystemMessages(new openPDCManager.Utilities.Message()
                    {
                        UserMessage = "Please fill in required concentrator information.", SystemMessage = "The current configuration defines more than one device which means this connection is to a concentrated data stream. A unique concentrator acronym is required to identify the concentration device.", UserMessageType = openPDCManager.Utilities.MessageType.Information
                    },
                                                           ButtonType.OkOnly);
                    sm.ShowPopup();
                    TextBoxPDCAcronym.Focus();
                }
                else
                {
                    CheckboxConnectToPDC.IsChecked = 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 Parse Configuration File", SystemMessage = e.Error.Message, UserMessageType = MessageType.Error
                    },
                                            ButtonType.OkOnly);
                }

                sm.ShowPopup();
            }
            if (m_activityWindow != null)
            {
                m_activityWindow.Close();
            }
            m_configFileData.Close();
        }
        void client_GetWizardConfigurationInfoCompleted(object sender, GetWizardConfigurationInfoCompletedEventArgs e)
        {
            if (e.Error == null)
            {
                m_wizardDeviceInfoList = e.Result;
                ItemControlDeviceList.ItemsSource = m_wizardDeviceInfoList;
                if (m_wizardDeviceInfoList.Count > 1)
                {
                    CheckboxConnectToPDC.IsChecked = true;
                    SystemMessages sm = new SystemMessages(new openPDCManager.Utilities.Message() { UserMessage = "Please fill in required concentrator information.", SystemMessage = "The current configuration defines more than one device which means this connection is to a concentrated data stream. A unique concentrator acronym is required to identify the concentration device.", UserMessageType = openPDCManager.Utilities.MessageType.Information },
                                ButtonType.OkOnly);
                    sm.ShowPopup();
                    TextBoxPDCAcronym.Focus();
                }
                else
                    CheckboxConnectToPDC.IsChecked = 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 Parse Configuration File", SystemMessage = e.Error.Message, UserMessageType = MessageType.Error },
                        ButtonType.OkOnly);

                sm.ShowPopup();
            }
            if (m_activityWindow != null)
                m_activityWindow.Close();
            m_configFileData.Close();
        }