diff --git a/src/LogExpert.Core/Classes/Bookmark/BookmarkDataProvider.cs b/src/LogExpert.Core/Classes/Bookmark/BookmarkDataProvider.cs index 30a2d94b..bf098ffc 100644 --- a/src/LogExpert.Core/Classes/Bookmark/BookmarkDataProvider.cs +++ b/src/LogExpert.Core/Classes/Bookmark/BookmarkDataProvider.cs @@ -1,176 +1,185 @@ -using LogExpert.Core.Entities; +using LogExpert.Core.Entities; using LogExpert.Core.Interface; using NLog; -namespace LogExpert.Core.Classes.Bookmark +namespace LogExpert.Core.Classes.Bookmark; + +public class BookmarkDataProvider : IBookmarkData { - public class BookmarkDataProvider : IBookmarkData - { - #region Fields + #region Fields - private static readonly ILogger _logger = LogManager.GetCurrentClassLogger(); + private static readonly Logger _logger = LogManager.GetCurrentClassLogger(); - #endregion + #endregion - #region cTor + #region cTor - public BookmarkDataProvider() - { - BookmarkList = []; - } + public BookmarkDataProvider () + { + BookmarkList = []; + } - public BookmarkDataProvider(SortedList bookmarkList) - { - BookmarkList = bookmarkList; - } + public BookmarkDataProvider (SortedList bookmarkList) + { + BookmarkList = bookmarkList; + } - #endregion + #endregion - #region Delegates + #region Delegates - public delegate void AllBookmarksRemovedEventHandler(object sender, System.EventArgs e); + public delegate void AllBookmarksRemovedEventHandler (object sender, EventArgs e); - public delegate void BookmarkAddedEventHandler(object sender, System.EventArgs e); + public delegate void BookmarkAddedEventHandler (object sender, EventArgs e); - public delegate void BookmarkRemovedEventHandler(object sender, System.EventArgs e); + public delegate void BookmarkRemovedEventHandler (object sender, EventArgs e); - #endregion + #endregion - #region Events + #region Events - public event BookmarkAddedEventHandler BookmarkAdded; - public event BookmarkRemovedEventHandler BookmarkRemoved; - public event AllBookmarksRemovedEventHandler AllBookmarksRemoved; + public event BookmarkAddedEventHandler BookmarkAdded; + public event BookmarkRemovedEventHandler BookmarkRemoved; + public event AllBookmarksRemovedEventHandler AllBookmarksRemoved; - #endregion + #endregion - #region Properties + #region Properties - public BookmarkCollection Bookmarks => new(BookmarkList); + public BookmarkCollection Bookmarks => new(BookmarkList); - public SortedList BookmarkList { get; set; } + public SortedList BookmarkList { get; private set; } - #endregion + #endregion - #region Public methods + #region Public methods - public void ToggleBookmark(int lineNum) - { - if (IsBookmarkAtLine(lineNum)) - { - RemoveBookmarkForLine(lineNum); - } - else - { - AddBookmark(new Entities.Bookmark(lineNum)); - } - } + public void SetBookmarks (SortedList bookmarkList) + { + BookmarkList = bookmarkList; + } - public bool IsBookmarkAtLine(int lineNum) + public void ToggleBookmark (int lineNum) + { + if (IsBookmarkAtLine(lineNum)) { - return BookmarkList.ContainsKey(lineNum); + RemoveBookmarkForLine(lineNum); } - - public int GetBookmarkIndexForLine(int lineNum) + else { - return BookmarkList.IndexOfKey(lineNum); + AddBookmark(new Entities.Bookmark(lineNum)); } + } - public Entities.Bookmark GetBookmarkForLine(int lineNum) - { - return BookmarkList[lineNum]; - } + public bool IsBookmarkAtLine (int lineNum) + { + return BookmarkList.ContainsKey(lineNum); + } - #endregion + public int GetBookmarkIndexForLine (int lineNum) + { + return BookmarkList.IndexOfKey(lineNum); + } - #region Internals + public Entities.Bookmark GetBookmarkForLine (int lineNum) + { + return BookmarkList[lineNum]; + } - public void ShiftBookmarks(int offset) - { - SortedList newBookmarkList = []; - foreach (Entities.Bookmark bookmark in BookmarkList.Values) - { - int line = bookmark.LineNum - offset; - if (line >= 0) - { - bookmark.LineNum = line; - newBookmarkList.Add(line, bookmark); - } - } - BookmarkList = newBookmarkList; - } + #endregion - public int FindPrevBookmarkIndex(int lineNum) + #region Internals + + public void ShiftBookmarks (int offset) + { + SortedList newBookmarkList = []; + + foreach (Entities.Bookmark bookmark in BookmarkList.Values) { - IList values = BookmarkList.Values; - for (int i = BookmarkList.Count - 1; i >= 0; --i) + var line = bookmark.LineNum - offset; + if (line >= 0) { - if (values[i].LineNum <= lineNum) - { - return i; - } + bookmark.LineNum = line; + newBookmarkList.Add(line, bookmark); } - return BookmarkList.Count - 1; } - public int FindNextBookmarkIndex(int lineNum) + BookmarkList = newBookmarkList; + } + + public int FindPrevBookmarkIndex (int lineNum) + { + IList values = BookmarkList.Values; + for (var i = BookmarkList.Count - 1; i >= 0; --i) { - IList values = BookmarkList.Values; - for (int i = 0; i < BookmarkList.Count; ++i) + if (values[i].LineNum <= lineNum) { - if (values[i].LineNum >= lineNum) - { - return i; - } + return i; } - return 0; } - public void RemoveBookmarkForLine(int lineNum) - { - BookmarkList.Remove(lineNum); - OnBookmarkRemoved(); - } + return BookmarkList.Count - 1; + } - public void RemoveBookmarksForLines(List lineNumList) + public int FindNextBookmarkIndex (int lineNum) + { + IList values = BookmarkList.Values; + for (var i = 0; i < BookmarkList.Count; ++i) { - foreach (int lineNum in lineNumList) + if (values[i].LineNum >= lineNum) { - BookmarkList.Remove(lineNum); + return i; } - OnBookmarkRemoved(); } + return 0; + } + public void RemoveBookmarkForLine (int lineNum) + { + _ = BookmarkList.Remove(lineNum); + OnBookmarkRemoved(); + } - public void AddBookmark(Entities.Bookmark bookmark) + public void RemoveBookmarksForLines (List lineNumList) + { + foreach (var lineNum in lineNumList) { - BookmarkList.Add(bookmark.LineNum, bookmark); - OnBookmarkAdded(); - } + _ = BookmarkList.Remove(lineNum); - public void ClearAllBookmarks() - { - _logger.Debug("Removing all bookmarks"); - BookmarkList.Clear(); - OnAllBookmarksRemoved(); } - #endregion + OnBookmarkRemoved(); + } - protected void OnBookmarkAdded() - { - BookmarkAdded?.Invoke(this, System.EventArgs.Empty); - } - protected void OnBookmarkRemoved() - { - BookmarkRemoved?.Invoke(this, System.EventArgs.Empty); - } + public void AddBookmark (Entities.Bookmark bookmark) + { + BookmarkList.Add(bookmark.LineNum, bookmark); + OnBookmarkAdded(); + } - protected void OnAllBookmarksRemoved() - { - AllBookmarksRemoved?.Invoke(this, System.EventArgs.Empty); - } + public void ClearAllBookmarks () + { + _logger.Debug("Removing all bookmarks"); + BookmarkList.Clear(); + OnAllBookmarksRemoved(); + } + + #endregion + + protected void OnBookmarkAdded () + { + BookmarkAdded?.Invoke(this, EventArgs.Empty); + } + + protected void OnBookmarkRemoved () + { + BookmarkRemoved?.Invoke(this, EventArgs.Empty); + } + + protected void OnAllBookmarksRemoved () + { + AllBookmarksRemoved?.Invoke(this, EventArgs.Empty); } } \ No newline at end of file diff --git a/src/LogExpert.Core/Classes/Bookmark/BookmarkExporter.cs b/src/LogExpert.Core/Classes/Bookmark/BookmarkExporter.cs index ac4a34a5..6cd3fa13 100644 --- a/src/LogExpert.Core/Classes/Bookmark/BookmarkExporter.cs +++ b/src/LogExpert.Core/Classes/Bookmark/BookmarkExporter.cs @@ -1,73 +1,70 @@ -namespace LogExpert.Core.Classes.Bookmark +namespace LogExpert.Core.Classes.Bookmark; + +public static class BookmarkExporter { - public static class BookmarkExporter - { - #region Fields + #region Fields - private const string replacementForNewLine = @"\n"; + private const string replacementForNewLine = @"\n"; - #endregion + #endregion - #region Public methods + #region Public methods - public static void ExportBookmarkList(SortedList bookmarkList, string logfileName, - string fileName) + public static void ExportBookmarkList (SortedList bookmarkList, string logfileName, + string fileName) + { + FileStream fs = new(fileName, FileMode.Create, FileAccess.Write); + StreamWriter writer = new(fs); + writer.WriteLine("Log file name;Line number;Comment"); + foreach (Entities.Bookmark bookmark in bookmarkList.Values) { - FileStream fs = new(fileName, FileMode.Create, FileAccess.Write); - StreamWriter writer = new(fs); - writer.WriteLine("Log file name;Line number;Comment"); - foreach (Entities.Bookmark bookmark in bookmarkList.Values) - { - string line = logfileName + ";" + bookmark.LineNum + ";" + - bookmark.Text.Replace(replacementForNewLine, @"\" + replacementForNewLine).Replace("\r\n", replacementForNewLine); - writer.WriteLine(line); - } - writer.Close(); - fs.Close(); + string line = $"{logfileName};{bookmark.LineNum};{bookmark.Text.Replace(replacementForNewLine, @"\" + replacementForNewLine, StringComparison.OrdinalIgnoreCase).Replace("\r\n", replacementForNewLine, StringComparison.OrdinalIgnoreCase)}"; + writer.WriteLine(line); } + writer.Close(); + fs.Close(); + } - public static void ImportBookmarkList(string logfileName, string fileName, SortedList bookmarkList) + public static void ImportBookmarkList (string logfileName, string fileName, SortedList bookmarkList) + { + using FileStream fs = new(fileName, FileMode.Open, FileAccess.Read); + using StreamReader reader = new(fs); + if (!reader.EndOfStream) { - using FileStream fs = new(fileName, FileMode.Open, FileAccess.Read); - using StreamReader reader = new(fs); - if (!reader.EndOfStream) - { - reader.ReadLine(); // skip "Log file name;Line number;Comment" - } + _ = reader.ReadLine(); // skip "Log file name;Line number;Comment" + } - while (!reader.EndOfStream) + while (!reader.EndOfStream) + { + try { - try - { - string line = reader.ReadLine(); - line = line.Replace(replacementForNewLine, "\r\n").Replace("\\\r\n", replacementForNewLine); + var line = reader.ReadLine(); + line = line.Replace(replacementForNewLine, "\r\n", StringComparison.OrdinalIgnoreCase).Replace("\\\r\n", replacementForNewLine, StringComparison.OrdinalIgnoreCase); - // Line is formatted: logfileName ";" bookmark.LineNum ";" bookmark.Text; - int firstSeparator = line.IndexOf(';'); - int secondSeparator = line.IndexOf(';', firstSeparator + 1); + // Line is formatted: logfileName ";" bookmark.LineNum ";" bookmark.Text; + var firstSeparator = line.IndexOf(';', StringComparison.OrdinalIgnoreCase); + var secondSeparator = line.IndexOf(';', firstSeparator + 1); - string fileStr = line.Substring(0, firstSeparator); - string lineStr = line.Substring(firstSeparator + 1, secondSeparator - firstSeparator - 1); - string comment = line.Substring(secondSeparator + 1); + var fileStr = line[..firstSeparator]; + var lineStr = line.Substring(firstSeparator + 1, secondSeparator - firstSeparator - 1); + var comment = line[(secondSeparator + 1)..]; - int lineNum; - if (int.TryParse(lineStr, out lineNum)) - { - Entities.Bookmark bookmark = new(lineNum, comment); - bookmarkList.Add(lineNum, bookmark); - } - else - { - //!!!log error: skipping a line entry - } + if (int.TryParse(lineStr, out var lineNum)) + { + Entities.Bookmark bookmark = new(lineNum, comment); + bookmarkList.Add(lineNum, bookmark); } - catch + else { - //!!! + //!!!log error: skipping a line entry } } + catch + { + //!!! + } } - - #endregion } + + #endregion } \ No newline at end of file diff --git a/src/LogExpert.Core/Classes/Bookmark/BookmarkView.cs b/src/LogExpert.Core/Classes/Bookmark/BookmarkView.cs deleted file mode 100644 index 7812f91d..00000000 --- a/src/LogExpert.Core/Classes/Bookmark/BookmarkView.cs +++ /dev/null @@ -1,46 +0,0 @@ -using System; - -using LogExpert.Core.Interface; - -namespace LogExpert.Core.Classes.Bookmark -{ - //TODO: Not in use! - internal class BookmarkView : IBookmarkView - { - #region Fields - - #endregion - - - #region IBookmarkView Member - - public void UpdateView() - { - throw new NotImplementedException(); - } - - public void BookmarkTextChanged(Entities.Bookmark bookmark) - { - throw new NotImplementedException(); - } - - public void SelectBookmark(int lineNum) - { - throw new NotImplementedException(); - } - - public bool LineColumnVisible - { - set { throw new NotImplementedException(); } - } - - public bool IsActive { get; set; } = false; - - public void SetBookmarkData(IBookmarkData bookmarkData) - { - throw new NotImplementedException(); - } - - #endregion - } -} \ No newline at end of file diff --git a/src/LogExpert.Core/Interface/IBookmarkData.cs b/src/LogExpert.Core/Interface/IBookmarkData.cs index c855f683..7abcedb7 100644 --- a/src/LogExpert.Core/Interface/IBookmarkData.cs +++ b/src/LogExpert.Core/Interface/IBookmarkData.cs @@ -1,25 +1,26 @@ -using LogExpert.Core.Entities; +using LogExpert.Core.Entities; -namespace LogExpert.Core.Interface +namespace LogExpert.Core.Interface; + +public interface IBookmarkData { - public interface IBookmarkData - { - #region Properties + #region Properties + + BookmarkCollection Bookmarks { get; } - BookmarkCollection Bookmarks { get; } + #endregion - #endregion + #region Public methods - #region Public methods + void ToggleBookmark (int lineNum); - void ToggleBookmark(int lineNum); + bool IsBookmarkAtLine (int lineNum); - bool IsBookmarkAtLine(int lineNum); + int GetBookmarkIndexForLine (int lineNum); - int GetBookmarkIndexForLine(int lineNum); + Bookmark GetBookmarkForLine (int lineNum); - Bookmark GetBookmarkForLine(int lineNum); + void SetBookmarks (SortedList bookmarkList); - #endregion - } + #endregion } \ No newline at end of file diff --git a/src/LogExpert.UI/Controls/LogWindow/LogWindowPrivate.cs b/src/LogExpert.UI/Controls/LogWindow/LogWindowPrivate.cs index 5b5622ed..1b9e9d78 100644 --- a/src/LogExpert.UI/Controls/LogWindow/LogWindowPrivate.cs +++ b/src/LogExpert.UI/Controls/LogWindow/LogWindowPrivate.cs @@ -1,4 +1,8 @@ -using LogExpert.Classes.Filter; +using System.Globalization; +using System.Text; +using System.Text.RegularExpressions; + +using LogExpert.Classes.Filter; using LogExpert.Classes.ILogLineColumnizerCallback; using LogExpert.Core.Classes; using LogExpert.Core.Classes.Columnizer; @@ -11,9 +15,6 @@ using LogExpert.Dialogs; using LogExpert.Extensions; using LogExpert.UI.Entities; -using System.Globalization; -using System.Text; -using System.Text.RegularExpressions; namespace LogExpert.UI.Controls.LogWindow { @@ -21,7 +22,7 @@ partial class LogWindow { #region Private Methods - private void RegisterLogFileReaderEvents() + private void RegisterLogFileReaderEvents () { _logFileReader.LoadFile += OnLogFileReaderLoadFile; _logFileReader.LoadingFinished += OnLogFileReaderFinishedLoading; @@ -31,7 +32,7 @@ private void RegisterLogFileReaderEvents() // FileSizeChanged is not registered here because it's registered after loading has finished } - private void UnRegisterLogFileReaderEvents() + private void UnRegisterLogFileReaderEvents () { if (_logFileReader != null) { @@ -44,7 +45,7 @@ private void UnRegisterLogFileReaderEvents() } } - private void CreateDefaultViewStyle() + private void CreateDefaultViewStyle () { DataGridViewCellStyle dataGridViewCellStyleMainGrid = new(); DataGridViewCellStyle dataGridViewCellStyleFilterGrid = new(); @@ -68,7 +69,7 @@ private void CreateDefaultViewStyle() filterGridView.DefaultCellStyle = dataGridViewCellStyleFilterGrid; } - private bool LoadPersistenceOptions() + private bool LoadPersistenceOptions () { if (InvokeRequired) { @@ -150,7 +151,7 @@ private bool LoadPersistenceOptions() } } - private void SetDefaultsFromPrefs() + private void SetDefaultsFromPrefs () { filterTailCheckBox.Checked = Preferences.filterTail; syncFilterCheckBox.Checked = Preferences.filterSync; @@ -158,7 +159,7 @@ private void SetDefaultsFromPrefs() _multiFileOptions = ObjectClone.Clone(Preferences.multiFileOptions); } - private void LoadPersistenceData() + private void LoadPersistenceData () { if (InvokeRequired) { @@ -197,12 +198,12 @@ private void LoadPersistenceData() { // outdated persistence data (logfile rollover) // MessageBox.Show(this, "Persistence data for " + this.FileName + " is outdated. It was discarded.", "Log Expert"); - _logger.Info("Persistence data for {0} is outdated. It was discarded.", FileName); - LoadPersistenceOptions(); + _logger.Info($"Persistence data for {FileName} is outdated. It was discarded."); + _ = LoadPersistenceOptions(); return; } - _bookmarkProvider.BookmarkList = persistenceData.bookmarkList; + _bookmarkProvider.SetBookmarks(persistenceData.bookmarkList); _rowHeightList = persistenceData.rowHeightList; try { @@ -247,7 +248,7 @@ private void LoadPersistenceData() } } - private void RestoreFilters(PersistenceData persistenceData) + private void RestoreFilters (PersistenceData persistenceData) { if (persistenceData.filterParamsList.Count > 0) { @@ -274,7 +275,7 @@ private void RestoreFilters(PersistenceData persistenceData) } } - private void RestoreFilterTabs(PersistenceData persistenceData) + private void RestoreFilterTabs (PersistenceData persistenceData) { foreach (FilterTabData data in persistenceData.filterTabDataList) { @@ -289,7 +290,7 @@ private void RestoreFilterTabs(PersistenceData persistenceData) } } - private void ReInitFilterParams(FilterParams filterParams) + private void ReInitFilterParams (FilterParams filterParams) { filterParams.SearchText = filterParams.SearchText; // init "lowerSearchText" filterParams.RangeSearchText = filterParams.RangeSearchText; // init "lowerRangesearchText" @@ -307,7 +308,7 @@ private void ReInitFilterParams(FilterParams filterParams) } } - private void EnterLoadFileStatus() + private void EnterLoadFileStatus () { _logger.Debug("EnterLoadFileStatus begin"); @@ -337,7 +338,7 @@ private void EnterLoadFileStatus() _logger.Debug("EnterLoadFileStatus end"); } - private void PositionAfterReload(ReloadMemento reloadMemento) + private void PositionAfterReload (ReloadMemento reloadMemento) { if (_reloadMemento.CurrentLine < dataGridView.RowCount && _reloadMemento.CurrentLine >= 0) { @@ -350,7 +351,7 @@ private void PositionAfterReload(ReloadMemento reloadMemento) } } - private void LogfileDead() + private void LogfileDead () { _logger.Info("File not found."); _isDeadFile = true; @@ -376,7 +377,7 @@ private void LogfileDead() OnFileNotFound(EventArgs.Empty); } - private void LogfileRespawned() + private void LogfileRespawned () { _logger.Info("LogfileDead(): Reloading file because it has been respawned."); _isDeadFile = false; @@ -386,7 +387,7 @@ private void LogfileRespawned() Reload(); } - private void SetGuiAfterLoading() + private void SetGuiAfterLoading () { if (Text.Length == 0) { @@ -465,7 +466,7 @@ private void SetGuiAfterLoading() locateLineInOriginalFileToolStripMenuItem.Enabled = FilterPipe != null; } - private ILogLineColumnizer FindColumnizer() + private ILogLineColumnizer FindColumnizer () { ILogLineColumnizer columnizer; if (Preferences.maskPrio) @@ -480,7 +481,7 @@ private ILogLineColumnizer FindColumnizer() return columnizer; } - private void ReloadNewFile() + private void ReloadNewFile () { // prevent "overloads". May occur on very fast rollovers (next rollover before the file is reloaded) lock (_reloadLock) @@ -518,7 +519,7 @@ private void ReloadNewFile() } } - private void ReloadFinishedThreadFx() + private void ReloadFinishedThreadFx () { _logger.Info("Waiting for loading to be complete."); _loadingFinishedEvent.WaitOne(); @@ -527,7 +528,7 @@ private void ReloadFinishedThreadFx() LoadFilterPipes(); } - private void UpdateProgress(LoadFileEventArgs e) + private void UpdateProgress (LoadFileEventArgs e) { try { @@ -550,7 +551,7 @@ private void UpdateProgress(LoadFileEventArgs e) } } - private void LoadingStarted(LoadFileEventArgs e) + private void LoadingStarted (LoadFileEventArgs e) { try { @@ -568,7 +569,7 @@ private void LoadingStarted(LoadFileEventArgs e) } } - private void LoadingFinished() + private void LoadingFinished () { _logger.Info("File loading complete."); @@ -600,7 +601,7 @@ private void LoadingFinished() //LoadPersistenceData(); } - private void LogEventWorker() + private void LogEventWorker () { Thread.CurrentThread.Name = "LogEventWorker"; while (true) @@ -647,7 +648,7 @@ private void LogEventWorker() } } - private void StopLogEventWorkerThread() + private void StopLogEventWorkerThread () { _logEventArgsEvent.Set(); cts.Cancel(); @@ -655,12 +656,12 @@ private void StopLogEventWorkerThread() //_logEventHandlerThread.Join(); } - private void OnFileSizeChanged(LogEventArgs e) + private void OnFileSizeChanged (LogEventArgs e) { FileSizeChanged?.Invoke(this, e); } - private void UpdateGrid(LogEventArgs e) + private void UpdateGrid (LogEventArgs e) { int oldRowCount = dataGridView.RowCount; int firstDisplayedLine = dataGridView.FirstDisplayedScrollingRowIndex; @@ -754,7 +755,7 @@ private void UpdateGrid(LogEventArgs e) //this.dataGridView.AutoResizeColumns(DataGridViewAutoSizeColumnsMode.DisplayedCells); } - private void CheckFilterAndHighlight(LogEventArgs e) + private void CheckFilterAndHighlight (LogEventArgs e) { bool noLed = true; bool suppressLed; @@ -882,7 +883,7 @@ private void CheckFilterAndHighlight(LogEventArgs e) } } - private void LaunchHighlightPlugins(IList matchingList, int lineNum) + private void LaunchHighlightPlugins (IList matchingList, int lineNum) { LogExpertCallback callback = new(this) { @@ -904,7 +905,7 @@ private void LaunchHighlightPlugins(IList matchingList, int line } } - private void PreSelectColumnizer(ILogLineColumnizer columnizer) + private void PreSelectColumnizer (ILogLineColumnizer columnizer) { if (columnizer != null) { @@ -917,7 +918,7 @@ private void PreSelectColumnizer(ILogLineColumnizer columnizer) } } - private void SetColumnizer(ILogLineColumnizer columnizer) + private void SetColumnizer (ILogLineColumnizer columnizer) { columnizer = ColumnizerPicker.FindReplacementForAutoColumnizer(FileName, _logFileReader, columnizer, PluginRegistry.PluginRegistry.Instance.RegisteredColumnizers); @@ -935,7 +936,7 @@ private void SetColumnizer(ILogLineColumnizer columnizer) } } - private void SetColumnizerInternal(ILogLineColumnizer columnizer) + private void SetColumnizerInternal (ILogLineColumnizer columnizer) { _logger.Info("SetColumnizerInternal(): {0}", columnizer.GetName()); @@ -1081,7 +1082,7 @@ private void SetColumnizerInternal(ILogLineColumnizer columnizer) OnColumnizerChanged(CurrentColumnizer); } - private void AutoResizeColumns(BufferedDataGridView gridView) + private void AutoResizeColumns (BufferedDataGridView gridView) { try { @@ -1105,13 +1106,13 @@ private void AutoResizeColumns(BufferedDataGridView gridView) } } - private void PaintCell(DataGridViewCellPaintingEventArgs e, BufferedDataGridView gridView, bool noBackgroundFill, + private void PaintCell (DataGridViewCellPaintingEventArgs e, BufferedDataGridView gridView, bool noBackgroundFill, HighlightEntry groundEntry) { PaintHighlightedCell(e, gridView, noBackgroundFill, groundEntry); } - private void PaintHighlightedCell(DataGridViewCellPaintingEventArgs e, BufferedDataGridView gridView, + private void PaintHighlightedCell (DataGridViewCellPaintingEventArgs e, BufferedDataGridView gridView, bool noBackgroundFill, HighlightEntry groundEntry) { @@ -1227,7 +1228,7 @@ private void PaintHighlightedCell(DataGridViewCellPaintingEventArgs e, BufferedD /// List of all highlight matches for the current cell /// The entry that is used as the default. /// List of HilightMatchEntry objects. The list spans over the whole cell and contains color infos for every substring. - private IList MergeHighlightMatchEntries(IList matchList, + private IList MergeHighlightMatchEntries (IList matchList, HilightMatchEntry groundEntry) { // Fill an area with lenth of whole text with a default hilight entry @@ -1297,17 +1298,17 @@ private IList MergeHighlightMatchEntries(IList /// Returns the first HilightEntry that matches the given line /// - private HighlightEntry FindHilightEntry(ITextValue line) + private HighlightEntry FindHilightEntry (ITextValue line) { return FindHighlightEntry(line, false); } - private HighlightEntry FindFirstNoWordMatchHilightEntry(ITextValue line) + private HighlightEntry FindFirstNoWordMatchHilightEntry (ITextValue line) { return FindHighlightEntry(line, true); } - private bool CheckHighlightEntryMatch(HighlightEntry entry, ITextValue column) + private bool CheckHighlightEntryMatch (HighlightEntry entry, ITextValue column) { if (entry.IsRegEx) { @@ -1341,7 +1342,7 @@ private bool CheckHighlightEntryMatch(HighlightEntry entry, ITextValue column) /// /// Returns all HilightEntry entries which matches the given line /// - private IList FindMatchingHilightEntries(ITextValue line) + private IList FindMatchingHilightEntries (ITextValue line) { IList resultList = []; if (line != null) @@ -1361,7 +1362,7 @@ private IList FindMatchingHilightEntries(ITextValue line) return resultList; } - private void GetHighlightEntryMatches(ITextValue line, IList hilightEntryList, IList resultList) + private void GetHighlightEntryMatches (ITextValue line, IList hilightEntryList, IList resultList) { foreach (HighlightEntry entry in hilightEntryList) { @@ -1391,7 +1392,7 @@ private void GetHighlightEntryMatches(ITextValue line, IList hil } } - private void GetHilightActions(IList matchingList, out bool noLed, out bool stopTail, + private void GetHilightActions (IList matchingList, out bool noLed, out bool stopTail, out bool setBookmark, out string bookmarkComment) { noLed = stopTail = setBookmark = false; @@ -1422,12 +1423,12 @@ private void GetHilightActions(IList matchingList, out bool noLe bookmarkComment = bookmarkComment.TrimEnd(['\r', '\n']); } - private void StopTimespreadThread() + private void StopTimespreadThread () { _timeSpreadCalc.Stop(); } - private void StopTimestampSyncThread() + private void StopTimestampSyncThread () { _shouldTimestampDisplaySyncingCancel = true; //_timeShiftSyncWakeupEvent.Set(); @@ -1436,7 +1437,7 @@ private void StopTimestampSyncThread() cts.Cancel(); } - private void SyncTimestampDisplay() + private void SyncTimestampDisplay () { if (CurrentColumnizer.IsTimeshiftImplemented()) { @@ -1447,14 +1448,14 @@ private void SyncTimestampDisplay() } } - private void SyncTimestampDisplay(int lineNum) + private void SyncTimestampDisplay (int lineNum) { _timeShiftSyncLine = lineNum; _timeShiftSyncTimerEvent.Set(); _timeShiftSyncWakeupEvent.Set(); } - private void SyncTimestampDisplayWorker() + private void SyncTimestampDisplayWorker () { const int WAIT_TIME = 500; Thread.CurrentThread.Name = "SyncTimestampDisplayWorker"; @@ -1538,7 +1539,7 @@ private void SyncTimestampDisplayWorker() } } - private void SyncFilterGridPos() + private void SyncFilterGridPos () { try { @@ -1570,13 +1571,13 @@ private void SyncFilterGridPos() } } - private void StatusLineFileSize(long size) + private void StatusLineFileSize (long size) { _statusEventArgs.FileSize = size; SendStatusLineUpdate(); } - private int Search(SearchParams searchParams) + private int Search (SearchParams searchParams) { if (searchParams.SearchText == null) { @@ -1689,14 +1690,14 @@ private int Search(SearchParams searchParams) } } - private void ResetProgressBar() + private void ResetProgressBar () { _progressEventArgs.Value = _progressEventArgs.MaxValue; _progressEventArgs.Visible = false; SendProgressBarUpdate(); } - private void SelectLine(int line, bool triggerSyncCall, bool shouldScroll) + private void SelectLine (int line, bool triggerSyncCall, bool shouldScroll) { try { @@ -1744,7 +1745,7 @@ private void SelectLine(int line, bool triggerSyncCall, bool shouldScroll) } } - private void StartEditMode() + private void StartEditMode () { if (!dataGridView.CurrentCell.ReadOnly) { @@ -1768,7 +1769,7 @@ private void StartEditMode() } } - private void UpdateEditColumnDisplay(DataGridViewTextBoxEditingControl editControl) + private void UpdateEditColumnDisplay (DataGridViewTextBoxEditingControl editControl) { // prevents key events after edit mode has ended if (dataGridView.EditingControl != null) @@ -1779,7 +1780,7 @@ private void UpdateEditColumnDisplay(DataGridViewTextBoxEditingControl editContr } } - private void SelectPrevHighlightLine() + private void SelectPrevHighlightLine () { int lineNum = dataGridView.CurrentCellAddress.Y; while (lineNum > 0) @@ -1798,7 +1799,7 @@ private void SelectPrevHighlightLine() } } - private void SelectNextHighlightLine() + private void SelectNextHighlightLine () { int lineNum = dataGridView.CurrentCellAddress.Y; while (lineNum < _logFileReader.LineCount) @@ -1817,7 +1818,7 @@ private void SelectNextHighlightLine() } } - private int FindNextBookmarkIndex(int lineNum) + private int FindNextBookmarkIndex (int lineNum) { if (lineNum >= dataGridView.RowCount) { @@ -1831,7 +1832,7 @@ private int FindNextBookmarkIndex(int lineNum) return _bookmarkProvider.FindNextBookmarkIndex(lineNum); } - private int FindPrevBookmarkIndex(int lineNum) + private int FindPrevBookmarkIndex (int lineNum) { if (lineNum <= 0) { @@ -1849,13 +1850,13 @@ private int FindPrevBookmarkIndex(int lineNum) * Shift bookmarks after a logfile rollover */ - private void ShiftBookmarks(int offset) + private void ShiftBookmarks (int offset) { _bookmarkProvider.ShiftBookmarks(offset); OnBookmarkRemoved(); } - private void ShiftRowHeightList(int offset) + private void ShiftRowHeightList (int offset) { SortedList newList = []; foreach (RowHeightEntry entry in _rowHeightList.Values) @@ -1871,7 +1872,7 @@ private void ShiftRowHeightList(int offset) _rowHeightList = newList; } - private void ShiftFilterPipes(int offset) + private void ShiftFilterPipes (int offset) { lock (_filterPipeList) { @@ -1882,7 +1883,7 @@ private void ShiftFilterPipes(int offset) } } - private void LoadFilterPipes() + private void LoadFilterPipes () { lock (_filterPipeList) { @@ -1901,7 +1902,7 @@ private void LoadFilterPipes() } } - private void DisconnectFilterPipes() + private void DisconnectFilterPipes () { lock (_filterPipeList) { @@ -1912,7 +1913,7 @@ private void DisconnectFilterPipes() } } - private void ApplyFilterParams() + private void ApplyFilterParams () { filterComboBox.Text = _filterParams.SearchText; filterCaseSensitiveCheckBox.Checked = _filterParams.IsCaseSensitive; @@ -1927,7 +1928,7 @@ private void ApplyFilterParams() filterRangeComboBox.Text = _filterParams.RangeSearchText; } - private void ResetFilterControls() + private void ResetFilterControls () { filterComboBox.Text = ""; filterCaseSensitiveCheckBox.Checked = false; @@ -1942,7 +1943,7 @@ private void ResetFilterControls() filterRangeComboBox.Text = ""; } - private void FilterSearch() + private void FilterSearch () { if (filterComboBox.Text.Length == 0) { @@ -1959,7 +1960,7 @@ private void FilterSearch() FilterSearch(filterComboBox.Text); } - private async void FilterSearch(string text) + private async void FilterSearch (string text) { FireCancelHandlers(); // make sure that there's no other filter running (maybe from filter restore) @@ -2054,7 +2055,7 @@ private async void FilterSearch(string text) CheckForFilterDirty(); } - private void MultiThreadedFilter(FilterParams filterParams, List filterResultLines, + private void MultiThreadedFilter (FilterParams filterParams, List filterResultLines, List lastFilterLinesList, List filterHitList) { ColumnizerCallback callback = new(this); @@ -2076,12 +2077,12 @@ private void MultiThreadedFilter(FilterParams filterParams, List filterResu StatusLineText("Filter duration: " + (endTime - startTime) + " ms."); } - private void FilterProgressCallback(int lineCount) + private void FilterProgressCallback (int lineCount) { UpdateProgressBar(lineCount); } - private void Filter(FilterParams filterParams, List filterResultLines, List lastFilterLinesList, + private void Filter (FilterParams filterParams, List filterResultLines, List lastFilterLinesList, List filterHitList) { long startTime = Environment.TickCount; @@ -2142,7 +2143,7 @@ private void Filter(FilterParams filterParams, List filterResultLines, List /// /// /// - private IList GetAdditionalFilterResults(FilterParams filterParams, int lineNum, IList checkList) + private IList GetAdditionalFilterResults (FilterParams filterParams, int lineNum, IList checkList) { IList resultList = []; //string textLine = this.logFileReader.GetLogLine(lineNum); @@ -2188,7 +2189,7 @@ private IList GetAdditionalFilterResults(FilterParams filterParams, int lin return resultList; } - private void AddFilterLine(int lineNum, bool immediate, FilterParams filterParams, List filterResultLines, + private void AddFilterLine (int lineNum, bool immediate, FilterParams filterParams, List filterResultLines, List lastFilterLinesList, List filterHitList) { int count; @@ -2216,7 +2217,7 @@ private void AddFilterLine(int lineNum, bool immediate, FilterParams filterParam } } - private void TriggerFilterLineGuiUpdate() + private void TriggerFilterLineGuiUpdate () { //lock (this.filterUpdateThread) //{ @@ -2278,7 +2279,7 @@ private void TriggerFilterLineGuiUpdate() // this.filterUpdateThread.Join(); //} - private void AddFilterLineGuiUpdate() + private void AddFilterLineGuiUpdate () { try { @@ -2310,7 +2311,7 @@ private void AddFilterLineGuiUpdate() } } - private void UpdateProgressBar(int value) + private void UpdateProgressBar (int value) { _progressEventArgs.Value = value; if (value > _progressEventArgs.MaxValue) @@ -2322,7 +2323,7 @@ private void UpdateProgressBar(int value) SendProgressBarUpdate(); } - private void FilterComplete() + private void FilterComplete () { if (!IsDisposed && !_waitingForClose && !Disposing) { @@ -2330,7 +2331,7 @@ private void FilterComplete() } } - private void FilterComplete(IAsyncResult result) + private void FilterComplete (IAsyncResult result) { if (!IsDisposed && !_waitingForClose && !Disposing) { @@ -2338,7 +2339,7 @@ private void FilterComplete(IAsyncResult result) } } - private void ResetStatusAfterFilter() + private void ResetStatusAfterFilter () { try { @@ -2367,7 +2368,7 @@ private void ResetStatusAfterFilter() } } - private void ClearFilterList() + private void ClearFilterList () { try { @@ -2392,7 +2393,7 @@ private void ClearFilterList() } } - private void ClearBookmarkList() + private void ClearBookmarkList () { _bookmarkProvider.ClearAllBookmarks(); } @@ -2401,7 +2402,7 @@ private void ClearBookmarkList() * Shift filter list line entries after a logfile rollover */ - private void ShiftFilterLines(int offset) + private void ShiftFilterLines (int offset) { List newFilterList = []; lock (_filterResultList) @@ -2445,7 +2446,7 @@ private void ShiftFilterLines(int offset) TriggerFilterLineGuiUpdate(); } - private void CheckForFilterDirty() + private void CheckForFilterDirty () { if (IsFilterSearchDirty(_filterParams)) { @@ -2459,7 +2460,7 @@ private void CheckForFilterDirty() } } - private bool IsFilterSearchDirty(FilterParams filterParams) + private bool IsFilterSearchDirty (FilterParams filterParams) { if (!filterParams.SearchText.Equals(filterComboBox.Text)) { @@ -2514,7 +2515,7 @@ private bool IsFilterSearchDirty(FilterParams filterParams) return false; } - private void AdjustMinimumGridWith() + private void AdjustMinimumGridWith () { if (dataGridView.Columns.Count > 1) { @@ -2532,7 +2533,7 @@ private void AdjustMinimumGridWith() } } - private void InvalidateCurrentRow(BufferedDataGridView gridView) + private void InvalidateCurrentRow (BufferedDataGridView gridView) { if (gridView.CurrentCellAddress.Y > -1) { @@ -2540,13 +2541,13 @@ private void InvalidateCurrentRow(BufferedDataGridView gridView) } } - private void InvalidateCurrentRow() + private void InvalidateCurrentRow () { InvalidateCurrentRow(dataGridView); InvalidateCurrentRow(filterGridView); } - private void DisplayCurrentFileOnStatusline() + private void DisplayCurrentFileOnStatusline () { if (_logFileReader.IsMultiFile) { @@ -2572,7 +2573,7 @@ private void DisplayCurrentFileOnStatusline() } } - private void UpdateSelectionDisplay() + private void UpdateSelectionDisplay () { if (_noSelectionUpdates) { @@ -2580,7 +2581,7 @@ private void UpdateSelectionDisplay() } } - private void UpdateFilterHistoryFromSettings() + private void UpdateFilterHistoryFromSettings () { ConfigManager.Settings.filterHistoryList = ConfigManager.Settings.filterHistoryList; filterComboBox.Items.Clear(); @@ -2596,40 +2597,40 @@ private void UpdateFilterHistoryFromSettings() } } - private void StatusLineText(string text) + private void StatusLineText (string text) { _statusEventArgs.StatusText = text; SendStatusLineUpdate(); } - private void StatusLineError(string text) + private void StatusLineError (string text) { StatusLineText(text); _isErrorShowing = true; } - private void RemoveStatusLineError() + private void RemoveStatusLineError () { StatusLineText(""); _isErrorShowing = false; } - private void SendGuiStateUpdate() + private void SendGuiStateUpdate () { OnGuiState(_guiStateArgs); } - private void SendProgressBarUpdate() + private void SendProgressBarUpdate () { OnProgressBarUpdate(_progressEventArgs); } - private void SendStatusLineUpdate() + private void SendStatusLineUpdate () { OnStatusLine(_statusEventArgs); } - private void ShowAdvancedFilterPanel(bool show) + private void ShowAdvancedFilterPanel (bool show) { if (show) { @@ -2647,7 +2648,7 @@ private void ShowAdvancedFilterPanel(bool show) _showAdvanced = show; } - private void CheckForAdvancedButtonDirty() + private void CheckForAdvancedButtonDirty () { if (IsAdvancedOptionActive() && !_showAdvanced) { @@ -2659,13 +2660,13 @@ private void CheckForAdvancedButtonDirty() } } - private void FilterToTab() + private void FilterToTab () { filterSearchButton.Enabled = false; Task.Run(() => WriteFilterToTab()); } - private void WriteFilterToTab() + private void WriteFilterToTab () { FilterPipe pipe = new(_filterParams.Clone(), this); lock (_filterResultList) @@ -2685,7 +2686,7 @@ private void WriteFilterToTab() } } - private void WritePipeToTab(FilterPipe pipe, IList lineNumberList, string name, PersistenceData persistenceData) + private void WritePipeToTab (FilterPipe pipe, IList lineNumberList, string name, PersistenceData persistenceData) { _logger.Info("WritePipeToTab(): {0} lines.", lineNumberList.Count); StatusLineText("Writing to temp file... Press ESC to cancel."); @@ -2735,7 +2736,7 @@ private void WritePipeToTab(FilterPipe pipe, IList lineNumberList, string n Invoke(new WriteFilterToTabFinishedFx(WriteFilterToTabFinished), pipe, name, persistenceData); } - private void WriteFilterToTabFinished(FilterPipe pipe, string name, PersistenceData persistenceData) + private void WriteFilterToTabFinished (FilterPipe pipe, string name, PersistenceData persistenceData) { _isSearching = false; if (!_shouldCancel) @@ -2770,7 +2771,7 @@ private void WriteFilterToTabFinished(FilterPipe pipe, string name, PersistenceD /// /// /// - internal void WritePipeTab(IList lineEntryList, string title) + internal void WritePipeTab (IList lineEntryList, string title) { FilterPipe pipe = new(new FilterParams(), this); pipe.IsStopped = true; @@ -2785,7 +2786,7 @@ internal void WritePipeTab(IList lineEntryList, string title) Invoke(new WriteFilterToTabFinishedFx(WriteFilterToTabFinished), [pipe, title, null]); } - private void FilterRestore(LogWindow newWin, PersistenceData persistenceData) + private void FilterRestore (LogWindow newWin, PersistenceData persistenceData) { newWin.WaitForLoadingFinished(); ILogLineColumnizer columnizer = ColumnizerPicker.FindColumnizerByName(persistenceData.columnizerName, @@ -2803,7 +2804,7 @@ private void FilterRestore(LogWindow newWin, PersistenceData persistenceData) newWin.BeginInvoke(new RestoreFiltersFx(newWin.RestoreFilters), [persistenceData]); } - private void ProcessFilterPipes(int lineNum) + private void ProcessFilterPipes (int lineNum) { ILogLine searchLine = _logFileReader.GetLogLine(lineNum); if (searchLine == null) @@ -2859,7 +2860,7 @@ private void ProcessFilterPipes(int lineNum) } } - private void CopyMarkedLinesToClipboard() + private void CopyMarkedLinesToClipboard () { if (_guiStateArgs.CellSelectMode) { @@ -2903,12 +2904,12 @@ private void CopyMarkedLinesToClipboard() /// Set an Encoding which shall be used when loading a file. Used before a file is loaded. /// /// - private void SetExplicitEncoding(Encoding encoding) + private void SetExplicitEncoding (Encoding encoding) { EncodingOptions.Encoding = encoding; } - private void ApplyDataGridViewPrefs(BufferedDataGridView dataGridView, Preferences prefs) + private void ApplyDataGridViewPrefs (BufferedDataGridView dataGridView, Preferences prefs) { if (dataGridView.Columns.GetColumnCount(DataGridViewElementStates.None) > 1) { @@ -2935,7 +2936,7 @@ private void ApplyDataGridViewPrefs(BufferedDataGridView dataGridView, Preferenc AutoResizeColumns(dataGridView); } - private IList GetSelectedContent() + private IList GetSelectedContent () { if (dataGridView.SelectionMode == DataGridViewSelectionMode.FullRowSelect) { @@ -2960,7 +2961,7 @@ private IList GetSelectedContent() * Timestamp stuff * =======================================================================*/ - private void SetTimestampLimits() + private void SetTimestampLimits () { if (!CurrentColumnizer.IsTimeshiftImplemented()) { @@ -2974,7 +2975,7 @@ private void SetTimestampLimits() SendGuiStateUpdate(); } - private void AdjustHighlightSplitterWidth() + private void AdjustHighlightSplitterWidth () { //int size = this.editHighlightsSplitContainer.Panel2Collapsed ? 600 : 660; //int distance = this.highlightSplitContainer.Width - size; @@ -2983,7 +2984,7 @@ private void AdjustHighlightSplitterWidth() //this.highlightSplitContainer.SplitterDistance = distance; } - private void BookmarkComment(Bookmark bookmark) + private void BookmarkComment (Bookmark bookmark) { BookmarkCommentDlg dlg = new(); dlg.Comment = bookmark.Text; @@ -3000,7 +3001,7 @@ private void BookmarkComment(Bookmark bookmark) /// /// /// - private string CalculateColumnNames(FilterParams filter) + private string CalculateColumnNames (FilterParams filter) { string names = string.Empty; @@ -3024,7 +3025,7 @@ private string CalculateColumnNames(FilterParams filter) return names; } - private void ApplyFrozenState(BufferedDataGridView gridView) + private void ApplyFrozenState (BufferedDataGridView gridView) { SortedDictionary dict = []; foreach (DataGridViewColumn col in gridView.Columns) @@ -3043,7 +3044,7 @@ private void ApplyFrozenState(BufferedDataGridView gridView) } } - private void ShowTimeSpread(bool show) + private void ShowTimeSpread (bool show) { if (show) { @@ -3057,12 +3058,12 @@ private void ShowTimeSpread(bool show) _timeSpreadCalc.Enabled = show; } - protected internal void AddTempFileTab(string fileName, string title) + protected internal void AddTempFileTab (string fileName, string title) { _parentLogTabWin.AddTempFileTab(fileName, title); } - private void InitPatternWindow() + private void InitPatternWindow () { //PatternStatistic(this.patternArgs); _patternWindow = new PatternWindow(this); @@ -3076,7 +3077,7 @@ private void InitPatternWindow() //this.patternWindow.Show(); } - private void TestStatistic(PatternArgs patternArgs) + private void TestStatistic (PatternArgs patternArgs) { int beginLine = patternArgs.StartLine; _logger.Info("TestStatistics() called with start line {0}", beginLine); @@ -3169,7 +3170,7 @@ private void TestStatistic(PatternArgs patternArgs) _logger.Info("TestStatistics() ended"); } - private void addBlockTargetLinesToDict(Dictionary dict, PatternBlock block) + private void addBlockTargetLinesToDict (Dictionary dict, PatternBlock block) { foreach (int lineNum in block.targetLines.Keys) { @@ -3181,7 +3182,7 @@ private void addBlockTargetLinesToDict(Dictionary dict, PatternBlock b } //Well keep this for the moment because there is some other commented code which calls this one - private PatternBlock FindExistingBlock(PatternBlock block, List blockList) + private PatternBlock FindExistingBlock (PatternBlock block, List blockList) { foreach (PatternBlock searchBlock in blockList) { @@ -3200,7 +3201,7 @@ private PatternBlock FindExistingBlock(PatternBlock block, List bl return null; } - private PatternBlock DetectBlock(int startNum, int startLineToSearch, int maxBlockLen, int maxDiffInBlock, + private PatternBlock DetectBlock (int startNum, int startLineToSearch, int maxBlockLen, int maxDiffInBlock, int maxMisses, Dictionary processedLinesDict) { int targetLine = FindSimilarLine(startNum, startLineToSearch, processedLinesDict); @@ -3282,7 +3283,7 @@ private PatternBlock DetectBlock(int startNum, int startLineToSearch, int maxBlo return block; } - private void PrepareDict() + private void PrepareDict () { _lineHashList.Clear(); Regex regex = new("\\d"); @@ -3327,7 +3328,7 @@ private void PrepareDict() } } - private int _FindSimilarLine(int srcLine, int startLine) + private int _FindSimilarLine (int srcLine, int startLine) { int value = _lineHashList[srcLine]; @@ -3345,7 +3346,7 @@ private int _FindSimilarLine(int srcLine, int startLine) // int[,] similarCache; - private void ResetCache(int num) + private void ResetCache (int num) { //this.similarCache = new int[num, num]; //for (int i = 0; i < num; ++i) @@ -3357,7 +3358,7 @@ private void ResetCache(int num) //} } - private int FindSimilarLine(int srcLine, int startLine, Dictionary processedLinesDict) + private int FindSimilarLine (int srcLine, int startLine, Dictionary processedLinesDict) { int threshold = _patternArgs.Fuzzy; @@ -3421,7 +3422,7 @@ private int FindSimilarLine(int srcLine, int startLine, Dictionary pro return -1; } - private string GetMsgForLine(int i) + private string GetMsgForLine (int i) { ILogLine line = _logFileReader.GetLogLine(i); ILogLineColumnizer columnizer = CurrentColumnizer; @@ -3430,7 +3431,7 @@ private string GetMsgForLine(int i) return cols.ColumnValues.Last().FullValue; } - private void ChangeRowHeight(bool decrease) + private void ChangeRowHeight (bool decrease) { int rowNum = dataGridView.CurrentCellAddress.Y; if (rowNum < 0 || rowNum >= dataGridView.RowCount) @@ -3481,7 +3482,7 @@ private void ChangeRowHeight(bool decrease) dataGridView.Refresh(); } - private int GetRowHeight(int rowNum) + private int GetRowHeight (int rowNum) { if (_rowHeightList.ContainsKey(rowNum)) { @@ -3493,7 +3494,7 @@ private int GetRowHeight(int rowNum) } } - private void AddBookmarkAtLineSilently(int lineNum) + private void AddBookmarkAtLineSilently (int lineNum) { if (!_bookmarkProvider.IsBookmarkAtLine(lineNum)) { @@ -3501,7 +3502,7 @@ private void AddBookmarkAtLineSilently(int lineNum) } } - private void AddBookmarkAndEditComment() + private void AddBookmarkAndEditComment () { int lineNum = dataGridView.CurrentCellAddress.Y; if (!_bookmarkProvider.IsBookmarkAtLine(lineNum)) @@ -3512,7 +3513,7 @@ private void AddBookmarkAndEditComment() BookmarkComment(_bookmarkProvider.GetBookmarkForLine(lineNum)); } - private void AddBookmarkComment(string text) + private void AddBookmarkComment (string text) { int lineNum = dataGridView.CurrentCellAddress.Y; Bookmark bookmark; @@ -3531,7 +3532,7 @@ private void AddBookmarkComment(string text) OnBookmarkTextChanged(bookmark); } - private void MarkCurrentFilterRange() + private void MarkCurrentFilterRange () { _filterParams.RangeSearchText = filterRangeComboBox.Text; ColumnizerCallback callback = new(this); @@ -3551,7 +3552,7 @@ private void MarkCurrentFilterRange() } } - private void RemoveTempHighlights() + private void RemoveTempHighlights () { lock (_tempHighlightEntryListLock) { @@ -3561,7 +3562,7 @@ private void RemoveTempHighlights() RefreshAllGrids(); } - private void ToggleHighlightPanel(bool open) + private void ToggleHighlightPanel (bool open) { highlightSplitContainer.Panel2Collapsed = !open; btnToggleHighlightPanel.Image = open @@ -3569,7 +3570,7 @@ private void ToggleHighlightPanel(bool open) : new Bitmap(_panelOpenButtonImage, new Size(btnToggleHighlightPanel.Size.Height, btnToggleHighlightPanel.Size.Height)); } - private void SetBookmarksForSelectedFilterLines() + private void SetBookmarksForSelectedFilterLines () { lock (_filterResultList) { @@ -3585,7 +3586,7 @@ private void SetBookmarksForSelectedFilterLines() OnBookmarkAdded(); } - private void SetDefaultHighlightGroup() + private void SetDefaultHighlightGroup () { HighlightGroup group = _parentLogTabWin.FindHighlightGroupByFileMask(FileName); if (group != null) @@ -3598,14 +3599,14 @@ private void SetDefaultHighlightGroup() } } - private void HandleChangedFilterOnLoadSetting() + private void HandleChangedFilterOnLoadSetting () { _parentLogTabWin.Preferences.isFilterOnLoad = filterOnLoadCheckBox.Checked; _parentLogTabWin.Preferences.isAutoHideFilterList = hideFilterListOnLoadCheckBox.Checked; OnFilterListChanged(this); } - private void FireCancelHandlers() + private void FireCancelHandlers () { lock (_cancelHandlerList) { @@ -3616,7 +3617,7 @@ private void FireCancelHandlers() } } - private void SyncOtherWindows(DateTime timestamp) + private void SyncOtherWindows (DateTime timestamp) { lock (_timeSyncListLock) { @@ -3624,7 +3625,7 @@ private void SyncOtherWindows(DateTime timestamp) } } - private void AddSlaveToTimesync(LogWindow slave) + private void AddSlaveToTimesync (LogWindow slave) { lock (_timeSyncListLock) { @@ -3656,17 +3657,17 @@ private void AddSlaveToTimesync(LogWindow slave) OnSyncModeChanged(); } - private void FreeSlaveFromTimesync(LogWindow slave) + private void FreeSlaveFromTimesync (LogWindow slave) { slave.FreeFromTimeSync(); } - private void OnSyncModeChanged() + private void OnSyncModeChanged () { SyncModeChanged?.Invoke(this, new SyncModeEventArgs(IsTimeSynced)); } - private void AddSearchHitHighlightEntry(SearchParams para) + private void AddSearchHitHighlightEntry (SearchParams para) { HighlightEntry he = new() { @@ -3692,7 +3693,7 @@ private void AddSearchHitHighlightEntry(SearchParams para) RefreshAllGrids(); } - private void RemoveAllSearchHighlightEntries() + private void RemoveAllSearchHighlightEntries () { lock (_tempHighlightEntryListLock) { @@ -3711,7 +3712,7 @@ private void RemoveAllSearchHighlightEntries() RefreshAllGrids(); } - private DataGridViewColumn GetColumnByName(BufferedDataGridView dataGridView, string name) + private DataGridViewColumn GetColumnByName (BufferedDataGridView dataGridView, string name) { foreach (DataGridViewColumn col in dataGridView.Columns) { @@ -3724,7 +3725,7 @@ private DataGridViewColumn GetColumnByName(BufferedDataGridView dataGridView, st return null; } - private void SelectColumn() + private void SelectColumn () { string colName = columnComboBox.SelectedItem as string; DataGridViewColumn col = GetColumnByName(dataGridView, colName);