/* Loading a logger */ /// <summary> /// Loads in the saved logger output. /// </summary> private void LoadLogEntryFormat() { string fmt = _configuration.LoggerParameters[LstLoggers.SelectedIndex].LogFormat; List <string> logFormats = new List <string>(fmt.Split(new[] { ',' })); LstLogEntry.ClearSelected(); TblOutput.Controls.Clear(); LoadLogEntryItems(logFormats); SetLogEntryItemsOrder(); }
/* runtime UI tracking */ /// <summary> /// Sets the order log entry list items as they are moved up and down in the listbox. /// </summary> private void SetLogEntryItemsOrder() { int labelIndex = 0; foreach (object itemChecked in LstLogEntry.CheckedItems) { if (LstLogEntry.GetItemCheckState(LstLogEntry.Items.IndexOf(itemChecked)) == CheckState.Checked) { labelIndex = SetLogEntryLabelVisibility(labelIndex, itemChecked); } } /* Center it */ TblOutput.Left = ((groupBox2.ClientSize.Width - TblOutput.Width) / 2) + groupBox2.ClientSize.Width; }
/// <summary> /// Handles the Click event of the CmdMoveDown control. /// </summary> /// <param name="sender">The source of the event.</param> /// <param name="e">The <see cref="System.EventArgs"/> instance containing the event data.</param> /// /// /// <remarks> /// Handles order and placement of output log string item /// </remarks> private void CmdMoveDown_Click(object sender, EventArgs e) { int newInd = LstLogEntry.SelectedIndex; object obj = LstLogEntry.SelectedItem; CheckState chk = LstLogEntry.GetItemCheckState(newInd); if (newInd >= LstLogEntry.Items.Count - 1) { return; } LstLogEntry.Items.RemoveAt(newInd); LstLogEntry.Items.Insert(newInd + 1, obj); LstLogEntry.SelectedIndex = newInd + 1; LstLogEntry.SetItemCheckState(newInd + 1, chk); SetLogEntryItemsOrder(); SetFormDirty(); }