Simple helper class so we can append our log to the form in a thread safe way
Inheritance: log4net.Appender.AppenderSkeleton
Exemplo n.º 1
0
        /// <summary>
        /// Initialize the controls and whatnot
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="e"></param>
        private void MainForm_Load(object sender, EventArgs e)
        {
            try
            {
                ShowLoadingSpinner();

                //TODO: special initializer for the logger / or something to get the output stream before the copyright / etc is shown

                var appender = new TextboxAppender(this.txtLogConsole);
                FormController.Instance.InitLogging(appender);

                //wait until after the form is loaded to do this, we want to show the log output on the form
                FormController.Instance.Initialize();

                //
                // Initialize the rest of the form
                //

                this.LoadFonts();
                this.PopulateLists();
                this.AddDefaultTooltips();
                this.SmartToggler();

                this.FixWeirdStyles();

                this.MinimumSize = new Size(800, 650);

                this.PopulateControls();
            }
            catch (Exception ex)
            {
                this.DisplayException("Form Load", ex);
            }
            finally
            {
                HideLoadingSpinner();
            }
        }
Exemplo n.º 2
0
        /// <summary>
        /// Initialize the controls and whatnot
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="e"></param>
        private void MainForm_Load(object sender, EventArgs e)
        {
            try
            {
                ShowLoadingSpinner();

                //TODO: special initializer for the logger / or something to get the output stream before the copyright / etc is shown

                var appender = new TextboxAppender(this.txtLogConsole);
                FormController.Instance.InitLogging(appender);

                //wait until after the form is loaded to do this, we want to show the log output on the form
                FormController.Instance.Initialize();

                //
                // Initialize the rest of the form
                //

                this.LoadFonts();
                this.PopulateLists();
                this.AddDefaultTooltips();
                this.SmartToggler();

                this.FixWeirdStyles();

                this.MinimumSize = new Size(800, 650);

                this.PopulateControls();
            }
            catch (Exception ex)
            {
                this.DisplayException("Form Load", ex);
            }
            finally
            {
                HideLoadingSpinner();
            }
        }