예제 #1
0
        /// <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 },
            };
        }
예제 #2
0
        /// <summary>
        /// Creating an instance of a class
        /// </summary>
        /// <returns> Class instance </returns>
        public static PluginReporter Instance()
        {
            if (_instance == null)
            {
                _instance = new PluginReporter();
            }

            return(_instance);
        }
예제 #3
0
 /// <summary>
 /// Error display method
 /// </summary>
 private void ShowError()
 {
     MessageBox.Show(PluginReporter.Instance().GetLastError(),
                     "Error", MessageBoxButtons.OK, MessageBoxIcon.Error);
 }