Пример #1
0
        void client_GetMeasurementsByDeviceCompleted(object sender, GetMeasurementsByDeviceCompletedEventArgs e)
        {
            if (e.Error == null)
            {
                m_measurementList = e.Result;
                BindData(m_measurementList);
            }
            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 Measurements for Device", SystemMessage = e.Error.Message, UserMessageType = MessageType.Error
                    },
                                            ButtonType.OkOnly);
                }

                sm.ShowPopup();
            }
            if (m_activityWindow != null)
            {
                m_activityWindow.Close();
            }
        }
Пример #2
0
        void client_GetMeasurementsByDeviceCompleted(object sender, GetMeasurementsByDeviceCompletedEventArgs e)
        {
            if (e.Error == null)
            {
                m_measurementList = e.Result;
                BindData(m_measurementList);
            }
            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 Measurements for Device", SystemMessage = e.Error.Message, UserMessageType = MessageType.Error },
                        ButtonType.OkOnly);

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