Exemple #1
0
        private LogCons()
        {
            this.InitializeComponent();
            this.logConsoleTask = new Task.LogConsole();
            this.logConsoleTask.AddObserver(this);

            this.currentLevel                  = LogLevel.Info;
            this.currentLevelObject            = this.TSMI_Info;
            this.currentLevelObject.CheckState = CheckState.Checked;

            // The parent (Main GUI) must not have any visual/behavioral
            // influence on the log console
            this.Owner = null;
        }
Exemple #2
0
        private LogCons()
        {
            this.InitializeComponent();
            this.logConsoleTask = new Task.LogConsole();
            this.logConsoleTask.AddObserver(this);

            this.currentLevel                  = LogLevel.Info;
            this.currentLevelObject            = this.TSMI_Info;
            this.currentLevelObject.CheckState = CheckState.Checked;

            // The parent (Main GUI) must not have any visual/behavioral
            // influence on the log console
            this.Owner = null;

            // Get last loglevel
            string tmpLevel = Common.WinRegistry.GetValue($@"Logging", "Level");

            tmpLevel = string.IsNullOrEmpty(tmpLevel) == false ? tmpLevel : "info";

            switch (tmpLevel.Trim().ToLower())
            {
            case "debug":
                this.SetLogLevel(LogLevel.Debug);
                break;

            case "info":
                this.SetLogLevel(LogLevel.Info);
                break;

            case "warning":
                this.SetLogLevel(LogLevel.Warning);
                break;

            case "error":
                this.SetLogLevel(LogLevel.Error);
                break;

            default:
                this.SetLogLevel(LogLevel.Info);
                break;
            }

            this.Text = $"{TITLE_BASIS}:   Level {this.currentLevel.ToString()}";
        }