本文整理汇总了C#中openPDCManager.ModalDialogs.SystemMessages类的典型用法代码示例。如果您正苦于以下问题:C# SystemMessages类的具体用法?C# SystemMessages怎么用?C# SystemMessages使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
SystemMessages类属于openPDCManager.ModalDialogs命名空间,在下文中一共展示了SystemMessages类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: GetDevicesForOutputStream
void GetDevicesForOutputStream()
{
try
{
m_deviceList = CommonFunctions.GetDevicesForOutputStream(null, m_sourceOutputStreamID, m_nodeValue);
ListBoxDeviceList.ItemsSource = m_deviceList;
if (ListBoxDeviceList.Items.Count > 0)
ListBoxDeviceList.SelectedIndex = 0;
else
{
SystemMessages sm = new SystemMessages(new Message() { UserMessage = "There are no more devices to add to the Output Stream", SystemMessage = "Click OK to return back to Current Devices For Output Stream list.", UserMessageType = MessageType.Information },
ButtonType.OkOnly);
sm.Owner = Window.GetWindow(this);
sm.WindowStartupLocation = WindowStartupLocation.CenterOwner;
sm.ShowPopup();
(Window.GetWindow(this)).Close();
}
}
catch (Exception ex)
{
CommonFunctions.LogException(null, "WPF.GetDevicesForOutputStream", ex);
SystemMessages sm = new SystemMessages(new Message() { UserMessage = "Failed to Retrieve Device for Output Stream", SystemMessage = ex.Message, UserMessageType = MessageType.Error },
ButtonType.OkOnly);
sm.Owner = Window.GetWindow(this);
sm.WindowStartupLocation = WindowStartupLocation.CenterOwner;
sm.ShowPopup();
}
}
示例2: SaveCompany
void SaveCompany(Company company, bool isNew)
{
SystemMessages sm;
try
{
string result = CommonFunctions.SaveCompany(null, company, isNew);
sm = new SystemMessages(new Message() { UserMessage = result, SystemMessage = string.Empty, UserMessageType = MessageType.Success },
ButtonType.OkOnly);
sm.Owner = Window.GetWindow(this);
sm.ShowPopup();
GetCompanies();
//ClearForm();
//make this newly added or updated item as default selected. So user can click initialize right away.
ListBoxCompanyList.SelectedItem = ((List<Company>)ListBoxCompanyList.ItemsSource).Find(c => c.Acronym == company.Acronym);
}
catch (Exception ex)
{
CommonFunctions.LogException(null, "WPF.SaveCompany", ex);
sm = new SystemMessages(new Message() { UserMessage = "Failed to Save Company Information", SystemMessage = ex.Message, UserMessageType = MessageType.Error },
ButtonType.OkOnly);
sm.Owner = Window.GetWindow(this);
sm.ShowPopup();
}
}
示例3: client_SaveCompanyCompleted
void client_SaveCompanyCompleted(object sender, SaveCompanyCompletedEventArgs e)
{
SystemMessages sm;
if (e.Error == null)
{
GetCompanies();
ClearForm();
//(Application.Current.RootVisual as MasterLayoutControl).UserControlSelectNode.RaiseNotification();
sm = new SystemMessages(new Message() { UserMessage = e.Result, SystemMessage = string.Empty, UserMessageType = MessageType.Success },
ButtonType.OkOnly);
}
else
{
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 Save Company Information", SystemMessage = e.Error.Message, UserMessageType = MessageType.Error },
ButtonType.OkOnly);
}
sm.ShowPopup();
}
示例4: client_GetOutputStreamDeviceAnalogListCompleted
void client_GetOutputStreamDeviceAnalogListCompleted(object sender, GetOutputStreamDeviceAnalogListCompletedEventArgs e)
{
if (e.Error == null)
{
ListBoxOutputStreamDeviceAnalogList.ItemsSource = e.Result;
if (ListBoxOutputStreamDeviceAnalogList.Items.Count > 0 && m_selectFirst)
{
ListBoxOutputStreamDeviceAnalogList.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 Ouptu Stream Device Analog List", SystemMessage = e.Error.Message, UserMessageType = MessageType.Error },
ButtonType.OkOnly);
sm.ShowPopup();
}
}
示例5: client_GetCompaniesCompleted
void client_GetCompaniesCompleted(object sender, GetCompaniesCompletedEventArgs e)
{
if (e.Error == null)
ComboboxCompany.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 Companies", SystemMessage = e.Error.Message, UserMessageType = MessageType.Error },
ButtonType.OkOnly);
sm.ShowPopup();
}
if (ComboboxCompany.Items.Count > 0)
ComboboxCompany.SelectedIndex = 0;
if (deviceToEdit != null && deviceToEdit.CompanyID.HasValue)
ComboboxCompany.SelectedItem = new KeyValuePair<int, string>((int)deviceToEdit.CompanyID, deviceToEdit.CompanyName);
}
示例6: ButtonClear_Click
void ButtonClear_Click(object sender, RoutedEventArgs e)
{
//Load Default Settings.
IsolatedStorageManager.SetDefaultStorage(true);
LoadSettingsFromIsolatedStorage();
SystemMessages sm = new SystemMessages(new Message() { UserMessage = "Successfully Restored Default System Settings", SystemMessage = string.Empty, UserMessageType = MessageType.Success },
ButtonType.OkOnly);
sm.Owner = Window.GetWindow(this);
sm.WindowStartupLocation = WindowStartupLocation.CenterOwner;
sm.ShowPopup();
}
示例7: ButtonClear_Click
void ButtonClear_Click(object sender, RoutedEventArgs e)
{
Storyboard sb = new Storyboard();
sb = Application.Current.Resources["ButtonPressAnimation"] as Storyboard;
sb.Completed += new EventHandler(delegate(object obj, EventArgs es) { sb.Stop(); });
Storyboard.SetTarget(sb, ButtonClearTransform);
sb.Begin();
//Load Default Settings.
ProxyClient.SetDefaultSystemSettings(true);
LoadSettingsFromIsolatedStorage();
SystemMessages sm = new SystemMessages(new Message() { UserMessage = "Successfully Restored Default System Settings", SystemMessage = string.Empty, UserMessageType = MessageType.Success },
ButtonType.OkOnly);
sm.ShowPopup();
}
示例8: GetIaonTreeData
void GetIaonTreeData()
{
try
{
TreeViewIaon.ItemsSource = CommonFunctions.GetIaonTreeData(null, ((App)Application.Current).NodeValue);
}
catch (Exception ex)
{
CommonFunctions.LogException(null, "WPF.GetIaonTreeData", ex);
SystemMessages sm = new SystemMessages(new Message() { UserMessage = "Failed to Retrieve Iaon Tree Data", SystemMessage = ex.Message, UserMessageType = MessageType.Error },
ButtonType.OkOnly);
sm.Owner = Window.GetWindow(this);
sm.WindowStartupLocation = WindowStartupLocation.CenterOwner;
sm.ShowPopup();
}
}
示例9: GetOtherDeviceList
void GetOtherDeviceList()
{
try
{
m_otherDeviceList = new ObservableCollection<OtherDevice>(CommonFunctions.GetOtherDeviceList(null));
ListBoxOtherDeviceList.ItemsSource = m_otherDeviceList;
}
catch (Exception ex)
{
CommonFunctions.LogException(null, "WPF.GetOtherDeviceList", ex);
SystemMessages sm = new SystemMessages(new Message() { UserMessage = "Failed to Retrieve Other Device List", SystemMessage = ex.Message, UserMessageType = MessageType.Error },
ButtonType.OkOnly);
sm.Owner = Window.GetWindow(this);
sm.WindowStartupLocation = WindowStartupLocation.CenterOwner;
sm.ShowPopup();
}
}
示例10: GetHistorians
void GetHistorians()
{
try
{
ListBoxHistorianList.ItemsSource = CommonFunctions.GetHistorianList(null, m_nodeID);
if (ListBoxHistorianList.Items.Count > 0 && ListBoxHistorianList.SelectedIndex < 0)
ListBoxHistorianList.SelectedIndex = 0;
}
catch (Exception ex)
{
CommonFunctions.LogException(null, "WPF.GetHistorianList", ex);
SystemMessages sm = new SystemMessages(new Message() { UserMessage = "Failed to Save Historian Information", SystemMessage = ex.Message, UserMessageType = MessageType.Error },
ButtonType.OkOnly);
sm.Owner = Window.GetWindow(this);
sm.ShowPopup();
}
}
示例11: GetNodes
void GetNodes()
{
try
{
ComboBoxNode.ItemsSource = CommonFunctions.GetNodes(null, true, false);
if (ComboBoxNode.Items.Count > 0)
ComboBoxNode.SelectedIndex = 0;
}
catch (Exception ex)
{
CommonFunctions.LogException(null, "WPF.GetNodes", ex);
SystemMessages sm = new SystemMessages(new Message() { UserMessage = "Failed to Retrieve Nodes", SystemMessage = ex.Message, UserMessageType = MessageType.Error },
ButtonType.OkOnly);
sm.Owner = Window.GetWindow(this);
sm.ShowPopup();
}
}
示例12: GetAdapterList
void GetAdapterList()
{
try
{
ListBoxAdapterList.ItemsSource = CommonFunctions.GetAdapterList(null, false, m_adapterType, m_nodeID);
if (ListBoxAdapterList.Items.Count > 0)
ListBoxAdapterList.SelectedIndex = 0;
}
catch (Exception ex)
{
CommonFunctions.LogException(null, "WPF.GetAdapterList", ex);
SystemMessages sm = new SystemMessages(new Message() { UserMessage = "Failed to Retrieve Adapter List", SystemMessage = ex.Message, UserMessageType = MessageType.Error },
ButtonType.OkOnly);
sm.Owner = Window.GetWindow(this);
sm.ShowPopup();
}
}
示例13: RefreshNodeList
public void RefreshNodeList()
{
try
{
ComboboxNode.ItemsSource = CommonFunctions.GetNodeList(null, true);
SetGlobalVariables();
}
catch (Exception ex)
{
CommonFunctions.LogException(null, "WPF.RefreshNodeList", ex);
SystemMessages sm = new SystemMessages(new Message() { UserMessage = "Failed to Retrieve Nodes", SystemMessage = ex.Message, UserMessageType = MessageType.Error },
ButtonType.OkOnly);
sm.Owner = Window.GetWindow(this);
sm.ShowPopup();
}
m_raiseNodesCollectionChanged = false;
}
示例14: GetOutputStreamDeviceAnalogList
void GetOutputStreamDeviceAnalogList()
{
try
{
ListBoxOutputStreamDeviceAnalogList.ItemsSource = CommonFunctions.GetOutputStreamDeviceAnalogList(null, m_sourceOutputStreamDeviceID);
if (ListBoxOutputStreamDeviceAnalogList.Items.Count > 0)
ListBoxOutputStreamDeviceAnalogList.SelectedIndex = 0;
}
catch (Exception ex)
{
CommonFunctions.LogException(null, "WPF.GetOutputStreamDeviceAnalogList", ex);
SystemMessages sm = new SystemMessages(new Message() { UserMessage = "Failed to Retrieve Ouptu Stream Device Analog List", SystemMessage = ex.Message, UserMessageType = MessageType.Error },
ButtonType.OkOnly);
sm.Owner = Window.GetWindow(this);
sm.WindowStartupLocation = WindowStartupLocation.CenterOwner;
sm.ShowPopup();
}
}
示例15: GetCompanies
public void GetCompanies()
{
try
{
ComboboxCompany.ItemsSource = CommonFunctions.GetCompanies(null, true);
if (ComboboxCompany.Items.Count > 0)
ComboboxCompany.SelectedIndex = 0;
}
catch (Exception ex)
{
CommonFunctions.LogException(null, "WPF.GetCompanies", ex);
SystemMessages sm = new SystemMessages(new Message() { UserMessage = "Failed to Retrieve Companies", SystemMessage = ex.Message, UserMessageType = MessageType.Error },
ButtonType.OkOnly);
sm.Owner = Window.GetWindow(this);
sm.WindowStartupLocation = WindowStartupLocation.CenterOwner;
sm.ShowPopup();
}
}