Example #1
0
        public FormJT2SL(El2SlConfig config, EventLog eventLog, EventLogEntryType eventLogEntryType)
        {
            InitializeComponent();
            _eventLog = eventLog;
            _eventLogEntryType = eventLogEntryType;

            lInfo.Text = string.Format("{0}:{1}", _eventLog.LogDisplayName, eventLogEntryType.ToString());

            cbEnabled.Checked = config.LoggingEnabled(eventLog, eventLogEntryType);
            cbEnabled_CheckedChanged(cbEnabled, new EventArgs());

            #region Grid fill

            #region Preparing Columns headers

            for ( int fh = 0; fh < SFacilityes.Length; fh++ ) // columns
            {
                tlpFacilityPriority.ColumnCount++;
                VerticalLabel lColumn = new VerticalLabel();
                lColumn.Text = SFacilityes[fh];
                //lColumn.TextAlign = ContentAlignment.BottomCenter;
                tlpFacilityPriority.Controls.Add(lColumn, tlpFacilityPriority.ColumnCount - 1, 0);
            }

            #endregion

            for (int pt = 0; pt < SPriorityes.Length; pt++ ) // rows
            {
                #region Preparing row labels

                Label lRow = new Label();
                lRow.Text = SPriorityes[pt];
                lRow.AutoSize = true;
                tlpFacilityPriority.Controls.Add(lRow, 0, tlpFacilityPriority.RowCount);

                #endregion

                int currentColumn = 1;
                tlpFacilityPriority.RowCount++;
                for (int ft = 0; ft < SFacilityes.Length; ft++) // columns
                {
                    int fpNum = SyslogFacilityPriorityPair.ConvertPairToInt(ft, pt);
                    RadioButton bSelection = new RadioButton();
                    bSelection.Width = 16;
                    bSelection.Tag = fpNum;
                    bSelection.Checked = config.LoggingFacilityPriority(eventLog, eventLogEntryType).AsInt() ==
                                         fpNum;
                    bSelection.CheckedChanged += BSelectionOnCheckedChanged;
                    tlpFacilityPriority.Controls.Add(bSelection, currentColumn, tlpFacilityPriority.RowCount - 1);
                    currentColumn++;
                }

            }

            #endregion
        }
Example #2
0
        public FormJT2SL(El2SlConfig config, EventLog eventLog, EventLogEntryType eventLogEntryType)
        {
            InitializeComponent();
            _eventLog          = eventLog;
            _eventLogEntryType = eventLogEntryType;

            lInfo.Text = string.Format("{0}:{1}", _eventLog.LogDisplayName, eventLogEntryType.ToString());

            cbEnabled.Checked = config.LoggingEnabled(eventLog, eventLogEntryType);
            cbEnabled_CheckedChanged(cbEnabled, new EventArgs());

            #region Grid fill

            #region Preparing Columns headers

            for (int fh = 0; fh < SFacilityes.Length; fh++)   // columns
            {
                tlpFacilityPriority.ColumnCount++;
                VerticalLabel lColumn = new VerticalLabel();
                lColumn.Text = SFacilityes[fh];
                //lColumn.TextAlign = ContentAlignment.BottomCenter;
                tlpFacilityPriority.Controls.Add(lColumn, tlpFacilityPriority.ColumnCount - 1, 0);
            }

            #endregion

            for (int pt = 0; pt < SPriorityes.Length; pt++)  // rows
            {
                #region Preparing row labels

                Label lRow = new Label();
                lRow.Text     = SPriorityes[pt];
                lRow.AutoSize = true;
                tlpFacilityPriority.Controls.Add(lRow, 0, tlpFacilityPriority.RowCount);

                #endregion

                int currentColumn = 1;
                tlpFacilityPriority.RowCount++;
                for (int ft = 0; ft < SFacilityes.Length; ft++) // columns
                {
                    int         fpNum      = SyslogFacilityPriorityPair.ConvertPairToInt(ft, pt);
                    RadioButton bSelection = new RadioButton();
                    bSelection.Width   = 16;
                    bSelection.Tag     = fpNum;
                    bSelection.Checked = config.LoggingFacilityPriority(eventLog, eventLogEntryType).AsInt() ==
                                         fpNum;
                    bSelection.CheckedChanged += BSelectionOnCheckedChanged;
                    tlpFacilityPriority.Controls.Add(bSelection, currentColumn, tlpFacilityPriority.RowCount - 1);
                    currentColumn++;
                }
            }

            #endregion
        }
Example #3
0
        public FormMain()
        {
            _config = new El2SlConfig();
            InitializeComponent();

            #region Fill Grid

            #region Preparing rows labels

            foreach (EventLogEntryType et in Enum.GetValues(typeof (EventLogEntryType))) // columns
            {
                tlpJournals.ColumnCount++;
                VerticalLabel jLevels = new VerticalLabel();
                jLevels.Text = et.ToString();
                tlpJournals.Controls.Add(jLevels, tlpJournals.ColumnCount - 1, 0);
            }

            #endregion

            foreach (EventLog eventLog in EventLog.GetEventLogs()) // rows
            {
                #region Preparing row labels

                Label lJournals = new Label();
                lJournals.TextAlign = ContentAlignment.MiddleRight;
                lJournals.Text = eventLog.LogDisplayName;
                lJournals.AutoSize = true;
                tlpJournals.Controls.Add(lJournals, 0, tlpJournals.RowCount);

                #endregion

                int currentColumn = 1;
                tlpJournals.RowCount++;
                foreach (EventLogEntryType eventLogEntryType in Enum.GetValues(typeof (EventLogEntryType))) // columns
                {
                    tlpJournals.Controls.Add(new JournalLevelTextBox(_config, eventLog, eventLogEntryType), currentColumn,
                                             tlpJournals.RowCount - 1);
                    currentColumn++;
                }

            }

            //tlpJournals.RowCount--;
            //tlpJournals.ColumnCount--;

            #endregion

            tbHost.Text = _config.Host;
            nudPort.Value = _config.Port;
        }
Example #4
0
        public FormMain()
        {
            _config = new El2SlConfig();
            InitializeComponent();

            #region Fill Grid

            #region Preparing rows labels

            foreach (EventLogEntryType et in Enum.GetValues(typeof(EventLogEntryType)))  // columns
            {
                tlpJournals.ColumnCount++;
                VerticalLabel jLevels = new VerticalLabel();
                jLevels.Text = et.ToString();
                tlpJournals.Controls.Add(jLevels, tlpJournals.ColumnCount - 1, 0);
            }

            #endregion

            foreach (EventLog eventLog in EventLog.GetEventLogs()) // rows
            {
                #region Preparing row labels

                Label lJournals = new Label();
                lJournals.TextAlign = ContentAlignment.MiddleRight;
                lJournals.Text      = eventLog.LogDisplayName;
                lJournals.AutoSize  = true;
                tlpJournals.Controls.Add(lJournals, 0, tlpJournals.RowCount);

                #endregion

                int currentColumn = 1;
                tlpJournals.RowCount++;
                foreach (EventLogEntryType eventLogEntryType in Enum.GetValues(typeof(EventLogEntryType)))  // columns
                {
                    tlpJournals.Controls.Add(new JournalLevelTextBox(_config, eventLog, eventLogEntryType), currentColumn,
                                             tlpJournals.RowCount - 1);
                    currentColumn++;
                }
            }

            //tlpJournals.RowCount--;
            //tlpJournals.ColumnCount--;

            #endregion

            tbHost.Text   = _config.Host;
            nudPort.Value = _config.Port;
        }