/// <summary> /// Constructor class /// </summary> public MainForm() { InitializeComponent(); PluginReporter.Instance().OnAdd += ShowError; _typeErrorToTextBoxDictionary = new Dictionary <PluginReporter.TypeError, TextBox>() { { PluginReporter.TypeError.ErrorStandHeight, StandHeightTextBox }, { PluginReporter.TypeError.ErrorStandDiameter, StandDiameterTextBox }, { PluginReporter.TypeError.ErrorLegHeight, LegHeightTextBox }, { PluginReporter.TypeError.ErrorLegWidth, LegWidthTextBox }, { PluginReporter.TypeError.ErrorLegThikness, LegThiknessTextBox }, { PluginReporter.TypeError.ErrorScreenHeight, ScreenHeightTextBox }, { PluginReporter.TypeError.ErrorScreenWidth, ScreenWidthTextBox }, { PluginReporter.TypeError.ErrorScreenThikness, ScreenThiknessTextBox }, }; }
/// <summary> /// Creating an instance of a class /// </summary> /// <returns> Class instance </returns> public static PluginReporter Instance() { if (_instance == null) { _instance = new PluginReporter(); } return(_instance); }
/// <summary> /// Error display method /// </summary> private void ShowError() { MessageBox.Show(PluginReporter.Instance().GetLastError(), "Error", MessageBoxButtons.OK, MessageBoxIcon.Error); }