diff --git a/src/LogExpert/Config/ConfigManager.cs b/src/LogExpert/Config/ConfigManager.cs
index 438de06a..078335f7 100644
--- a/src/LogExpert/Config/ConfigManager.cs
+++ b/src/LogExpert/Config/ConfigManager.cs
@@ -363,7 +363,7 @@ private void ConvertSettings(Settings settings)
///
- /// Imports all or some of the settings/prefs stored in the inpute stream.
+ /// Imports all or some of the settings/prefs stored in the input stream.
/// This will overwrite appropriate parts of the current (own) settings with the imported ones.
///
///
diff --git a/src/LogExpert/Controls/LogTabWindow/LogTabWindowEventHandlers.cs b/src/LogExpert/Controls/LogTabWindow/LogTabWindowEventHandlers.cs
index 76b13030..3e5a2cc6 100644
--- a/src/LogExpert/Controls/LogTabWindow/LogTabWindowEventHandlers.cs
+++ b/src/LogExpert/Controls/LogTabWindow/LogTabWindowEventHandlers.cs
@@ -109,10 +109,7 @@ private void LogTabWindow_Closing(object sender, CancelEventArgs e)
}
finally
{
- if (LogExpertProxy != null)
- {
- LogExpertProxy.WindowClosed(this);
- }
+ LogExpertProxy?.WindowClosed(this);
}
}
@@ -154,13 +151,13 @@ private void selectFilterToolStripMenuItem_Click(object sender, EventArgs e)
{
return;
}
+
CurrentLogWindow.ColumnizerCallbackObject.LineNum = CurrentLogWindow.GetCurrentLineNum();
- FilterSelectorForm form = new FilterSelectorForm(PluginRegistry.GetInstance().RegisteredColumnizers,
- CurrentLogWindow.CurrentColumnizer,
- CurrentLogWindow.ColumnizerCallbackObject);
+ FilterSelectorForm form = new FilterSelectorForm(PluginRegistry.GetInstance().RegisteredColumnizers, CurrentLogWindow.CurrentColumnizer, CurrentLogWindow.ColumnizerCallbackObject);
form.Owner = this;
form.TopMost = TopMost;
DialogResult res = form.ShowDialog();
+
if (res == DialogResult.OK)
{
if (form.ApplyToAll)
@@ -169,7 +166,7 @@ private void selectFilterToolStripMenuItem_Click(object sender, EventArgs e)
{
foreach (LogWindow logWindow in logWindowList)
{
- if (!logWindow.CurrentColumnizer.GetType().Equals(form.SelectedColumnizer.GetType()))
+ if (logWindow.CurrentColumnizer.GetType() != form.SelectedColumnizer.GetType())
{
//logWindow.SetColumnizer(form.SelectedColumnizer);
SetColumnizerFx fx = logWindow.ForceColumnizer;
@@ -188,19 +185,20 @@ private void selectFilterToolStripMenuItem_Click(object sender, EventArgs e)
}
else
{
- if (!CurrentLogWindow.CurrentColumnizer.GetType().Equals(form.SelectedColumnizer.GetType()))
+ if (CurrentLogWindow.CurrentColumnizer.GetType() != form.SelectedColumnizer.GetType())
{
SetColumnizerFx fx = CurrentLogWindow.ForceColumnizer;
CurrentLogWindow.Invoke(fx, form.SelectedColumnizer);
setColumnizerHistoryEntry(CurrentLogWindow.FileName, form.SelectedColumnizer);
}
+
if (form.IsConfigPressed)
{
lock (logWindowList)
{
foreach (LogWindow logWindow in logWindowList)
{
- if (logWindow.CurrentColumnizer.GetType().Equals(form.SelectedColumnizer.GetType()))
+ if (logWindow.CurrentColumnizer.GetType() == form.SelectedColumnizer.GetType())
{
logWindow.ColumnizerConfigChanged();
}
@@ -317,18 +315,12 @@ private void aboutToolStripMenuItem_Click(object sender, EventArgs e)
private void filterToggleButton_Click(object sender, EventArgs e)
{
- if (CurrentLogWindow != null)
- {
- CurrentLogWindow.ToggleFilterPanel();
- }
+ CurrentLogWindow?.ToggleFilterPanel();
}
private void filterToolStripMenuItem_Click(object sender, EventArgs e)
{
- if (CurrentLogWindow != null)
- {
- CurrentLogWindow.ToggleFilterPanel();
- }
+ CurrentLogWindow?.ToggleFilterPanel();
}
private void multiFileToolStripMenuItem_Click(object sender, EventArgs e)
@@ -344,10 +336,7 @@ private void GuiStateUpdate(object sender, GuiStateArgs e)
private void ColumnizerChanged(object sender, ColumnizerEventArgs e)
{
- if (bookmarkWindow != null)
- {
- bookmarkWindow.SetColumnizer(e.Columnizer);
- }
+ bookmarkWindow?.SetColumnizer(e.Columnizer);
}
private void BookmarkAdded(object sender, EventArgs e)
@@ -382,10 +371,7 @@ private void StatusLineEvent(object sender, StatusLineEventArgs e)
private void followTailCheckBox_Click(object sender, EventArgs e)
{
- if (CurrentLogWindow != null)
- {
- CurrentLogWindow.FollowTailChanged(followTailCheckBox.Checked, false);
- }
+ CurrentLogWindow?.FollowTailChanged(followTailCheckBox.Checked, false);
}
private void toolStripOpenButton_Click_1(object sender, EventArgs e)
@@ -402,10 +388,7 @@ private void LogTabWindow_KeyDown(object sender, KeyEventArgs e)
{
if (e.KeyCode == Keys.W && e.Control)
{
- if (CurrentLogWindow != null)
- {
- CurrentLogWindow.Close();
- }
+ CurrentLogWindow?.Close();
}
else if (e.KeyCode == Keys.Tab && e.Control)
{
@@ -413,35 +396,23 @@ private void LogTabWindow_KeyDown(object sender, KeyEventArgs e)
}
else
{
- if (CurrentLogWindow != null)
- {
- CurrentLogWindow.LogWindow_KeyDown(sender, e);
- }
+ CurrentLogWindow?.LogWindow_KeyDown(sender, e);
}
}
private void closeFileToolStripMenuItem_Click(object sender, EventArgs e)
{
- if (CurrentLogWindow != null)
- {
- CurrentLogWindow.Close();
- }
+ CurrentLogWindow?.Close();
}
private void cellSelectModeToolStripMenuItem_Click(object sender, EventArgs e)
{
- if (CurrentLogWindow != null)
- {
- CurrentLogWindow.SetCellSelectionMode(cellSelectModeToolStripMenuItem.Checked);
- }
+ CurrentLogWindow?.SetCellSelectionMode(cellSelectModeToolStripMenuItem.Checked);
}
private void copyMarkedLinesIntoNewTabToolStripMenuItem_Click(object sender, EventArgs e)
{
- if (CurrentLogWindow != null)
- {
- CurrentLogWindow.CopyMarkedLinesToTab();
- }
+ CurrentLogWindow?.CopyMarkedLinesToTab();
}
private void timeshiftMenuTextBox_KeyDown(object sender, KeyEventArgs e)
@@ -563,66 +534,42 @@ private void logWindow_SyncModeChanged(object sender, SyncModeEventArgs e)
private void toggleBookmarkToolStripMenuItem_Click(object sender, EventArgs e)
{
- if (CurrentLogWindow != null)
- {
- CurrentLogWindow.ToggleBookmark();
- }
+ CurrentLogWindow?.ToggleBookmark();
}
private void jumpToNextToolStripMenuItem_Click(object sender, EventArgs e)
{
- if (CurrentLogWindow != null)
- {
- CurrentLogWindow.JumpNextBookmark();
- }
+ CurrentLogWindow?.JumpNextBookmark();
}
private void jumpToPrevToolStripMenuItem_Click(object sender, EventArgs e)
{
- if (CurrentLogWindow != null)
- {
- CurrentLogWindow.JumpPrevBookmark();
- }
+ CurrentLogWindow?.JumpPrevBookmark();
}
private void aSCIIToolStripMenuItem_Click(object sender, EventArgs e)
{
- if (CurrentLogWindow != null)
- {
- CurrentLogWindow.ChangeEncoding(Encoding.ASCII);
- }
+ CurrentLogWindow?.ChangeEncoding(Encoding.ASCII);
}
private void aNSIToolStripMenuItem_Click(object sender, EventArgs e)
{
- if (CurrentLogWindow != null)
- {
- CurrentLogWindow.ChangeEncoding(Encoding.Default);
- }
+ CurrentLogWindow?.ChangeEncoding(Encoding.Default);
}
private void uTF8ToolStripMenuItem_Click(object sender, EventArgs e)
{
- if (CurrentLogWindow != null)
- {
- CurrentLogWindow.ChangeEncoding(new UTF8Encoding(false));
- }
+ CurrentLogWindow?.ChangeEncoding(new UTF8Encoding(false));
}
private void uTF16ToolStripMenuItem_Click(object sender, EventArgs e)
{
- if (CurrentLogWindow != null)
- {
- CurrentLogWindow.ChangeEncoding(Encoding.Unicode);
- }
+ CurrentLogWindow?.ChangeEncoding(Encoding.Unicode);
}
private void iSO88591ToolStripMenuItem_Click(object sender, EventArgs e)
{
- if (CurrentLogWindow != null)
- {
- CurrentLogWindow.ChangeEncoding(Encoding.GetEncoding("iso-8859-1"));
- }
+ CurrentLogWindow?.ChangeEncoding(Encoding.GetEncoding("iso-8859-1"));
}
private void reloadToolStripMenuItem_Click(object sender, EventArgs e)
@@ -651,26 +598,17 @@ private void dateTimeDragControl_ValueDragged(object sender, EventArgs e)
private void dateTimeDragControl_ValueChanged(object sender, EventArgs e)
{
- if (CurrentLogWindow != null)
- {
- CurrentLogWindow.ScrollToTimestamp(dateTimeDragControl.DateTime, true, true);
- }
+ CurrentLogWindow?.ScrollToTimestamp(dateTimeDragControl.DateTime, true, true);
}
private void LogTabWindow_Deactivate(object sender, EventArgs e)
{
- if (CurrentLogWindow != null)
- {
- CurrentLogWindow.AppFocusLost();
- }
+ CurrentLogWindow?.AppFocusLost();
}
private void LogTabWindow_Activated(object sender, EventArgs e)
{
- if (CurrentLogWindow != null)
- {
- CurrentLogWindow.AppFocusGained();
- }
+ CurrentLogWindow?.AppFocusGained();
}
private void toolStripButtonA_Click(object sender, EventArgs e)
@@ -719,34 +657,22 @@ private void toolStripButtonSearch_Click(object sender, EventArgs e)
private void toolStripButtonFilter_Click(object sender, EventArgs e)
{
- if (CurrentLogWindow != null)
- {
- CurrentLogWindow.ToggleFilterPanel();
- }
+ CurrentLogWindow?.ToggleFilterPanel();
}
private void toolStripButtonBookmark_Click(object sender, EventArgs e)
{
- if (CurrentLogWindow != null)
- {
- CurrentLogWindow.ToggleBookmark();
- }
+ CurrentLogWindow?.ToggleBookmark();
}
private void toolStripButtonUp_Click(object sender, EventArgs e)
{
- if (CurrentLogWindow != null)
- {
- CurrentLogWindow.JumpPrevBookmark();
- }
+ CurrentLogWindow?.JumpPrevBookmark();
}
private void toolStripButtonDown_Click(object sender, EventArgs e)
{
- if (CurrentLogWindow != null)
- {
- CurrentLogWindow.JumpNextBookmark();
- }
+ CurrentLogWindow?.JumpNextBookmark();
}
private void showHelpToolStripMenuItem_Click(object sender, EventArgs e)
@@ -846,10 +772,7 @@ private void LogTabWindow_SizeChanged(object sender, EventArgs e)
private void patternStatisticToolStripMenuItem_Click(object sender, EventArgs e)
{
- if (CurrentLogWindow != null)
- {
- CurrentLogWindow.PatternStatistic();
- }
+ CurrentLogWindow?.PatternStatistic();
}
private void saveProjectToolStripMenuItem_Click(object sender, EventArgs e)
@@ -867,13 +790,10 @@ private void saveProjectToolStripMenuItem_Click(object sender, EventArgs e)
foreach (DockContent content in dockPanel.Contents)
{
LogWindow logWindow = content as LogWindow;
- if (logWindow != null)
+ string persistenceFileName = logWindow?.SavePersistenceData(true);
+ if (persistenceFileName != null)
{
- string persistenceFileName = logWindow.SavePersistenceData(true);
- if (persistenceFileName != null)
- {
- fileNames.Add(persistenceFileName);
- }
+ fileNames.Add(persistenceFileName);
}
}
}
@@ -923,18 +843,12 @@ private void findInExplorerToolStripMenuItem_Click(object sender, EventArgs e)
private void exportBookmarksToolStripMenuItem_Click(object sender, EventArgs e)
{
- if (CurrentLogWindow != null)
- {
- CurrentLogWindow.ExportBookmarkList();
- }
+ CurrentLogWindow?.ExportBookmarkList();
}
private void importBookmarksToolStripMenuItem_Click(object sender, EventArgs e)
{
- if (CurrentLogWindow != null)
- {
- CurrentLogWindow.ImportBookmarkList();
- }
+ CurrentLogWindow?.ImportBookmarkList();
}
private void highlightGroupsComboBox_DropDownClosed(object sender, EventArgs e)
@@ -966,20 +880,14 @@ private void ConfigChanged(object sender, ConfigChangedEventArgs e)
private void dumpLogBufferInfoToolStripMenuItem_Click(object sender, EventArgs e)
{
#if DEBUG
- if (CurrentLogWindow != null)
- {
- CurrentLogWindow.DumpBufferInfo();
- }
+ CurrentLogWindow?.DumpBufferInfo();
#endif
}
private void dumpBufferDiagnosticToolStripMenuItem_Click(object sender, EventArgs e)
{
#if DEBUG
- if (CurrentLogWindow != null)
- {
- CurrentLogWindow.DumpBufferDiagnostic();
- }
+ CurrentLogWindow?.DumpBufferDiagnostic();
#endif
}
@@ -1058,18 +966,12 @@ private void loglevelToolStripMenuItem_DropDownOpening(object sender, EventArgs
private void disableWordHighlightModeToolStripMenuItem_Click(object sender, EventArgs e)
{
DebugOptions.disableWordHighlight = disableWordHighlightModeToolStripMenuItem.Checked;
- if (CurrentLogWindow != null)
- {
- CurrentLogWindow.RefreshAllGrids();
- }
+ CurrentLogWindow?.RefreshAllGrids();
}
private void multifileMaskToolStripMenuItem_Click(object sender, EventArgs e)
{
- if (CurrentLogWindow != null)
- {
- CurrentLogWindow.ChangeMultifileMask();
- }
+ CurrentLogWindow?.ChangeMultifileMask();
}
private void toolStripMenuItem3_Click(object sender, EventArgs e)
diff --git a/src/LogExpert/Controls/LogTabWindow/LogTabWindowPublic.cs b/src/LogExpert/Controls/LogTabWindow/LogTabWindowPublic.cs
index dba7d3a3..e04cfdca 100644
--- a/src/LogExpert/Controls/LogTabWindow/LogTabWindowPublic.cs
+++ b/src/LogExpert/Controls/LogTabWindow/LogTabWindowPublic.cs
@@ -253,8 +253,7 @@ public ILogLineColumnizer FindColumnizerByFileMask(string fileName)
{
if (Regex.IsMatch(fileName, entry.mask))
{
- ILogLineColumnizer columnizer = ColumnizerPicker.FindColumnizerByName(entry.columnizerName,
- PluginRegistry.GetInstance().RegisteredColumnizers);
+ ILogLineColumnizer columnizer = ColumnizerPicker.FindColumnizerByName(entry.columnizerName, PluginRegistry.GetInstance().RegisteredColumnizers);
return columnizer;
}
}
diff --git a/src/LogExpert/Controls/LogWindow/LogWindow.designer.cs b/src/LogExpert/Controls/LogWindow/LogWindow.designer.cs
index 1424a914..968ae59f 100644
--- a/src/LogExpert/Controls/LogWindow/LogWindow.designer.cs
+++ b/src/LogExpert/Controls/LogWindow/LogWindow.designer.cs
@@ -38,6 +38,7 @@ private void InitializeComponent()
this.columnFinderPanel = new System.Windows.Forms.Panel();
this.columnComboBox = new System.Windows.Forms.ComboBox();
this.label3 = new System.Windows.Forms.Label();
+ this.dataGridView = new LogExpert.Dialogs.BufferedDataGridView();
this.dataGridContextMenuStrip = new System.Windows.Forms.ContextMenuStrip(this.components);
this.copyToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem();
this.copyToTabToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem();
@@ -56,6 +57,7 @@ private void InitializeComponent()
this.makePermanentToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem();
this.markCurrentFilterRangeToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem();
this.pluginSeparator = new System.Windows.Forms.ToolStripSeparator();
+ this.timeSpreadingControl1 = new LogExpert.Dialogs.TimeSpreadingControl();
this.advancedBackPanel = new System.Windows.Forms.Panel();
this.advancedFilterSplitContainer = new System.Windows.Forms.SplitContainer();
this.panel2 = new System.Windows.Forms.Panel();
@@ -65,13 +67,17 @@ private void InitializeComponent()
this.filterRangeComboBox = new System.Windows.Forms.ComboBox();
this.columnNamesLabel = new System.Windows.Forms.Label();
this.fuzzyLabel = new System.Windows.Forms.Label();
+ this.fuzzyKnobControl = new LogExpert.KnobControl();
this.invertFilterCheckBox = new System.Windows.Forms.CheckBox();
this.panel4 = new System.Windows.Forms.Panel();
this.label6 = new System.Windows.Forms.Label();
+ this.filterKnobControl1 = new LogExpert.KnobControl();
this.label2 = new System.Windows.Forms.Label();
+ this.filterKnobControl2 = new LogExpert.KnobControl();
this.filterToTabButton = new System.Windows.Forms.Button();
this.toggleHighlightPanelButton = new System.Windows.Forms.Button();
this.highlightSplitContainer = new System.Windows.Forms.SplitContainer();
+ this.filterGridView = new LogExpert.Dialogs.BufferedDataGridView();
this.filterContextMenuStrip = new System.Windows.Forms.ContextMenuStrip(this.components);
this.setBookmarksOnSelectedLinesToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem();
this.filterToTabToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem();
@@ -117,18 +123,13 @@ private void InitializeComponent()
this.filterForSelectionToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem();
this.setSelectedTextAsBookmarkCommentToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem();
this.helpToolTip = new System.Windows.Forms.ToolTip(this.components);
- this.dataGridView = new LogExpert.Dialogs.BufferedDataGridView();
- this.timeSpreadingControl1 = new LogExpert.Dialogs.TimeSpreadingControl();
- this.fuzzyKnobControl = new LogExpert.KnobControl();
- this.filterKnobControl1 = new LogExpert.KnobControl();
- this.filterKnobControl2 = new LogExpert.KnobControl();
- this.filterGridView = new LogExpert.Dialogs.BufferedDataGridView();
((System.ComponentModel.ISupportInitialize)(this.splitContainer1)).BeginInit();
this.splitContainer1.Panel1.SuspendLayout();
this.splitContainer1.Panel2.SuspendLayout();
this.splitContainer1.SuspendLayout();
this.tableLayoutPanel1.SuspendLayout();
this.columnFinderPanel.SuspendLayout();
+ ((System.ComponentModel.ISupportInitialize)(this.dataGridView)).BeginInit();
this.dataGridContextMenuStrip.SuspendLayout();
this.advancedBackPanel.SuspendLayout();
((System.ComponentModel.ISupportInitialize)(this.advancedFilterSplitContainer)).BeginInit();
@@ -140,6 +141,7 @@ private void InitializeComponent()
this.highlightSplitContainer.Panel1.SuspendLayout();
this.highlightSplitContainer.Panel2.SuspendLayout();
this.highlightSplitContainer.SuspendLayout();
+ ((System.ComponentModel.ISupportInitialize)(this.filterGridView)).BeginInit();
this.filterContextMenuStrip.SuspendLayout();
this.panel3.SuspendLayout();
this.filterListContextMenuStrip.SuspendLayout();
@@ -151,8 +153,6 @@ private void InitializeComponent()
this.bookmarkContextMenuStrip.SuspendLayout();
this.columnContextMenuStrip.SuspendLayout();
this.editModeContextMenuStrip.SuspendLayout();
- ((System.ComponentModel.ISupportInitialize)(this.dataGridView)).BeginInit();
- ((System.ComponentModel.ISupportInitialize)(this.filterGridView)).BeginInit();
this.SuspendLayout();
//
// splitContainer1
@@ -184,7 +184,7 @@ private void InitializeComponent()
this.tableLayoutPanel1.CellBorderStyle = System.Windows.Forms.TableLayoutPanelCellBorderStyle.Single;
this.tableLayoutPanel1.ColumnCount = 2;
this.tableLayoutPanel1.ColumnStyles.Add(new System.Windows.Forms.ColumnStyle());
- this.tableLayoutPanel1.ColumnStyles.Add(new System.Windows.Forms.ColumnStyle(System.Windows.Forms.SizeType.Absolute, 179F));
+ this.tableLayoutPanel1.ColumnStyles.Add(new System.Windows.Forms.ColumnStyle(System.Windows.Forms.SizeType.Absolute, 180F));
this.tableLayoutPanel1.Controls.Add(this.columnFinderPanel, 0, 0);
this.tableLayoutPanel1.Controls.Add(this.dataGridView, 0, 1);
this.tableLayoutPanel1.Controls.Add(this.timeSpreadingControl1, 1, 1);
@@ -219,8 +219,9 @@ private void InitializeComponent()
this.columnComboBox.TabIndex = 1;
this.helpToolTip.SetToolTip(this.columnComboBox, "Select column to scroll to");
this.columnComboBox.SelectionChangeCommitted += new System.EventHandler(this.columnComboBox_SelectionChangeCommitted);
- this.columnComboBox.PreviewKeyDown += new System.Windows.Forms.PreviewKeyDownEventHandler(this.columnComboBox_PreviewKeyDown);
- this.columnComboBox.KeyDown += new System.Windows.Forms.KeyEventHandler(this.columnComboBox_KeyDown); //
+ this.columnComboBox.KeyDown += new System.Windows.Forms.KeyEventHandler(this.columnComboBox_KeyDown);
+ this.columnComboBox.PreviewKeyDown += new System.Windows.Forms.PreviewKeyDownEventHandler(this.columnComboBox_PreviewKeyDown);
+ //
// label3
//
this.label3.AutoSize = true;
@@ -230,6 +231,63 @@ private void InitializeComponent()
this.label3.TabIndex = 0;
this.label3.Text = "Column name:";
//
+ // dataGridView
+ //
+ this.dataGridView.AllowUserToAddRows = false;
+ this.dataGridView.AllowUserToDeleteRows = false;
+ this.dataGridView.AllowUserToOrderColumns = true;
+ this.dataGridView.AllowUserToResizeRows = false;
+ this.dataGridView.BackgroundColor = System.Drawing.SystemColors.Window;
+ this.dataGridView.BorderStyle = System.Windows.Forms.BorderStyle.None;
+ this.dataGridView.CellBorderStyle = System.Windows.Forms.DataGridViewCellBorderStyle.None;
+ this.dataGridView.ClipboardCopyMode = System.Windows.Forms.DataGridViewClipboardCopyMode.EnableWithoutHeaderText;
+ this.dataGridView.ColumnHeadersHeightSizeMode = System.Windows.Forms.DataGridViewColumnHeadersHeightSizeMode.AutoSize;
+ this.dataGridView.ContextMenuStrip = this.dataGridContextMenuStrip;
+ dataGridViewCellStyle1.Alignment = System.Windows.Forms.DataGridViewContentAlignment.MiddleLeft;
+ dataGridViewCellStyle1.BackColor = System.Drawing.SystemColors.Window;
+ dataGridViewCellStyle1.Font = new System.Drawing.Font("Courier New", 8.25F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
+ dataGridViewCellStyle1.ForeColor = System.Drawing.SystemColors.ControlText;
+ dataGridViewCellStyle1.SelectionBackColor = System.Drawing.SystemColors.Highlight;
+ dataGridViewCellStyle1.SelectionForeColor = System.Drawing.SystemColors.HighlightText;
+ dataGridViewCellStyle1.WrapMode = System.Windows.Forms.DataGridViewTriState.False;
+ this.dataGridView.DefaultCellStyle = dataGridViewCellStyle1;
+ this.dataGridView.Dock = System.Windows.Forms.DockStyle.Fill;
+ this.dataGridView.EditMode = System.Windows.Forms.DataGridViewEditMode.EditProgrammatically;
+ this.dataGridView.EditModeMenuStrip = null;
+ this.dataGridView.ImeMode = System.Windows.Forms.ImeMode.Disable;
+ this.dataGridView.Location = new System.Drawing.Point(1, 30);
+ this.dataGridView.Margin = new System.Windows.Forms.Padding(0);
+ this.dataGridView.Name = "dataGridView";
+ this.dataGridView.PaintWithOverlays = false;
+ this.dataGridView.RowHeadersVisible = false;
+ this.dataGridView.RowTemplate.DefaultCellStyle.Alignment = System.Windows.Forms.DataGridViewContentAlignment.BottomLeft;
+ this.dataGridView.RowTemplate.DefaultCellStyle.Padding = new System.Windows.Forms.Padding(2, 0, 0, 0);
+ this.dataGridView.RowTemplate.Height = 15;
+ this.dataGridView.SelectionMode = System.Windows.Forms.DataGridViewSelectionMode.FullRowSelect;
+ this.dataGridView.ShowCellErrors = false;
+ this.dataGridView.ShowCellToolTips = false;
+ this.dataGridView.ShowEditingIcon = false;
+ this.dataGridView.ShowRowErrors = false;
+ this.dataGridView.Size = new System.Drawing.Size(847, 331);
+ this.dataGridView.TabIndex = 0;
+ this.dataGridView.VirtualMode = true;
+ this.dataGridView.OverlayDoubleClicked += new LogExpert.Dialogs.BufferedDataGridView.OverlayDoubleClickedEventHandler(this.dataGridView_OverlayDoubleClicked);
+ this.dataGridView.CellClick += new System.Windows.Forms.DataGridViewCellEventHandler(this.dataGridView_CellClick);
+ this.dataGridView.CellContentDoubleClick += new System.Windows.Forms.DataGridViewCellEventHandler(this.dataGridView_CellContentDoubleClick);
+ this.dataGridView.CellContextMenuStripNeeded += new System.Windows.Forms.DataGridViewCellContextMenuStripNeededEventHandler(this.dataGridView_CellContextMenuStripNeeded);
+ this.dataGridView.CellDoubleClick += new System.Windows.Forms.DataGridViewCellEventHandler(this.dataGridView_CellDoubleClick);
+ this.dataGridView.CellValuePushed += new System.Windows.Forms.DataGridViewCellValueEventHandler(this.dataGridView_CellValuePushed);
+ this.dataGridView.RowHeightInfoNeeded += new System.Windows.Forms.DataGridViewRowHeightInfoNeededEventHandler(this.dataGridView_RowHeightInfoNeeded);
+ this.dataGridView.RowUnshared += new System.Windows.Forms.DataGridViewRowEventHandler(this.dataGridView_RowUnshared);
+ this.dataGridView.Scroll += new System.Windows.Forms.ScrollEventHandler(this.dataGridView_Scroll);
+ this.dataGridView.SelectionChanged += new System.EventHandler(this.dataGridView_SelectionChanged);
+ this.dataGridView.Paint += new System.Windows.Forms.PaintEventHandler(this.dataGridView_Paint);
+ this.dataGridView.Enter += new System.EventHandler(this.dataGridView_Enter);
+ this.dataGridView.KeyDown += new System.Windows.Forms.KeyEventHandler(this.dataGridView_KeyDown);
+ this.dataGridView.Leave += new System.EventHandler(this.dataGridView_Leave);
+ this.dataGridView.PreviewKeyDown += new System.Windows.Forms.PreviewKeyDownEventHandler(this.dataGridView_PreviewKeyDown);
+ this.dataGridView.Resize += new System.EventHandler(this.dataGridView_Resize);
+ //
// dataGridContextMenuStrip
//
this.dataGridContextMenuStrip.Items.AddRange(new System.Windows.Forms.ToolStripItem[] {
@@ -376,6 +434,19 @@ private void InitializeComponent()
this.pluginSeparator.Name = "pluginSeparator";
this.pluginSeparator.Size = new System.Drawing.Size(283, 6);
//
+ // timeSpreadingControl1
+ //
+ this.timeSpreadingControl1.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Bottom)
+ | System.Windows.Forms.AnchorStyles.Right)));
+ this.timeSpreadingControl1.Font = new System.Drawing.Font("Verdana", 8.25F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
+ this.timeSpreadingControl1.ForeColor = System.Drawing.Color.Teal;
+ this.timeSpreadingControl1.Location = new System.Drawing.Point(1012, 30);
+ this.timeSpreadingControl1.Margin = new System.Windows.Forms.Padding(2, 0, 1, 0);
+ this.timeSpreadingControl1.Name = "timeSpreadingControl1";
+ this.timeSpreadingControl1.ReverseAlpha = false;
+ this.timeSpreadingControl1.Size = new System.Drawing.Size(16, 331);
+ this.timeSpreadingControl1.TabIndex = 1;
+ //
// advancedBackPanel
//
this.advancedBackPanel.Anchor = ((System.Windows.Forms.AnchorStyles)((((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Bottom)
@@ -501,6 +572,21 @@ private void InitializeComponent()
this.fuzzyLabel.TabIndex = 11;
this.fuzzyLabel.Text = "Fuzzyness";
//
+ // fuzzyKnobControl
+ //
+ this.fuzzyKnobControl.DragSensitivity = 6;
+ this.fuzzyKnobControl.Font = new System.Drawing.Font("Verdana", 6F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
+ this.fuzzyKnobControl.Location = new System.Drawing.Point(454, 7);
+ this.fuzzyKnobControl.Margin = new System.Windows.Forms.Padding(2, 2, 2, 2);
+ this.fuzzyKnobControl.MaxValue = 0;
+ this.fuzzyKnobControl.MinValue = 0;
+ this.fuzzyKnobControl.Name = "fuzzyKnobControl";
+ this.fuzzyKnobControl.Size = new System.Drawing.Size(17, 29);
+ this.fuzzyKnobControl.TabIndex = 10;
+ this.helpToolTip.SetToolTip(this.fuzzyKnobControl, "Fuzzy search level (0 = fuzzy off)");
+ this.fuzzyKnobControl.Value = 0;
+ this.fuzzyKnobControl.ValueChanged += new LogExpert.KnobControl.ValueChangedEventHandler(this.fuzzyKnobControl_ValueChanged);
+ //
// invertFilterCheckBox
//
this.invertFilterCheckBox.AutoSize = true;
@@ -531,6 +617,20 @@ private void InitializeComponent()
this.label6.TabIndex = 6;
this.label6.Text = "Back Spread ";
//
+ // filterKnobControl1
+ //
+ this.filterKnobControl1.DragSensitivity = 3;
+ this.filterKnobControl1.Font = new System.Drawing.Font("Verdana", 6F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
+ this.filterKnobControl1.Location = new System.Drawing.Point(299, 7);
+ this.filterKnobControl1.Margin = new System.Windows.Forms.Padding(2, 2, 2, 2);
+ this.filterKnobControl1.MaxValue = 0;
+ this.filterKnobControl1.MinValue = 0;
+ this.filterKnobControl1.Name = "filterKnobControl1";
+ this.filterKnobControl1.Size = new System.Drawing.Size(17, 29);
+ this.filterKnobControl1.TabIndex = 5;
+ this.helpToolTip.SetToolTip(this.filterKnobControl1, "Add preceding lines to search result (Drag up/down, press Shift for finer pitch)");
+ this.filterKnobControl1.Value = 0;
+ //
// label2
//
this.label2.AutoSize = true;
@@ -540,6 +640,20 @@ private void InitializeComponent()
this.label2.TabIndex = 2;
this.label2.Text = "Fore Spread";
//
+ // filterKnobControl2
+ //
+ this.filterKnobControl2.DragSensitivity = 3;
+ this.filterKnobControl2.Font = new System.Drawing.Font("Verdana", 6F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
+ this.filterKnobControl2.Location = new System.Drawing.Point(365, 7);
+ this.filterKnobControl2.Margin = new System.Windows.Forms.Padding(2, 2, 2, 2);
+ this.filterKnobControl2.MaxValue = 0;
+ this.filterKnobControl2.MinValue = 0;
+ this.filterKnobControl2.Name = "filterKnobControl2";
+ this.filterKnobControl2.Size = new System.Drawing.Size(17, 29);
+ this.filterKnobControl2.TabIndex = 1;
+ this.helpToolTip.SetToolTip(this.filterKnobControl2, "Add following lines to search result (Drag up/down, press Shift for finer pitch)");
+ this.filterKnobControl2.Value = 0;
+ //
// filterToTabButton
//
this.filterToTabButton.Location = new System.Drawing.Point(655, 3);
@@ -582,10 +696,58 @@ private void InitializeComponent()
//
this.highlightSplitContainer.Panel2.Controls.Add(this.panel3);
this.highlightSplitContainer.Panel2MinSize = 30;
- this.highlightSplitContainer.Size = new System.Drawing.Size(981, 197);
+ this.highlightSplitContainer.Size = new System.Drawing.Size(981, 173);
this.highlightSplitContainer.SplitterDistance = 612;
this.highlightSplitContainer.TabIndex = 2;
//
+ // filterGridView
+ //
+ this.filterGridView.AllowUserToAddRows = false;
+ this.filterGridView.AllowUserToDeleteRows = false;
+ this.filterGridView.AllowUserToOrderColumns = true;
+ this.filterGridView.AllowUserToResizeRows = false;
+ this.filterGridView.BackgroundColor = System.Drawing.SystemColors.Window;
+ this.filterGridView.BorderStyle = System.Windows.Forms.BorderStyle.None;
+ this.filterGridView.CellBorderStyle = System.Windows.Forms.DataGridViewCellBorderStyle.None;
+ this.filterGridView.ClipboardCopyMode = System.Windows.Forms.DataGridViewClipboardCopyMode.EnableWithoutHeaderText;
+ this.filterGridView.ColumnHeadersHeightSizeMode = System.Windows.Forms.DataGridViewColumnHeadersHeightSizeMode.AutoSize;
+ this.filterGridView.ContextMenuStrip = this.filterContextMenuStrip;
+ dataGridViewCellStyle2.Alignment = System.Windows.Forms.DataGridViewContentAlignment.MiddleLeft;
+ dataGridViewCellStyle2.BackColor = System.Drawing.SystemColors.Window;
+ dataGridViewCellStyle2.Font = new System.Drawing.Font("Courier New", 8.25F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
+ dataGridViewCellStyle2.ForeColor = System.Drawing.SystemColors.ControlText;
+ dataGridViewCellStyle2.SelectionBackColor = System.Drawing.SystemColors.Highlight;
+ dataGridViewCellStyle2.SelectionForeColor = System.Drawing.SystemColors.HighlightText;
+ dataGridViewCellStyle2.WrapMode = System.Windows.Forms.DataGridViewTriState.False;
+ this.filterGridView.DefaultCellStyle = dataGridViewCellStyle2;
+ this.filterGridView.Dock = System.Windows.Forms.DockStyle.Fill;
+ this.filterGridView.EditMode = System.Windows.Forms.DataGridViewEditMode.EditProgrammatically;
+ this.filterGridView.EditModeMenuStrip = null;
+ this.filterGridView.ImeMode = System.Windows.Forms.ImeMode.Disable;
+ this.filterGridView.Location = new System.Drawing.Point(0, 0);
+ this.filterGridView.Margin = new System.Windows.Forms.Padding(0);
+ this.filterGridView.Name = "filterGridView";
+ this.filterGridView.PaintWithOverlays = false;
+ this.filterGridView.ReadOnly = true;
+ this.filterGridView.RowHeadersVisible = false;
+ this.filterGridView.RowTemplate.Height = 15;
+ this.filterGridView.RowTemplate.ReadOnly = true;
+ this.filterGridView.SelectionMode = System.Windows.Forms.DataGridViewSelectionMode.FullRowSelect;
+ this.filterGridView.ShowCellErrors = false;
+ this.filterGridView.ShowCellToolTips = false;
+ this.filterGridView.ShowEditingIcon = false;
+ this.filterGridView.ShowRowErrors = false;
+ this.filterGridView.Size = new System.Drawing.Size(610, 171);
+ this.filterGridView.TabIndex = 1;
+ this.filterGridView.VirtualMode = true;
+ this.filterGridView.CellContextMenuStripNeeded += new System.Windows.Forms.DataGridViewCellContextMenuStripNeededEventHandler(this.filterGridView_CellContextMenuStripNeeded);
+ this.filterGridView.CellDoubleClick += new System.Windows.Forms.DataGridViewCellEventHandler(this.filterGridView_CellDoubleClick);
+ this.filterGridView.ColumnDividerDoubleClick += new System.Windows.Forms.DataGridViewColumnDividerDoubleClickEventHandler(this.filterGridView_ColumnDividerDoubleClick);
+ this.filterGridView.RowHeightInfoNeeded += new System.Windows.Forms.DataGridViewRowHeightInfoNeededEventHandler(this.filterGridView_RowHeightInfoNeeded);
+ this.filterGridView.Enter += new System.EventHandler(this.filterGridView_Enter);
+ this.filterGridView.KeyDown += new System.Windows.Forms.KeyEventHandler(this.filterGridView_KeyDown);
+ this.filterGridView.Leave += new System.EventHandler(this.filterGridView_Leave);
+ //
// filterContextMenuStrip
//
this.filterContextMenuStrip.Items.AddRange(new System.Windows.Forms.ToolStripItem[] {
@@ -630,7 +792,7 @@ private void InitializeComponent()
this.panel3.Dock = System.Windows.Forms.DockStyle.Fill;
this.panel3.Location = new System.Drawing.Point(0, 0);
this.panel3.Name = "panel3";
- this.panel3.Size = new System.Drawing.Size(363, 195);
+ this.panel3.Size = new System.Drawing.Size(363, 171);
this.panel3.TabIndex = 1;
//
// hideFilterListOnLoadCheckBox
@@ -713,7 +875,7 @@ private void InitializeComponent()
this.filterListBox.IntegralHeight = false;
this.filterListBox.Location = new System.Drawing.Point(3, 3);
this.filterListBox.Name = "filterListBox";
- this.filterListBox.Size = new System.Drawing.Size(278, 190);
+ this.filterListBox.Size = new System.Drawing.Size(278, 166);
this.filterListBox.TabIndex = 0;
this.helpToolTip.SetToolTip(this.filterListBox, "Doubleclick to load a saved filter");
this.filterListBox.DrawItem += new System.Windows.Forms.DrawItemEventHandler(this.filterListBox_DrawItem);
@@ -1028,167 +1190,6 @@ private void InitializeComponent()
this.setSelectedTextAsBookmarkCommentToolStripMenuItem.Text = "Set selected text as bookmark comment";
this.setSelectedTextAsBookmarkCommentToolStripMenuItem.Click += new System.EventHandler(this.setSelectedTextAsBookmarkCommentToolStripMenuItem_Click);
//
- // dataGridView
- //
- this.dataGridView.AllowUserToAddRows = false;
- this.dataGridView.AllowUserToDeleteRows = false;
- this.dataGridView.AllowUserToOrderColumns = true;
- this.dataGridView.AllowUserToResizeRows = false;
- this.dataGridView.BackgroundColor = System.Drawing.SystemColors.Window;
- this.dataGridView.BorderStyle = System.Windows.Forms.BorderStyle.None;
- this.dataGridView.CellBorderStyle = System.Windows.Forms.DataGridViewCellBorderStyle.None;
- this.dataGridView.ClipboardCopyMode = System.Windows.Forms.DataGridViewClipboardCopyMode.EnableWithoutHeaderText;
- this.dataGridView.ColumnHeadersHeightSizeMode = System.Windows.Forms.DataGridViewColumnHeadersHeightSizeMode.AutoSize;
- this.dataGridView.ContextMenuStrip = this.dataGridContextMenuStrip;
- dataGridViewCellStyle1.Alignment = System.Windows.Forms.DataGridViewContentAlignment.MiddleLeft;
- dataGridViewCellStyle1.BackColor = System.Drawing.SystemColors.Window;
- dataGridViewCellStyle1.Font = new System.Drawing.Font("Courier New", 8.25F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
- dataGridViewCellStyle1.ForeColor = System.Drawing.SystemColors.ControlText;
- dataGridViewCellStyle1.SelectionBackColor = System.Drawing.SystemColors.Highlight;
- dataGridViewCellStyle1.SelectionForeColor = System.Drawing.SystemColors.HighlightText;
- dataGridViewCellStyle1.WrapMode = System.Windows.Forms.DataGridViewTriState.False;
- this.dataGridView.DefaultCellStyle = dataGridViewCellStyle1;
- this.dataGridView.Dock = System.Windows.Forms.DockStyle.Fill;
- this.dataGridView.EditMode = System.Windows.Forms.DataGridViewEditMode.EditProgrammatically;
- this.dataGridView.EditModeMenuStrip = null;
- this.dataGridView.ImeMode = System.Windows.Forms.ImeMode.Disable;
- this.dataGridView.Location = new System.Drawing.Point(1, 30);
- this.dataGridView.Margin = new System.Windows.Forms.Padding(0);
- this.dataGridView.Name = "dataGridView";
- this.dataGridView.PaintWithOverlays = false;
- this.dataGridView.RowHeadersVisible = false;
- this.dataGridView.RowTemplate.DefaultCellStyle.Alignment = System.Windows.Forms.DataGridViewContentAlignment.BottomLeft;
- this.dataGridView.RowTemplate.DefaultCellStyle.Padding = new System.Windows.Forms.Padding(2, 0, 0, 0);
- this.dataGridView.RowTemplate.Height = 15;
- this.dataGridView.SelectionMode = System.Windows.Forms.DataGridViewSelectionMode.FullRowSelect;
- this.dataGridView.ShowCellErrors = false;
- this.dataGridView.ShowCellToolTips = false;
- this.dataGridView.ShowEditingIcon = false;
- this.dataGridView.ShowRowErrors = false;
- this.dataGridView.Size = new System.Drawing.Size(847, 331);
- this.dataGridView.TabIndex = 0;
- this.dataGridView.VirtualMode = true;
- this.dataGridView.OverlayDoubleClicked += new LogExpert.Dialogs.BufferedDataGridView.OverlayDoubleClickedEventHandler(this.dataGridView_OverlayDoubleClicked);
- this.dataGridView.CellClick += new System.Windows.Forms.DataGridViewCellEventHandler(this.dataGridView_CellClick);
- this.dataGridView.CellContentDoubleClick += new System.Windows.Forms.DataGridViewCellEventHandler(this.dataGridView_CellContentDoubleClick);
- this.dataGridView.CellContextMenuStripNeeded += new System.Windows.Forms.DataGridViewCellContextMenuStripNeededEventHandler(this.dataGridView_CellContextMenuStripNeeded);
- this.dataGridView.CellDoubleClick += new System.Windows.Forms.DataGridViewCellEventHandler(this.dataGridView_CellDoubleClick);
- this.dataGridView.CellValuePushed += new System.Windows.Forms.DataGridViewCellValueEventHandler(this.dataGridView_CellValuePushed);
- this.dataGridView.RowHeightInfoNeeded += new System.Windows.Forms.DataGridViewRowHeightInfoNeededEventHandler(this.dataGridView_RowHeightInfoNeeded);
- this.dataGridView.RowUnshared += new System.Windows.Forms.DataGridViewRowEventHandler(this.dataGridView_RowUnshared);
- this.dataGridView.Scroll += new System.Windows.Forms.ScrollEventHandler(this.dataGridView_Scroll);
- this.dataGridView.SelectionChanged += new System.EventHandler(this.dataGridView_SelectionChanged);
- this.dataGridView.Paint += new System.Windows.Forms.PaintEventHandler(this.dataGridView_Paint);
- this.dataGridView.Enter += new System.EventHandler(this.dataGridView_Enter);
- this.dataGridView.KeyDown += new System.Windows.Forms.KeyEventHandler(this.dataGridView_KeyDown);
- this.dataGridView.Leave += new System.EventHandler(this.dataGridView_Leave);
- this.dataGridView.PreviewKeyDown += new System.Windows.Forms.PreviewKeyDownEventHandler(this.dataGridView_PreviewKeyDown);
- this.dataGridView.Resize += new System.EventHandler(this.dataGridView_Resize);
- //
- // timeSpreadingControl1
- //
- this.timeSpreadingControl1.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Bottom)
- | System.Windows.Forms.AnchorStyles.Right)));
- this.timeSpreadingControl1.Font = new System.Drawing.Font("Verdana", 8.25F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
- this.timeSpreadingControl1.ForeColor = System.Drawing.Color.Teal;
- this.timeSpreadingControl1.Location = new System.Drawing.Point(1011, 30);
- this.timeSpreadingControl1.Margin = new System.Windows.Forms.Padding(2, 0, 1, 0);
- this.timeSpreadingControl1.Name = "timeSpreadingControl1";
- this.timeSpreadingControl1.ReverseAlpha = false;
- this.timeSpreadingControl1.Size = new System.Drawing.Size(16, 331);
- this.timeSpreadingControl1.TabIndex = 1;
- //
- // fuzzyKnobControl
- //
- this.fuzzyKnobControl.DragSensitivity = 6;
- this.fuzzyKnobControl.Font = new System.Drawing.Font("Verdana", 6F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
- this.fuzzyKnobControl.Location = new System.Drawing.Point(454, 7);
- this.fuzzyKnobControl.Margin = new System.Windows.Forms.Padding(2, 2, 2, 2);
- this.fuzzyKnobControl.MaxValue = 0;
- this.fuzzyKnobControl.MinValue = 0;
- this.fuzzyKnobControl.Name = "fuzzyKnobControl";
- this.fuzzyKnobControl.Size = new System.Drawing.Size(17, 29);
- this.fuzzyKnobControl.TabIndex = 10;
- this.helpToolTip.SetToolTip(this.fuzzyKnobControl, "Fuzzy search level (0 = fuzzy off)");
- this.fuzzyKnobControl.Value = 0;
- this.fuzzyKnobControl.ValueChanged += new LogExpert.KnobControl.ValueChangedEventHandler(this.fuzzyKnobControl_ValueChanged);
- //
- // filterKnobControl1
- //
- this.filterKnobControl1.DragSensitivity = 3;
- this.filterKnobControl1.Font = new System.Drawing.Font("Verdana", 6F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
- this.filterKnobControl1.Location = new System.Drawing.Point(299, 7);
- this.filterKnobControl1.Margin = new System.Windows.Forms.Padding(2, 2, 2, 2);
- this.filterKnobControl1.MaxValue = 0;
- this.filterKnobControl1.MinValue = 0;
- this.filterKnobControl1.Name = "filterKnobControl1";
- this.filterKnobControl1.Size = new System.Drawing.Size(17, 29);
- this.filterKnobControl1.TabIndex = 5;
- this.helpToolTip.SetToolTip(this.filterKnobControl1, "Add preceding lines to search result (Drag up/down, press Shift for finer pitch)");
- this.filterKnobControl1.Value = 0;
- //
- // filterKnobControl2
- //
- this.filterKnobControl2.DragSensitivity = 3;
- this.filterKnobControl2.Font = new System.Drawing.Font("Verdana", 6F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
- this.filterKnobControl2.Location = new System.Drawing.Point(365, 7);
- this.filterKnobControl2.Margin = new System.Windows.Forms.Padding(2, 2, 2, 2);
- this.filterKnobControl2.MaxValue = 0;
- this.filterKnobControl2.MinValue = 0;
- this.filterKnobControl2.Name = "filterKnobControl2";
- this.filterKnobControl2.Size = new System.Drawing.Size(17, 29);
- this.filterKnobControl2.TabIndex = 1;
- this.helpToolTip.SetToolTip(this.filterKnobControl2, "Add following lines to search result (Drag up/down, press Shift for finer pitch)");
- this.filterKnobControl2.Value = 0;
- //
- // filterGridView
- //
- this.filterGridView.AllowUserToAddRows = false;
- this.filterGridView.AllowUserToDeleteRows = false;
- this.filterGridView.AllowUserToOrderColumns = true;
- this.filterGridView.AllowUserToResizeRows = false;
- this.filterGridView.BackgroundColor = System.Drawing.SystemColors.Window;
- this.filterGridView.BorderStyle = System.Windows.Forms.BorderStyle.None;
- this.filterGridView.CellBorderStyle = System.Windows.Forms.DataGridViewCellBorderStyle.None;
- this.filterGridView.ClipboardCopyMode = System.Windows.Forms.DataGridViewClipboardCopyMode.EnableWithoutHeaderText;
- this.filterGridView.ColumnHeadersHeightSizeMode = System.Windows.Forms.DataGridViewColumnHeadersHeightSizeMode.AutoSize;
- this.filterGridView.ContextMenuStrip = this.filterContextMenuStrip;
- dataGridViewCellStyle2.Alignment = System.Windows.Forms.DataGridViewContentAlignment.MiddleLeft;
- dataGridViewCellStyle2.BackColor = System.Drawing.SystemColors.Window;
- dataGridViewCellStyle2.Font = new System.Drawing.Font("Courier New", 8.25F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
- dataGridViewCellStyle2.ForeColor = System.Drawing.SystemColors.ControlText;
- dataGridViewCellStyle2.SelectionBackColor = System.Drawing.SystemColors.Highlight;
- dataGridViewCellStyle2.SelectionForeColor = System.Drawing.SystemColors.HighlightText;
- dataGridViewCellStyle2.WrapMode = System.Windows.Forms.DataGridViewTriState.False;
- this.filterGridView.DefaultCellStyle = dataGridViewCellStyle2;
- this.filterGridView.Dock = System.Windows.Forms.DockStyle.Fill;
- this.filterGridView.EditMode = System.Windows.Forms.DataGridViewEditMode.EditProgrammatically;
- this.filterGridView.EditModeMenuStrip = null;
- this.filterGridView.ImeMode = System.Windows.Forms.ImeMode.Disable;
- this.filterGridView.Location = new System.Drawing.Point(0, 0);
- this.filterGridView.Margin = new System.Windows.Forms.Padding(0);
- this.filterGridView.Name = "filterGridView";
- this.filterGridView.PaintWithOverlays = false;
- this.filterGridView.ReadOnly = true;
- this.filterGridView.RowHeadersVisible = false;
- this.filterGridView.RowTemplate.Height = 15;
- this.filterGridView.RowTemplate.ReadOnly = true;
- this.filterGridView.SelectionMode = System.Windows.Forms.DataGridViewSelectionMode.FullRowSelect;
- this.filterGridView.ShowCellErrors = false;
- this.filterGridView.ShowCellToolTips = false;
- this.filterGridView.ShowEditingIcon = false;
- this.filterGridView.ShowRowErrors = false;
- this.filterGridView.Size = new System.Drawing.Size(610, 195);
- this.filterGridView.TabIndex = 1;
- this.filterGridView.VirtualMode = true;
- this.filterGridView.CellContextMenuStripNeeded += new System.Windows.Forms.DataGridViewCellContextMenuStripNeededEventHandler(this.filterGridView_CellContextMenuStripNeeded);
- this.filterGridView.CellDoubleClick += new System.Windows.Forms.DataGridViewCellEventHandler(this.filterGridView_CellDoubleClick);
- this.filterGridView.ColumnDividerDoubleClick += new System.Windows.Forms.DataGridViewColumnDividerDoubleClickEventHandler(this.filterGridView_ColumnDividerDoubleClick);
- this.filterGridView.RowHeightInfoNeeded += new System.Windows.Forms.DataGridViewRowHeightInfoNeededEventHandler(this.filterGridView_RowHeightInfoNeeded);
- this.filterGridView.Enter += new System.EventHandler(this.filterGridView_Enter);
- this.filterGridView.KeyDown += new System.Windows.Forms.KeyEventHandler(this.filterGridView_KeyDown);
- this.filterGridView.Leave += new System.EventHandler(this.filterGridView_Leave);
- //
// LogWindow
//
this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F);
@@ -1218,6 +1219,7 @@ private void InitializeComponent()
this.tableLayoutPanel1.ResumeLayout(false);
this.columnFinderPanel.ResumeLayout(false);
this.columnFinderPanel.PerformLayout();
+ ((System.ComponentModel.ISupportInitialize)(this.dataGridView)).EndInit();
this.dataGridContextMenuStrip.ResumeLayout(false);
this.advancedBackPanel.ResumeLayout(false);
this.advancedFilterSplitContainer.Panel1.ResumeLayout(false);
@@ -1230,6 +1232,7 @@ private void InitializeComponent()
this.highlightSplitContainer.Panel2.ResumeLayout(false);
((System.ComponentModel.ISupportInitialize)(this.highlightSplitContainer)).EndInit();
this.highlightSplitContainer.ResumeLayout(false);
+ ((System.ComponentModel.ISupportInitialize)(this.filterGridView)).EndInit();
this.filterContextMenuStrip.ResumeLayout(false);
this.panel3.ResumeLayout(false);
this.panel3.PerformLayout();
@@ -1244,8 +1247,6 @@ private void InitializeComponent()
this.bookmarkContextMenuStrip.ResumeLayout(false);
this.columnContextMenuStrip.ResumeLayout(false);
this.editModeContextMenuStrip.ResumeLayout(false);
- ((System.ComponentModel.ISupportInitialize)(this.dataGridView)).EndInit();
- ((System.ComponentModel.ISupportInitialize)(this.filterGridView)).EndInit();
this.ResumeLayout(false);
}
diff --git a/src/LogExpert/Controls/LogWindow/LogWindow.resx b/src/LogExpert/Controls/LogWindow/LogWindow.resx
index de405c46..beea6c87 100644
--- a/src/LogExpert/Controls/LogWindow/LogWindow.resx
+++ b/src/LogExpert/Controls/LogWindow/LogWindow.resx
@@ -139,7 +139,7 @@
658, 21
- 90
+ 32
diff --git a/src/LogExpert/Controls/LogWindow/LogWindowPrivate.cs b/src/LogExpert/Controls/LogWindow/LogWindowPrivate.cs
index 2fccdd62..7eed58d0 100644
--- a/src/LogExpert/Controls/LogWindow/LogWindowPrivate.cs
+++ b/src/LogExpert/Controls/LogWindow/LogWindowPrivate.cs
@@ -918,8 +918,8 @@ private void SetColumnizerInternal(ILogLineColumnizer columnizer)
{
string[] newColumns = columnizer != null ? columnizer.GetColumnNames() : new string[0];
bool colChanged = false;
- if (dataGridView.ColumnCount - 2 == newColumns.Length
- ) // two first columns are 'marker' and 'line number'
+
+ if (dataGridView.ColumnCount - 2 == newColumns.Length) // two first columns are 'marker' and 'line number'
{
for (int i = 0; i < newColumns.Length; i++)
{
@@ -949,7 +949,7 @@ private void SetColumnizerInternal(ILogLineColumnizer columnizer)
filterParams.columnList.Clear();
}
- if (CurrentColumnizer == null || !CurrentColumnizer.GetType().Equals(columnizer.GetType()))
+ if (CurrentColumnizer == null || CurrentColumnizer.GetType() != columnizer.GetType())
{
CurrentColumnizer = columnizer;
freezeStateMap.Clear();
@@ -973,8 +973,7 @@ private void SetColumnizerInternal(ILogLineColumnizer columnizer)
}
// Reload when choosing no XML columnizer but previous columnizer was XML
- if (logFileReader != null && !(CurrentColumnizer is ILogLineXmlColumnizer) &&
- oldColumnizerIsXmlType)
+ if (logFileReader != null && !(CurrentColumnizer is ILogLineXmlColumnizer) && oldColumnizerIsXmlType)
{
logFileReader.IsXmlMode = false;
//forcedColumnizer = currentColumnizer; // prevent Columnizer selection on SetGuiAfterReload()
@@ -984,8 +983,7 @@ private void SetColumnizerInternal(ILogLineColumnizer columnizer)
// Reload when previous columnizer was PreProcess and current is not, and vice versa.
// When the current columnizer is a preProcess columnizer, reload in every case.
if (CurrentColumnizer is IPreProcessColumnizer != oldColumnizerIsPreProcess ||
- CurrentColumnizer is IPreProcessColumnizer
- )
+ CurrentColumnizer is IPreProcessColumnizer)
{
//forcedColumnizer = currentColumnizer; // prevent Columnizer selection on SetGuiAfterReload()
mustReload = true;
@@ -1040,6 +1038,7 @@ CurrentColumnizer is IPreProcessColumnizer
}
columnComboBox.Items.Clear();
+
foreach (string columnName in columnizer.GetColumnNames())
{
columnComboBox.Items.Add(columnName);
diff --git a/src/LogExpert/Controls/LogWindow/LogWindowsPublic.cs b/src/LogExpert/Controls/LogWindow/LogWindowsPublic.cs
index 7a89bcc4..595cfef0 100644
--- a/src/LogExpert/Controls/LogWindow/LogWindowsPublic.cs
+++ b/src/LogExpert/Controls/LogWindow/LogWindowsPublic.cs
@@ -90,7 +90,7 @@ public void LoadFile(string fileName, EncodingOptions encodingOptions)
{
_logger.Error(lfe);
MessageBox.Show("Cannot load file\n" + lfe.Message, "LogExpert");
- BeginInvoke(new FunctionWith1BoolParam(Close), new object[] {true});
+ BeginInvoke(new FunctionWith1BoolParam(Close), true);
isLoadError = true;
return;
}
diff --git a/src/LogExpert/Dialogs/BookmarkWindow.cs b/src/LogExpert/Dialogs/BookmarkWindow.cs
index d4c9da7d..24d30634 100644
--- a/src/LogExpert/Dialogs/BookmarkWindow.cs
+++ b/src/LogExpert/Dialogs/BookmarkWindow.cs
@@ -25,8 +25,8 @@ public partial class BookmarkWindow : DockContent, ISharedToolWindow, IBookmarkV
public BookmarkWindow()
{
InitializeComponent();
- this.bookmarkDataGridView.CellValueNeeded += boomarkDataGridView_CellValueNeeded;
- this.bookmarkDataGridView.CellPainting += boomarkDataGridView_CellPainting;
+ bookmarkDataGridView.CellValueNeeded += boomarkDataGridView_CellValueNeeded;
+ bookmarkDataGridView.CellPainting += boomarkDataGridView_CellPainting;
}
#endregion
@@ -35,15 +35,15 @@ public BookmarkWindow()
public bool LineColumnVisible
{
- set { this.bookmarkDataGridView.Columns[2].Visible = value; }
+ set => bookmarkDataGridView.Columns[2].Visible = value;
}
public bool ShowBookmarkCommentColumn
{
- get { return this.commentColumnCheckBox.Checked; }
+ get => commentColumnCheckBox.Checked;
set
{
- this.commentColumnCheckBox.Checked = value;
+ commentColumnCheckBox.Checked = value;
ShowCommentColumn(value);
}
}
@@ -54,10 +54,11 @@ public bool ShowBookmarkCommentColumn
public void SetColumnizer(ILogLineColumnizer columnizer)
{
- PaintHelper.SetColumnizer(columnizer, this.bookmarkDataGridView);
- if (this.bookmarkDataGridView.ColumnCount > 0)
+ PaintHelper.SetColumnizer(columnizer, bookmarkDataGridView);
+
+ if (bookmarkDataGridView.ColumnCount > 0)
{
- this.bookmarkDataGridView.Columns[0].Width = 20;
+ bookmarkDataGridView.Columns[0].Width = 20;
}
DataGridViewTextBoxColumn commentColumn = new DataGridViewTextBoxColumn();
@@ -68,8 +69,8 @@ public void SetColumnizer(ILogLineColumnizer columnizer)
commentColumn.ReadOnly = true;
commentColumn.Width = 250;
commentColumn.MinimumWidth = 130;
- this.bookmarkDataGridView.Columns.Insert(1, commentColumn);
- ShowCommentColumn(this.commentColumnCheckBox.Checked);
+ bookmarkDataGridView.Columns.Insert(1, commentColumn);
+ ShowCommentColumn(commentColumnCheckBox.Checked);
ResizeColumns();
}
@@ -78,18 +79,18 @@ public void SetColumnizer(ILogLineColumnizer columnizer)
///
public void ResizeColumns()
{
- //this.bookmarkDataGridView.AutoResizeColumns(DataGridViewAutoSizeColumnsMode.DisplayedCells);
- for (int i = 2; i < this.bookmarkDataGridView.ColumnCount; ++i)
+ // this.bookmarkDataGridView.AutoResizeColumns(DataGridViewAutoSizeColumnsMode.DisplayedCells);
+ for (int i = 2; i < bookmarkDataGridView.ColumnCount; ++i)
{
- this.bookmarkDataGridView.AutoResizeColumn(i, DataGridViewAutoSizeColumnMode.DisplayedCells);
+ bookmarkDataGridView.AutoResizeColumn(i, DataGridViewAutoSizeColumnMode.DisplayedCells);
}
}
public void UpdateView()
{
- this.bookmarkDataGridView.RowCount = this.bookmarkData != null ? this.bookmarkData.Bookmarks.Count : 0;
- this.ResizeColumns();
- this.bookmarkDataGridView.Refresh();
+ bookmarkDataGridView.RowCount = bookmarkData?.Bookmarks.Count ?? 0;
+ ResizeColumns();
+ bookmarkDataGridView.Refresh();
}
///
@@ -98,36 +99,39 @@ public void UpdateView()
///
public void BookmarkTextChanged(Bookmark bookmark)
{
- int rowIndex = this.bookmarkDataGridView.CurrentCellAddress.Y;
+ int rowIndex = bookmarkDataGridView.CurrentCellAddress.Y;
if (rowIndex == -1)
{
return;
}
- if (this.bookmarkData.Bookmarks[rowIndex] == bookmark)
+
+ if (bookmarkData.Bookmarks[rowIndex] == bookmark)
{
- this.bookmarkTextBox.Text = bookmark.Text;
+ bookmarkTextBox.Text = bookmark.Text;
}
- this.bookmarkDataGridView.Refresh();
+
+ bookmarkDataGridView.Refresh();
}
public void SelectBookmark(int lineNum)
{
- if (this.bookmarkData.IsBookmarkAtLine(lineNum))
+ if (bookmarkData.IsBookmarkAtLine(lineNum))
{
- if (this.bookmarkDataGridView.Rows.Count < this.bookmarkData.Bookmarks.Count)
+ if (bookmarkDataGridView.Rows.Count < bookmarkData.Bookmarks.Count)
{
// just for the case... There was an exception but I cannot find the cause
- this.UpdateView();
+ UpdateView();
}
- int row = this.bookmarkData.GetBookmarkIndexForLine(lineNum);
- this.bookmarkDataGridView.CurrentCell = this.bookmarkDataGridView.Rows[row].Cells[0];
+
+ int row = bookmarkData.GetBookmarkIndexForLine(lineNum);
+ bookmarkDataGridView.CurrentCell = bookmarkDataGridView.Rows[row].Cells[0];
}
}
public void SetBookmarkData(IBookmarkData bookmarkData)
{
this.bookmarkData = bookmarkData;
- this.bookmarkDataGridView.RowCount = this.bookmarkData != null ? this.bookmarkData.Bookmarks.Count : 0;
+ bookmarkDataGridView.RowCount = bookmarkData?.Bookmarks.Count ?? 0;
HideIfNeeded();
}
@@ -136,12 +140,13 @@ public void PreferencesChanged(Preferences newPreferences, bool isLoadTime, Sett
if ((flags & SettingsFlags.GuiOrColors) == SettingsFlags.GuiOrColors)
{
SetFont(newPreferences.fontName, newPreferences.fontSize);
- if (this.bookmarkDataGridView.Columns.Count > 1 && newPreferences.setLastColumnWidth)
+ if (bookmarkDataGridView.Columns.Count > 1 && newPreferences.setLastColumnWidth)
{
- this.bookmarkDataGridView.Columns[this.bookmarkDataGridView.Columns.Count - 1].MinimumWidth =
+ bookmarkDataGridView.Columns[bookmarkDataGridView.Columns.Count - 1].MinimumWidth =
newPreferences.lastColumnWidth;
}
- PaintHelper.ApplyDataGridViewPrefs(this.bookmarkDataGridView, newPreferences);
+
+ PaintHelper.ApplyDataGridViewPrefs(bookmarkDataGridView, newPreferences);
}
}
@@ -150,18 +155,20 @@ public void SetCurrentFile(FileViewContext ctx)
if (ctx != null)
{
_logger.Debug("Current file changed to {0}", ctx.LogView.FileName);
- lock (this.paintLock)
+ lock (paintLock)
{
- this.logView = ctx.LogView;
- this.logPaintContext = ctx.LogPaintContext;
+ logView = ctx.LogView;
+ logPaintContext = ctx.LogPaintContext;
}
- this.SetColumnizer(ctx.LogView.CurrentColumnizer);
+
+ SetColumnizer(ctx.LogView.CurrentColumnizer);
}
else
{
- this.logView = null;
- this.logPaintContext = null;
+ logView = null;
+ logPaintContext = null;
}
+
UpdateView();
}
@@ -181,16 +188,15 @@ protected override string GetPersistString()
protected override void OnPaint(PaintEventArgs e)
{
- if (!this.splitContainer1.Visible)
+ if (!splitContainer1.Visible)
{
- Rectangle r = this.ClientRectangle;
+ Rectangle r = ClientRectangle;
e.Graphics.FillRectangle(SystemBrushes.ControlLight, r);
RectangleF rect = r;
StringFormat sf = new StringFormat();
sf.Alignment = StringAlignment.Center;
sf.LineAlignment = StringAlignment.Center;
- e.Graphics.DrawString("No bookmarks in current file", SystemFonts.DialogFont, SystemBrushes.WindowText,
- r, sf);
+ e.Graphics.DrawString("No bookmarks in current file", SystemFonts.DialogFont, SystemBrushes.WindowText, r, sf);
}
else
{
@@ -205,9 +211,9 @@ protected override void OnPaint(PaintEventArgs e)
private void SetFont(string fontName, float fontSize)
{
Font font = new Font(new FontFamily(fontName), fontSize);
- this.bookmarkDataGridView.DefaultCellStyle.Font = font;
- this.bookmarkDataGridView.RowTemplate.Height = font.Height + 4;
- this.bookmarkDataGridView.Refresh();
+ bookmarkDataGridView.DefaultCellStyle.Font = font;
+ bookmarkDataGridView.RowTemplate.Height = font.Height + 4;
+ bookmarkDataGridView.Refresh();
}
@@ -215,46 +221,44 @@ private void CommentPainting(DataGridView gridView, int rowIndex, DataGridViewCe
{
if ((e.State & DataGridViewElementStates.Selected) == DataGridViewElementStates.Selected)
{
- /**/
Color backColor = e.CellStyle.SelectionBackColor;
Brush brush;
if (gridView.Focused)
{
- //_logger.logDebug("CellPaint Focus");
+ // _logger.logDebug("CellPaint Focus");
brush = new SolidBrush(e.CellStyle.SelectionBackColor);
}
else
{
- //_logger.logDebug("CellPaint No Focus");
+ // _logger.logDebug("CellPaint No Focus");
Color color = Color.FromArgb(255, 170, 170, 170);
brush = new SolidBrush(color);
}
+
e.Graphics.FillRectangle(brush, e.CellBounds);
brush.Dispose();
- /**/
}
else
{
e.CellStyle.BackColor = Color.White;
e.PaintBackground(e.CellBounds, false);
}
+
e.PaintContent(e.CellBounds);
}
private void DeleteSelectedBookmarks()
{
List lineNumList = new List();
- foreach (DataGridViewRow row in this.bookmarkDataGridView.SelectedRows)
+ foreach (DataGridViewRow row in bookmarkDataGridView.SelectedRows)
{
if (row.Index != -1)
{
- lineNumList.Add(this.bookmarkData.Bookmarks[row.Index].LineNum);
+ lineNumList.Add(bookmarkData.Bookmarks[row.Index].LineNum);
}
}
- if (this.logView != null)
- {
- this.logView.DeleteBookmarks(lineNumList);
- }
+
+ logView?.DeleteBookmarks(lineNumList);
}
private static void InvalidateCurrentRow(DataGridView gridView)
@@ -270,27 +274,28 @@ private void CurrentRowChanged(int rowIndex)
if (rowIndex == -1)
{
// multiple selection or no selection at all
- this.bookmarkTextBox.Enabled = false;
- // disable the control first so that changes made to it won't propagate to the bookmark item
- this.bookmarkTextBox.Text = "";
+ bookmarkTextBox.Enabled = false;
+
+// disable the control first so that changes made to it won't propagate to the bookmark item
+ bookmarkTextBox.Text = string.Empty;
}
else
{
- Bookmark bookmark = this.bookmarkData.Bookmarks[rowIndex];
- this.bookmarkTextBox.Text = bookmark.Text;
- this.bookmarkTextBox.Enabled = true;
+ Bookmark bookmark = bookmarkData.Bookmarks[rowIndex];
+ bookmarkTextBox.Text = bookmark.Text;
+ bookmarkTextBox.Enabled = true;
}
}
private void ShowCommentColumn(bool show)
{
- this.bookmarkDataGridView.Columns[1].Visible = show;
+ bookmarkDataGridView.Columns[1].Visible = show;
}
private void HideIfNeeded()
{
- this.splitContainer1.Visible = this.bookmarkDataGridView.RowCount > 0;
+ splitContainer1.Visible = bookmarkDataGridView.RowCount > 0;
}
#endregion
@@ -299,29 +304,30 @@ private void HideIfNeeded()
private void boomarkDataGridView_CellPainting(object sender, DataGridViewCellPaintingEventArgs e)
{
- if (this.bookmarkData == null)
+ if (bookmarkData == null)
{
return;
}
- lock (this.paintLock)
+ lock (paintLock)
{
try
{
- if (e.RowIndex < 0 || e.ColumnIndex < 0 || this.bookmarkData.Bookmarks.Count <= e.RowIndex)
+ if (e.RowIndex < 0 || e.ColumnIndex < 0 || bookmarkData.Bookmarks.Count <= e.RowIndex)
{
e.Handled = false;
return;
}
- int lineNum = this.bookmarkData.Bookmarks[e.RowIndex].LineNum;
- //if (e.ColumnIndex == 1)
- //{
- // CommentPainting(this.bookmarkDataGridView, lineNum, e);
- //}
- //else
+ int lineNum = bookmarkData.Bookmarks[e.RowIndex].LineNum;
+
+ // if (e.ColumnIndex == 1)
+ // {
+ // CommentPainting(this.bookmarkDataGridView, lineNum, e);
+ // }
{
- PaintHelper.CellPainting(this.logPaintContext, this.bookmarkDataGridView, lineNum, e);
+// else
+ PaintHelper.CellPainting(logPaintContext, bookmarkDataGridView, lineNum, e);
}
}
catch (Exception ex)
@@ -333,39 +339,38 @@ private void boomarkDataGridView_CellPainting(object sender, DataGridViewCellPai
private void boomarkDataGridView_CellValueNeeded(object sender, DataGridViewCellValueEventArgs e)
{
- if (this.bookmarkData == null)
+ if (bookmarkData == null)
{
return;
}
- if (e.RowIndex < 0 || e.ColumnIndex < 0 || this.bookmarkData.Bookmarks.Count <= e.RowIndex)
+ if (e.RowIndex < 0 || e.ColumnIndex < 0 || bookmarkData.Bookmarks.Count <= e.RowIndex)
{
- e.Value = "";
+ e.Value = string.Empty;
return;
}
- Bookmark bookmarkForLine = this.bookmarkData.Bookmarks[e.RowIndex];
+
+ Bookmark bookmarkForLine = bookmarkData.Bookmarks[e.RowIndex];
int lineNum = bookmarkForLine.LineNum;
if (e.ColumnIndex == 1)
{
- e.Value = bookmarkForLine.Text != null
- ? bookmarkForLine.Text.Replace('\n', ' ').Replace('\r', ' ')
- : null;
+ e.Value = bookmarkForLine.Text?.Replace('\n', ' ').Replace('\r', ' ');
}
else
{
int columnIndex = e.ColumnIndex > 1 ? e.ColumnIndex - 1 : e.ColumnIndex;
- e.Value = this.logPaintContext.GetCellValue(lineNum, columnIndex);
+ e.Value = logPaintContext.GetCellValue(lineNum, columnIndex);
}
}
private void boomarkDataGridView_MouseDoubleClick(object sender, MouseEventArgs e)
{
- //if (this.bookmarkDataGridView.CurrentRow != null)
- //{
- // int lineNum = this.BookmarkList.Values[this.bookmarkDataGridView.CurrentRow.Index].LineNum;
- // this.logWindow.SelectLogLine(lineNum);
- //}
+ // if (this.bookmarkDataGridView.CurrentRow != null)
+ // {
+ // int lineNum = this.BookmarkList.Values[this.bookmarkDataGridView.CurrentRow.Index].LineNum;
+ // this.logWindow.SelectLogLine(lineNum);
+ // }
}
private void boomarkDataGridView_ColumnDividerDoubleClick(object sender,
@@ -379,23 +384,26 @@ private void bookmarkGridView_KeyDown(object sender, KeyEventArgs e)
{
if (e.KeyCode == Keys.Enter)
{
- if (this.bookmarkDataGridView.CurrentCellAddress.Y >= 0 &&
- this.bookmarkDataGridView.CurrentCellAddress.Y < this.bookmarkData.Bookmarks.Count)
+ if (bookmarkDataGridView.CurrentCellAddress.Y >= 0 &&
+ bookmarkDataGridView.CurrentCellAddress.Y < bookmarkData.Bookmarks.Count)
{
- int lineNum = this.bookmarkData.Bookmarks[this.bookmarkDataGridView.CurrentCellAddress.Y].LineNum;
- this.logView.SelectLogLine(lineNum);
+ int lineNum = bookmarkData.Bookmarks[bookmarkDataGridView.CurrentCellAddress.Y].LineNum;
+ logView.SelectLogLine(lineNum);
}
+
e.Handled = true;
}
+
if (e.KeyCode == Keys.Delete && e.Modifiers == Keys.None)
{
DeleteSelectedBookmarks();
}
+
if (e.KeyCode == Keys.Tab)
{
- if (this.bookmarkDataGridView.Focused)
+ if (bookmarkDataGridView.Focused)
{
- this.bookmarkTextBox.Focus();
+ bookmarkTextBox.Focus();
e.Handled = true;
}
}
@@ -403,12 +411,12 @@ private void bookmarkGridView_KeyDown(object sender, KeyEventArgs e)
private void bookmarkGridView_Enter(object sender, EventArgs e)
{
- InvalidateCurrentRow(this.bookmarkDataGridView);
+ InvalidateCurrentRow(bookmarkDataGridView);
}
private void bookmarkGridView_Leave(object sender, EventArgs e)
{
- InvalidateCurrentRow(this.bookmarkDataGridView);
+ InvalidateCurrentRow(bookmarkDataGridView);
}
private void deleteBookmarksToolStripMenuItem_Click(object sender, EventArgs e)
@@ -423,35 +431,32 @@ private void bookmarkTextBox_TextChanged(object sender, EventArgs e)
return; // ignore all changes done while the control is disabled
}
- int rowIndex = this.bookmarkDataGridView.CurrentCellAddress.Y;
+ int rowIndex = bookmarkDataGridView.CurrentCellAddress.Y;
if (rowIndex == -1)
{
return;
}
- if (this.bookmarkData.Bookmarks.Count <= rowIndex)
+ if (bookmarkData.Bookmarks.Count <= rowIndex)
{
return;
}
- Bookmark bookmark = this.bookmarkData.Bookmarks[rowIndex];
- bookmark.Text = this.bookmarkTextBox.Text;
- if (this.logView != null)
- {
- this.logView.RefreshLogView();
- }
+ Bookmark bookmark = bookmarkData.Bookmarks[rowIndex];
+ bookmark.Text = bookmarkTextBox.Text;
+ logView?.RefreshLogView();
}
- private void bookmarkDataGridView_SelectionChanged(object sender, System.EventArgs e)
+ private void bookmarkDataGridView_SelectionChanged(object sender, EventArgs e)
{
- if (this.bookmarkDataGridView.SelectedRows.Count != 1
- || this.bookmarkDataGridView.SelectedRows[0].Index >= this.bookmarkData.Bookmarks.Count)
+ if (bookmarkDataGridView.SelectedRows.Count != 1
+ || bookmarkDataGridView.SelectedRows[0].Index >= bookmarkData.Bookmarks.Count)
{
CurrentRowChanged(-1);
}
else
{
- CurrentRowChanged(this.bookmarkDataGridView.SelectedRows[0].Index);
+ CurrentRowChanged(bookmarkDataGridView.SelectedRows[0].Index);
}
}
@@ -466,11 +471,12 @@ private void bookmarkDataGridView_PreviewKeyDown(object sender, PreviewKeyDownEv
private void bookmarkDataGridView_CellToolTipTextNeeded(object sender,
DataGridViewCellToolTipTextNeededEventArgs e)
{
- if (e.ColumnIndex != 0 || e.RowIndex <= -1 || e.RowIndex >= this.bookmarkData.Bookmarks.Count)
+ if (e.ColumnIndex != 0 || e.RowIndex <= -1 || e.RowIndex >= bookmarkData.Bookmarks.Count)
{
return;
}
- Bookmark bookmark = this.bookmarkData.Bookmarks[e.RowIndex];
+
+ Bookmark bookmark = bookmarkData.Bookmarks[e.RowIndex];
if (!string.IsNullOrEmpty(bookmark.Text))
{
e.ToolTipText = bookmark.Text;
@@ -481,28 +487,29 @@ private void bookmarkDataGridView_CellToolTipTextNeeded(object sender,
private void bookmarkDataGridView_CellDoubleClick(object sender, DataGridViewCellEventArgs e)
{
// Toggle bookmark when double-clicking on the first column
- if (e.ColumnIndex == 0 && e.RowIndex >= 0 && this.bookmarkDataGridView.CurrentRow != null)
+ if (e.ColumnIndex == 0 && e.RowIndex >= 0 && bookmarkDataGridView.CurrentRow != null)
{
- int index = this.bookmarkDataGridView.CurrentRow.Index;
- int lineNum = this.bookmarkData.Bookmarks[this.bookmarkDataGridView.CurrentRow.Index].LineNum;
- this.bookmarkData.ToggleBookmark(lineNum);
- // we don't ask for confirmation if the bookmark has an associated comment...
+ int index = bookmarkDataGridView.CurrentRow.Index;
+ int lineNum = bookmarkData.Bookmarks[bookmarkDataGridView.CurrentRow.Index].LineNum;
+ bookmarkData.ToggleBookmark(lineNum);
- int boomarkCount = this.bookmarkData.Bookmarks.Count;
- this.bookmarkDataGridView.RowCount = boomarkCount;
+// we don't ask for confirmation if the bookmark has an associated comment...
+ int boomarkCount = bookmarkData.Bookmarks.Count;
+ bookmarkDataGridView.RowCount = boomarkCount;
if (index < boomarkCount)
{
- this.bookmarkDataGridView.CurrentCell = this.bookmarkDataGridView.Rows[index].Cells[0];
+ bookmarkDataGridView.CurrentCell = bookmarkDataGridView.Rows[index].Cells[0];
}
else
{
if (boomarkCount > 0)
{
- this.bookmarkDataGridView.CurrentCell =
- this.bookmarkDataGridView.Rows[boomarkCount - 1].Cells[0];
+ bookmarkDataGridView.CurrentCell =
+ bookmarkDataGridView.Rows[boomarkCount - 1].Cells[0];
}
}
+
if (boomarkCount > index)
{
CurrentRowChanged(index);
@@ -511,20 +518,21 @@ private void bookmarkDataGridView_CellDoubleClick(object sender, DataGridViewCel
{
if (boomarkCount > 0)
{
- CurrentRowChanged(this.bookmarkDataGridView.RowCount - 1);
+ CurrentRowChanged(bookmarkDataGridView.RowCount - 1);
}
else
{
CurrentRowChanged(-1);
}
}
+
return;
}
- if (this.bookmarkDataGridView.CurrentRow != null && e.RowIndex >= 0)
+ if (bookmarkDataGridView.CurrentRow != null && e.RowIndex >= 0)
{
- int lineNum = this.bookmarkData.Bookmarks[this.bookmarkDataGridView.CurrentRow.Index].LineNum;
- this.logView.SelectAndEnsureVisible(lineNum, true);
+ int lineNum = bookmarkData.Bookmarks[bookmarkDataGridView.CurrentRow.Index].LineNum;
+ logView.SelectAndEnsureVisible(lineNum, true);
}
}
@@ -536,23 +544,23 @@ private void removeCommentsToolStripMenuItem_Click(object sender, EventArgs e)
DialogResult.Yes)
{
List lineNumList = new List();
- foreach (DataGridViewRow row in this.bookmarkDataGridView.SelectedRows)
+ foreach (DataGridViewRow row in bookmarkDataGridView.SelectedRows)
{
if (row.Index != -1)
{
- this.bookmarkData.Bookmarks[row.Index].Text = "";
+ bookmarkData.Bookmarks[row.Index].Text = string.Empty;
}
}
- this.bookmarkTextBox.Text = "";
- this.bookmarkDataGridView.Refresh();
- this.logView.RefreshLogView();
+ bookmarkTextBox.Text = string.Empty;
+ bookmarkDataGridView.Refresh();
+ logView.RefreshLogView();
}
}
private void commentColumnCheckBox_CheckedChanged(object sender, EventArgs e)
{
- ShowCommentColumn(this.commentColumnCheckBox.Checked);
+ ShowCommentColumn(commentColumnCheckBox.Checked);
}
private void BookmarkWindow_ClientSizeChanged(object sender, EventArgs e)
@@ -561,22 +569,23 @@ private void BookmarkWindow_ClientSizeChanged(object sender, EventArgs e)
{
if (Width > Height)
{
- this.splitContainer1.Orientation = Orientation.Vertical;
+ splitContainer1.Orientation = Orientation.Vertical;
int distance = Width - 200;
- this.splitContainer1.SplitterDistance = distance > this.splitContainer1.Panel1MinSize
+ splitContainer1.SplitterDistance = distance > splitContainer1.Panel1MinSize
? distance
- : this.splitContainer1.Panel1MinSize;
+ : splitContainer1.Panel1MinSize;
}
else
{
- this.splitContainer1.Orientation = Orientation.Horizontal;
+ splitContainer1.Orientation = Orientation.Horizontal;
int distance = Height - 200;
- this.splitContainer1.SplitterDistance = distance > this.splitContainer1.Panel1MinSize
+ splitContainer1.SplitterDistance = distance > splitContainer1.Panel1MinSize
? distance
- : this.splitContainer1.Panel1MinSize;
+ : splitContainer1.Panel1MinSize;
}
}
- if (!this.splitContainer1.Visible)
+
+ if (!splitContainer1.Visible)
{
// redraw the "no bookmarks" display
Invalidate();
@@ -595,11 +604,11 @@ private void bookmarkDataGridView_RowsRemoved(object sender, DataGridViewRowsRem
private void BookmarkWindow_SizeChanged(object sender, EventArgs e)
{
- //if (!this.splitContainer1.Visible)
- //{
- // // redraw the "no bookmarks" display
- // Invalidate();
- //}
+ // if (!this.splitContainer1.Visible)
+ // {
+ // // redraw the "no bookmarks" display
+ // Invalidate();
+ // }
}
#endregion
diff --git a/src/LogExpert/Dialogs/FilterSelectorForm.cs b/src/LogExpert/Dialogs/FilterSelectorForm.cs
index 987a88b2..b91a9806 100644
--- a/src/LogExpert/Dialogs/FilterSelectorForm.cs
+++ b/src/LogExpert/Dialogs/FilterSelectorForm.cs
@@ -4,7 +4,8 @@
using System.Data;
using System.Drawing;
using System.Text;
-//using System.Linq;
+
+// using System.Linq;
using System.Windows.Forms;
namespace LogExpert
@@ -13,46 +14,39 @@ public partial class FilterSelectorForm : Form
{
#region Fields
- private readonly ILogLineColumnizerCallback callback = null;
- private readonly IList columnizerList;
+ private readonly ILogLineColumnizerCallback _callback;
+ private readonly IList _columnizerList;
#endregion
#region cTor
- public FilterSelectorForm(IList existingColumnizerList,
- ILogLineColumnizer currentColumnizer, ILogLineColumnizerCallback callback)
+ public FilterSelectorForm(IList existingColumnizerList, ILogLineColumnizer currentColumnizer, ILogLineColumnizerCallback callback)
{
- this.SelectedColumnizer = currentColumnizer;
- this.callback = callback;
+ SelectedColumnizer = currentColumnizer;
+ _callback = callback;
InitializeComponent();
- this.filterComboBox.SelectedIndexChanged += new EventHandler(filterComboBox_SelectedIndexChanged);
+ filterComboBox.SelectedIndexChanged += filterComboBox_SelectedIndexChanged;
// for the currently selected columnizer use the current instance and not the template instance from
// columnizer registry. This ensures that changes made in columnizer config dialogs
// will apply to the current instance
- this.columnizerList = new List();
+ _columnizerList = new List();
foreach (ILogLineColumnizer col in existingColumnizerList)
{
- if (col.GetType().Equals(this.SelectedColumnizer.GetType()))
- {
- this.columnizerList.Add(this.SelectedColumnizer);
- }
- else
- {
- this.columnizerList.Add(col);
- }
+ _columnizerList.Add(col.GetType() == SelectedColumnizer.GetType() ? SelectedColumnizer : col);
}
- foreach (ILogLineColumnizer col in this.columnizerList)
+
+ foreach (ILogLineColumnizer col in _columnizerList)
{
- this.filterComboBox.Items.Add(col);
+ filterComboBox.Items.Add(col);
}
- foreach (ILogLineColumnizer columnizer in this.columnizerList)
+ foreach (ILogLineColumnizer columnizer in _columnizerList)
{
- if (columnizer.GetType().Equals(this.SelectedColumnizer.GetType()))
+ if (columnizer.GetType() == SelectedColumnizer.GetType())
{
- this.filterComboBox.SelectedItem = columnizer;
+ filterComboBox.SelectedItem = columnizer;
break;
}
}
@@ -62,14 +56,11 @@ public FilterSelectorForm(IList existingColumnizerList,
#region Properties
- public ILogLineColumnizer SelectedColumnizer { get; private set; } = null;
+ public ILogLineColumnizer SelectedColumnizer { get; private set; }
- public bool ApplyToAll
- {
- get { return this.applyToAllCheckBox.Checked; }
- }
+ public bool ApplyToAll => applyToAllCheckBox.Checked;
- public bool IsConfigPressed { get; private set; } = false;
+ public bool IsConfigPressed { get; private set; }
#endregion
@@ -77,22 +68,21 @@ public bool ApplyToAll
private void filterComboBox_SelectedIndexChanged(object sender, EventArgs e)
{
- ILogLineColumnizer col = columnizerList[this.filterComboBox.SelectedIndex];
- this.SelectedColumnizer = col;
+ ILogLineColumnizer col = _columnizerList[filterComboBox.SelectedIndex];
+ SelectedColumnizer = col;
string description = col.GetDescription();
- description += "\r\nSupports timeshift: " +
- (this.SelectedColumnizer.IsTimeshiftImplemented() ? "Yes" : "No");
- this.commentTextBox.Text = description;
- this.configButton.Enabled = this.SelectedColumnizer is IColumnizerConfigurator;
+ description += "\r\nSupports timeshift: " + (SelectedColumnizer.IsTimeshiftImplemented() ? "Yes" : "No");
+ commentTextBox.Text = description;
+ configButton.Enabled = SelectedColumnizer is IColumnizerConfigurator;
}
private void configButton_Click(object sender, EventArgs e)
{
- if (this.SelectedColumnizer is IColumnizerConfigurator)
+ if (SelectedColumnizer is IColumnizerConfigurator)
{
- ((IColumnizerConfigurator) this.SelectedColumnizer).Configure(this.callback, ConfigManager.ConfigDir);
- this.IsConfigPressed = true;
+ ((IColumnizerConfigurator) SelectedColumnizer).Configure(_callback, ConfigManager.ConfigDir);
+ IsConfigPressed = true;
}
}
diff --git a/src/LogExpert/Dialogs/SettingsDialog.cs b/src/LogExpert/Dialogs/SettingsDialog.cs
index 2d3ea7c8..5b81f1b7 100644
--- a/src/LogExpert/Dialogs/SettingsDialog.cs
+++ b/src/LogExpert/Dialogs/SettingsDialog.cs
@@ -153,14 +153,7 @@ private void FillDialog()
private void FillPortableMode()
{
- if (File.Exists(ConfigManager.PortableMode))
- {
- checkBoxPortableMode.CheckState = CheckState.Checked;
- }
- else
- {
- checkBoxPortableMode.CheckState = CheckState.Unchecked;
- }
+ checkBoxPortableMode.CheckState = File.Exists(ConfigManager.PortableMode) ? CheckState.Checked : CheckState.Unchecked;
}
private void DisplayFontName()
@@ -187,7 +180,7 @@ private void SaveMultifileData()
}
Preferences.multifileOptions.FormatPattern = textBoxMultifilePattern.Text;
- Preferences.multifileOptions.MaxDayTry = (int) upDownMultifileDays.Value;
+ Preferences.multifileOptions.MaxDayTry = (int)upDownMultifileDays.Value;
}
private void ToolButtonClick(TextBox textBox)
@@ -367,13 +360,14 @@ private void FillHighlightMaskList()
private void SaveColumnizerList()
{
Preferences.columnizerMaskList.Clear();
+
foreach (DataGridViewRow row in dataGridViewColumnizer.Rows)
{
if (!row.IsNewRow)
{
ColumnizerMaskEntry entry = new ColumnizerMaskEntry();
- entry.mask = (string) row.Cells[0].Value;
- entry.columnizerName = (string) row.Cells[1].Value;
+ entry.mask = (string)row.Cells[0].Value;
+ entry.columnizerName = (string)row.Cells[1].Value;
Preferences.columnizerMaskList.Add(entry);
}
}
@@ -382,13 +376,14 @@ private void SaveColumnizerList()
private void SaveHighlightMaskList()
{
Preferences.highlightMaskList.Clear();
+
foreach (DataGridViewRow row in dataGridViewHighlightMask.Rows)
{
if (!row.IsNewRow)
{
HighlightMaskEntry entry = new HighlightMaskEntry();
- entry.mask = (string) row.Cells[0].Value;
- entry.highlightGroupName = (string) row.Cells[1].Value;
+ entry.mask = (string)row.Cells[0].Value;
+ entry.highlightGroupName = (string)row.Cells[1].Value;
Preferences.highlightMaskList.Add(entry);
}
}
@@ -467,14 +462,20 @@ private void FillMultifileSettings()
switch (Preferences.multiFileOption)
{
case MultiFileOption.SingleFiles:
+ {
radioButtonLoadEveryFileIntoSeperatedTab.Checked = true;
break;
+ }
case MultiFileOption.MultiFile:
+ {
radioButtonTreatAllFilesAsOneMultifile.Checked = true;
break;
+ }
case MultiFileOption.Ask:
+ {
radioButtonAskWhatToDo.Checked = true;
break;
+ }
}
textBoxMultifilePattern.Text = Preferences.multifileOptions.FormatPattern;
@@ -636,8 +637,8 @@ private void okButton_Click(object sender, EventArgs e)
Preferences.showColumnFinder = checkBoxColumnFinder.Checked;
Preferences.useLegacyReader = checkBoxLegacyReader.Checked;
- Preferences.maximumFilterEntries = (int) upDownMaximumFilterEntries.Value;
- Preferences.maximumFilterEntriesDisplayed = (int) upDownMaximumFilterEntriesDisplayed.Value;
+ Preferences.maximumFilterEntries = (int)upDownMaximumFilterEntries.Value;
+ Preferences.maximumFilterEntriesDisplayed = (int)upDownMaximumFilterEntriesDisplayed.Value;
SavePluginSettings();
SaveHighlightMaskList();
diff --git a/src/LogExpert/Program.cs b/src/LogExpert/Program.cs
index c058550b..48302cad 100644
--- a/src/LogExpert/Program.cs
+++ b/src/LogExpert/Program.cs
@@ -9,7 +9,6 @@
using System.Diagnostics;
using System.Security;
using System.Reflection;
-using System.Security.Principal;
using LogExpert.Dialogs;
using ITDM;
using NLog;
@@ -46,14 +45,12 @@ private static void Main(string[] orgArgs)
private static void Sub_Main(string[] orgArgs)
{
- AppDomain.CurrentDomain.UnhandledException +=
- new UnhandledExceptionEventHandler(CurrentDomain_UnhandledException);
- Application.ThreadException += new ThreadExceptionEventHandler(Application_ThreadException);
+ AppDomain.CurrentDomain.UnhandledException += CurrentDomain_UnhandledException;
+ Application.ThreadException += Application_ThreadException;
Application.SetUnhandledExceptionMode(UnhandledExceptionMode.CatchException);
- _logger.Info("\r\n============================================================================\r\nLogExpert {0} started.\r\n============================================================================",
- Assembly.GetExecutingAssembly().GetName().Version.ToString(3));
+ _logger.Info("\r\n============================================================================\r\nLogExpert {0} started.\r\n============================================================================", Assembly.GetExecutingAssembly().GetName().Version.ToString(3));
CmdLine cmdLine = new CmdLine();
CmdLineString configFile = new CmdLineString("config", false, "A configuration (settings) file");
@@ -70,14 +67,7 @@ private static void Sub_Main(string[] orgArgs)
try
{
FileInfo info = new FileInfo(fileArg);
- if (info.Exists)
- {
- argsList.Add(info.FullName);
- }
- else
- {
- argsList.Add(fileArg);
- }
+ argsList.Add(info.Exists ? info.FullName : fileArg);
}
catch (Exception)
{
@@ -88,13 +78,14 @@ private static void Sub_Main(string[] orgArgs)
if (configFile.Exists)
{
FileInfo cfgFileInfo = new FileInfo(configFile.Value);
+
if (cfgFileInfo.Exists)
{
ConfigManager.Import(cfgFileInfo, ExportImportFlags.All);
}
else
{
- MessageBox.Show("Config file not found", "LogExpert");
+ MessageBox.Show(@"Config file not found", @"LogExpert");
}
}
@@ -103,8 +94,7 @@ private static void Sub_Main(string[] orgArgs)
try
{
Settings settings = ConfigManager.Settings;
- bool isCreated = false;
- Mutex mutex = new System.Threading.Mutex(false, "Local\\LogExpertInstanceMutex" + pId, out isCreated);
+ Mutex mutex = new Mutex(false, "Local\\LogExpertInstanceMutex" + pId, out var isCreated);
if (isCreated)
{
// first application instance
@@ -114,11 +104,10 @@ private static void Sub_Main(string[] orgArgs)
// first instance
//WindowsIdentity wi = WindowsIdentity.GetCurrent();
+
IpcServerChannel ipcChannel = new IpcServerChannel("LogExpert" + pId);
ChannelServices.RegisterChannel(ipcChannel, false);
- RemotingConfiguration.RegisterWellKnownServiceType(typeof(LogExpertProxy),
- "LogExpertProxy",
- WellKnownObjectMode.Singleton);
+ RemotingConfiguration.RegisterWellKnownServiceType(typeof(LogExpertProxy), "LogExpertProxy", WellKnownObjectMode.Singleton);
LogExpertProxy proxy = new LogExpertProxy(logWin);
RemotingServices.Marshal(proxy, "LogExpertProxy");
@@ -133,14 +122,14 @@ private static void Sub_Main(string[] orgArgs)
Exception errMsg = null;
IpcClientChannel ipcChannel = new IpcClientChannel("LogExpertClient#" + pId, null);
ChannelServices.RegisterChannel(ipcChannel, false);
+
while (counter > 0)
{
try
{
// another instance already exists
//WindowsIdentity wi = WindowsIdentity.GetCurrent();
- LogExpertProxy proxy = (LogExpertProxy) Activator.GetObject(typeof(LogExpertProxy),
- "ipc://LogExpert" + pId + "/LogExpertProxy");
+ LogExpertProxy proxy = (LogExpertProxy) Activator.GetObject(typeof(LogExpertProxy), "ipc://LogExpert" + pId + "/LogExpertProxy");
if (settings.preferences.allowOnlyOneInstance)
{
proxy.LoadFiles(args);
@@ -159,12 +148,14 @@ private static void Sub_Main(string[] orgArgs)
Thread.Sleep(500);
}
}
+
if (counter == 0)
{
_logger.Error(errMsg, "IpcClientChannel error, giving up: ");
MessageBox.Show($"Cannot open connection to first instance ({errMsg})", "LogExpert");
}
}
+
mutex.Close();
}
catch (Exception ex)
@@ -177,18 +168,18 @@ private static void Sub_Main(string[] orgArgs)
[STAThread]
private static void ShowUnhandledException(object exceptionObject)
{
- string errorText = "";
- string stackTrace = "";
- if (exceptionObject is Exception)
+ string errorText = string.Empty;
+ string stackTrace = string.Empty;
+ if (exceptionObject is Exception exception)
{
- errorText = (exceptionObject as Exception).Message;
- stackTrace = "\r\n" + (exceptionObject as Exception).GetType().Name + "\r\n" +
- (exceptionObject as Exception).StackTrace;
+ errorText = exception.Message;
+ stackTrace = "\r\n" + exception.GetType().Name + "\r\n" +
+ exception.StackTrace;
}
else
{
stackTrace = exceptionObject.ToString();
- string[] lines = stackTrace.Split(new char[] {'\n'});
+ string[] lines = stackTrace.Split('\n');
if (lines != null && lines.Length > 0)
{
errorText = lines[0];
@@ -207,7 +198,7 @@ private static void Application_ThreadException(object sender, ThreadExceptionEv
_logger.Fatal(e);
//ShowUnhandledException(e.Exception);
- Thread thread = new Thread(new ParameterizedThreadStart(ShowUnhandledException));
+ Thread thread = new Thread(ShowUnhandledException);
thread.IsBackground = true;
thread.SetApartmentState(ApartmentState.STA);
thread.Start(e.Exception);
@@ -220,7 +211,7 @@ private static void CurrentDomain_UnhandledException(object sender, UnhandledExc
object exceptionObject = e.ExceptionObject;
//ShowUnhandledException(exceptionObject);
- Thread thread = new Thread(new ParameterizedThreadStart(ShowUnhandledException));
+ Thread thread = new Thread(ShowUnhandledException);
thread.IsBackground = true;
thread.SetApartmentState(ApartmentState.STA);
thread.Start(exceptionObject);