void client_GetOutputStreamDeviceListCompleted(object sender, GetOutputStreamDeviceListCompletedEventArgs e) { if (e.Error == null) { ListBoxOutputStreamDeviceList.ItemsSource = e.Result; } 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 Output Stream Device List", SystemMessage = e.Error.Message, UserMessageType = MessageType.Error }, ButtonType.OkOnly); } sm.ShowPopup(); } }
void client_GetOutputStreamDeviceListCompleted(object sender, GetOutputStreamDeviceListCompletedEventArgs e) { if (e.Error == null) { ListBoxOutputStreamDeviceList.ItemsSource = e.Result; if (ListBoxOutputStreamDeviceList.Items.Count > 0 && m_selectFirst) { ListBoxOutputStreamDeviceList.SelectedIndex = 0; m_selectFirst = false; } if (ListBoxOutputStreamDeviceList.Items.Count == 0) ClearForm(); } 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 Output Stream Device List", SystemMessage = e.Error.Message, UserMessageType = MessageType.Error }, ButtonType.OkOnly); sm.ShowPopup(); } }