Esempio n. 1
0
        void AddDevices()
        {
            SystemMessages sm;

            try
            {
                string result = CommonFunctions.AddDevices(null, m_sourceOutputStreamID, m_devicesToBeAdded, (bool)CheckAddDigitals.IsChecked, (bool)CheckAddAnalog.IsChecked);
                sm = new SystemMessages(new Message()
                {
                    UserMessage = result, SystemMessage = string.Empty, UserMessageType = MessageType.Success
                },
                                        ButtonType.OkOnly);
                sm.Owner = Window.GetWindow(this);
                sm.WindowStartupLocation = WindowStartupLocation.CenterOwner;
                sm.ShowPopup();

                GetDevicesForOutputStream();
            }
            catch (Exception ex)
            {
                CommonFunctions.LogException(null, "WPF.AddDevices", ex);
                sm = new SystemMessages(new Message()
                {
                    UserMessage = "Failed to Add Output Stream Device(s)", SystemMessage = ex.Message, UserMessageType = MessageType.Error
                },
                                        ButtonType.OkOnly);
                sm.Owner = Window.GetWindow(this);
                sm.WindowStartupLocation = WindowStartupLocation.CenterOwner;
                sm.ShowPopup();
            }
        }
Esempio n. 2
0
 public string AddDevices(int outputStreamID, Dictionary <int, string> devicesToBeAdded, bool addDigitals, bool addAnalogs)
 {
     try
     {
         return(CommonFunctions.AddDevices(null, outputStreamID, devicesToBeAdded, addDigitals, addAnalogs));
     }
     catch (Exception ex)
     {
         CommonFunctions.LogException(null, "Service.AddDevices", ex);
         CustomServiceFault fault = new CustomServiceFault()
         {
             UserMessage = "Failed to Save Output Stream Device(s)", SystemMessage = ex.Message
         };
         throw new FaultException <CustomServiceFault>(fault);
     }
 }