@@ -81,8 +81,10 @@ public void LoadFile(string fileName, EncodingOptions encodingOptions)
8181
8282 try
8383 {
84- _logFileReader = new LogfileReader ( fileName , EncodingOptions , IsMultiFile , Preferences . bufferCount , Preferences . linesPerBuffer , _multiFileOptions ) ;
85- _logFileReader . UseNewReader = ! Preferences . useLegacyReader ;
84+ _logFileReader = new LogfileReader ( fileName , EncodingOptions , IsMultiFile , Preferences . bufferCount , Preferences . linesPerBuffer , _multiFileOptions )
85+ {
86+ UseNewReader = ! Preferences . useLegacyReader
87+ } ;
8688 }
8789 catch ( LogFileException lfe )
8890 {
@@ -154,8 +156,10 @@ public void LoadFilesAsMulti(string[] fileNames, EncodingOptions encodingOptions
154156 EncodingOptions = encodingOptions ;
155157 _columnCache = new ColumnCache ( ) ;
156158
157- _logFileReader = new LogfileReader ( fileNames , EncodingOptions , Preferences . bufferCount , Preferences . linesPerBuffer , _multiFileOptions ) ;
158- _logFileReader . UseNewReader = ! Preferences . useLegacyReader ;
159+ _logFileReader = new LogfileReader ( fileNames , EncodingOptions , Preferences . bufferCount , Preferences . linesPerBuffer , _multiFileOptions )
160+ {
161+ UseNewReader = ! Preferences . useLegacyReader
162+ } ;
159163 RegisterLogFileReaderEvents ( ) ;
160164 _logFileReader . StartMonitoring ( ) ;
161165 FileName = fileNames [ ^ 1 ] ;
@@ -207,23 +211,25 @@ public string SavePersistenceData(bool force)
207211
208212 public PersistenceData GetPersistenceData ( )
209213 {
210- PersistenceData persistenceData = new ( ) ;
211- persistenceData . bookmarkList = _bookmarkProvider . BookmarkList ;
212- persistenceData . rowHeightList = _rowHeightList ;
213- persistenceData . multiFile = IsMultiFile ;
214- persistenceData . multiFilePattern = _multiFileOptions . FormatPattern ;
215- persistenceData . multiFileMaxDays = _multiFileOptions . MaxDayTry ;
216- persistenceData . currentLine = dataGridView . CurrentCellAddress . Y ;
217- persistenceData . firstDisplayedLine = dataGridView . FirstDisplayedScrollingRowIndex ;
218- persistenceData . filterVisible = ! splitContainerLogWindow . Panel2Collapsed ;
219- persistenceData . filterAdvanced = ! advancedFilterSplitContainer . Panel1Collapsed ;
220- persistenceData . filterPosition = splitContainerLogWindow . SplitterDistance ;
221- persistenceData . followTail = _guiStateArgs . FollowTail ;
222- persistenceData . fileName = FileName ;
223- persistenceData . tabName = Text ;
224- persistenceData . sessionFileName = SessionFileName ;
225- persistenceData . columnizerName = CurrentColumnizer . GetName ( ) ;
226- persistenceData . lineCount = _logFileReader . LineCount ;
214+ PersistenceData persistenceData = new ( )
215+ {
216+ bookmarkList = _bookmarkProvider . BookmarkList ,
217+ rowHeightList = _rowHeightList ,
218+ multiFile = IsMultiFile ,
219+ multiFilePattern = _multiFileOptions . FormatPattern ,
220+ multiFileMaxDays = _multiFileOptions . MaxDayTry ,
221+ currentLine = dataGridView . CurrentCellAddress . Y ,
222+ firstDisplayedLine = dataGridView . FirstDisplayedScrollingRowIndex ,
223+ filterVisible = ! splitContainerLogWindow . Panel2Collapsed ,
224+ filterAdvanced = ! advancedFilterSplitContainer . Panel1Collapsed ,
225+ filterPosition = splitContainerLogWindow . SplitterDistance ,
226+ followTail = _guiStateArgs . FollowTail ,
227+ fileName = FileName ,
228+ tabName = Text ,
229+ sessionFileName = SessionFileName ,
230+ columnizerName = CurrentColumnizer . GetName ( ) ,
231+ lineCount = _logFileReader . LineCount
232+ } ;
227233 _filterParams . isFilterTail = filterTailCheckBox . Checked ; // this option doesnt need a press on 'search'
228234
229235 if ( Preferences . saveFilters )
@@ -233,9 +239,11 @@ public PersistenceData GetPersistenceData()
233239
234240 foreach ( FilterPipe filterPipe in _filterPipeList )
235241 {
236- FilterTabData data = new ( ) ;
237- data . persistenceData = filterPipe . OwnLogWindow . GetPersistenceData ( ) ;
238- data . filterParams = filterPipe . FilterParams ;
242+ FilterTabData data = new ( )
243+ {
244+ persistenceData = filterPipe . OwnLogWindow . GetPersistenceData ( ) ,
245+ filterParams = filterPipe . FilterParams
246+ } ;
239247 persistenceData . filterTabDataList . Add ( data ) ;
240248 }
241249 }
@@ -467,9 +475,11 @@ public void CellPainting(DataGridView gridView, int rowIndex, DataGridViewCellPa
467475
468476 if ( bookmark . Text . Length > 0 )
469477 {
470- StringFormat format = new ( ) ;
471- format . LineAlignment = StringAlignment . Center ;
472- format . Alignment = StringAlignment . Center ;
478+ StringFormat format = new ( )
479+ {
480+ LineAlignment = StringAlignment . Center ,
481+ Alignment = StringAlignment . Center
482+ } ;
473483 Brush brush2 = new SolidBrush ( Color . FromArgb ( 255 , 190 , 100 , 0 ) ) ;
474484 Font font = new ( "Courier New" , Preferences . fontSize , FontStyle . Bold ) ;
475485 e . Graphics . DrawString ( "i" , font , brush2 , new RectangleF ( r . Left , r . Top , r . Width , r . Height ) ,
@@ -916,7 +926,7 @@ public void SetBookmarkFromTrigger(int lineNum, string comment)
916926 {
917927 return ;
918928 }
919- ParamParser paramParser = new ParamParser ( comment ) ;
929+ ParamParser paramParser = new ( comment ) ;
920930 try
921931 {
922932 comment = paramParser . ReplaceParams ( line , lineNum , FileName ) ;
@@ -1160,26 +1170,31 @@ public void CopyMarkedLinesToTab()
11601170 {
11611171 if ( dataGridView . SelectionMode == DataGridViewSelectionMode . FullRowSelect )
11621172 {
1163- List < int > lineNumList = new List < int > ( ) ;
1173+ List < int > lineNumList = [ ] ;
1174+
11641175 foreach ( DataGridViewRow row in dataGridView . SelectedRows )
11651176 {
11661177 if ( row . Index != - 1 )
11671178 {
11681179 lineNumList . Add ( row . Index ) ;
11691180 }
11701181 }
1182+
11711183 lineNumList . Sort ( ) ;
11721184 // create dummy FilterPipe for connecting line numbers to original window
11731185 // setting IsStopped to true prevents further filter processing
1174- FilterPipe pipe = new FilterPipe ( new FilterParams ( ) , this ) ;
1175- pipe . IsStopped = true ;
1186+ FilterPipe pipe = new ( new FilterParams ( ) , this )
1187+ {
1188+ IsStopped = true
1189+ } ;
1190+
11761191 WritePipeToTab ( pipe , lineNumList , Text + "->C" , null ) ;
11771192 }
11781193 else
11791194 {
11801195 string fileName = Path . GetTempFileName ( ) ;
1181- FileStream fStream = new FileStream ( fileName , FileMode . Append , FileAccess . Write , FileShare . Read ) ;
1182- StreamWriter writer = new StreamWriter ( fStream , Encoding . Unicode ) ;
1196+ FileStream fStream = new ( fileName , FileMode . Append , FileAccess . Write , FileShare . Read ) ;
1197+ StreamWriter writer = new ( fStream , Encoding . Unicode ) ;
11831198
11841199 DataObject data = dataGridView . GetClipboardContent ( ) ;
11851200 string text = data . GetText ( TextDataFormat . Text ) ;
@@ -1199,6 +1214,7 @@ public void ChangeEncoding(Encoding encoding)
11991214 {
12001215 _logFileReader . ChangeEncoding ( encoding ) ;
12011216 EncodingOptions . Encoding = encoding ;
1217+
12021218 if ( _guiStateArgs . CurrentEncoding . IsSingleByte != encoding . IsSingleByte ||
12031219 _guiStateArgs . CurrentEncoding . GetPreamble ( ) . Length != encoding . GetPreamble ( ) . Length )
12041220 {
@@ -1216,9 +1232,11 @@ public void Reload()
12161232 {
12171233 SavePersistenceData ( false ) ;
12181234
1219- _reloadMemento = new ReloadMemento ( ) ;
1220- _reloadMemento . currentLine = dataGridView . CurrentCellAddress . Y ;
1221- _reloadMemento . firstDisplayedLine = dataGridView . FirstDisplayedScrollingRowIndex ;
1235+ _reloadMemento = new ReloadMemento
1236+ {
1237+ currentLine = dataGridView . CurrentCellAddress . Y ,
1238+ firstDisplayedLine = dataGridView . FirstDisplayedScrollingRowIndex
1239+ } ;
12221240 _forcedColumnizerForLoading = CurrentColumnizer ;
12231241
12241242 if ( _fileNames == null || ! IsMultiFile )
@@ -1587,7 +1605,7 @@ public void PatternStatisticSelectRange(PatternArgs patternArgs)
15871605 {
15881606 if ( dataGridView . SelectionMode == DataGridViewSelectionMode . FullRowSelect )
15891607 {
1590- List < int > lineNumList = new List < int > ( ) ;
1608+ List < int > lineNumList = new ( ) ;
15911609 foreach ( DataGridViewRow row in dataGridView . SelectedRows )
15921610 {
15931611 if ( row . Index != - 1 )
@@ -1615,19 +1633,21 @@ public void PatternStatisticSelectRange(PatternArgs patternArgs)
16151633
16161634 public void PatternStatistic ( PatternArgs patternArgs )
16171635 {
1618- PatternStatisticFx fx = new PatternStatisticFx ( TestStatistic ) ;
1636+ PatternStatisticFx fx = new ( TestStatistic ) ;
16191637 fx . BeginInvoke ( patternArgs , null , null ) ;
16201638 }
16211639
16221640 public void ExportBookmarkList ( )
16231641 {
1624- SaveFileDialog dlg = new SaveFileDialog ( ) ;
1625- dlg . Title = "Choose a file to save bookmarks into" ;
1626- dlg . AddExtension = true ;
1627- dlg . DefaultExt = "csv" ;
1628- dlg . Filter = "CSV file (*.csv)|*.csv|Bookmark file (*.bmk)|*.bmk" ;
1629- dlg . FilterIndex = 1 ;
1630- dlg . FileName = Path . GetFileNameWithoutExtension ( FileName ) ;
1642+ SaveFileDialog dlg = new ( )
1643+ {
1644+ Title = "Choose a file to save bookmarks into" ,
1645+ AddExtension = true ,
1646+ DefaultExt = "csv" ,
1647+ Filter = "CSV file (*.csv)|*.csv|Bookmark file (*.bmk)|*.bmk" ,
1648+ FilterIndex = 1 ,
1649+ FileName = Path . GetFileNameWithoutExtension ( FileName )
1650+ } ;
16311651 if ( dlg . ShowDialog ( ) == DialogResult . OK )
16321652 {
16331653 try
@@ -1645,10 +1665,12 @@ public void ExportBookmarkList()
16451665
16461666 public void ImportBookmarkList ( )
16471667 {
1648- OpenFileDialog dlg = new OpenFileDialog ( ) ;
1649- dlg . Title = "Choose a file to load bookmarks from" ;
1650- dlg . AddExtension = true ;
1651- dlg . DefaultExt = "csv" ;
1668+ OpenFileDialog dlg = new ( )
1669+ {
1670+ Title = "Choose a file to load bookmarks from" ,
1671+ AddExtension = true ,
1672+ DefaultExt = "csv"
1673+ } ;
16521674 dlg . DefaultExt = "csv" ;
16531675 dlg . Filter = "CSV file (*.csv)|*.csv|Bookmark file (*.bmk)|*.bmk" ;
16541676 dlg . FilterIndex = 1 ;
@@ -1658,7 +1680,7 @@ public void ImportBookmarkList()
16581680 try
16591681 {
16601682 // add to the existing bookmarks
1661- SortedList < int , Bookmark > newBookmarks = new SortedList < int , Bookmark > ( ) ;
1683+ SortedList < int , Bookmark > newBookmarks = new ( ) ;
16621684 BookmarkExporter . ImportBookmarkList ( FileName , dlg . FileName , newBookmarks ) ;
16631685
16641686 // Add (or replace) to existing bookmark list
0 commit comments