Esempio n. 1
0
        private void _logFileWatcher_LogFileErrorStateChanged(object sender, LogFileErrorState e)
        {
            switch (e)
            {
            case LogFileErrorState.NoError:
                lLogFileError.Text      = "No Errors";
                lLogFileError.ForeColor = Color.White;
                lLogFileError.Visible   = true;
                break;

            case LogFileErrorState.Error:
                lLogFileError.Text      = "Errors in logs";
                lLogFileError.ForeColor = Color.OrangeRed;
                lLogFileError.Visible   = true;
                break;

            case LogFileErrorState.Warning:
                lLogFileError.Text      = "Warnings in logs";
                lLogFileError.ForeColor = Color.Orange;
                lLogFileError.Visible   = true;
                break;

            case LogFileErrorState.FileNotFound:
                lLogFileError.Text      = "FileNotFound";
                lLogFileError.ForeColor = Color.Red;
                lLogFileError.Visible   = true;
                break;

            case LogFileErrorState.DirectoryNotFound:
                break;

            default:
                lLogFileError.Text      = "DirectoryNotFound";
                lLogFileError.ForeColor = Color.Red;
                lLogFileError.Visible   = true;
                break;
            }
        }
        private void SetState(LogFileErrorState s)
        {
            LogFileErrorState = s;

            LogFileErrorStateChanged?.Invoke(this, s);
        }