@@ -268,15 +268,15 @@ private void UpdateProgressBar()
268268 }
269269 }
270270
271- private void SetWindowTitle ( List < string > path )
271+ private void SetWindowTitle ( IReadOnlyList < string > path )
272272 {
273273 var startTime = DateTime . Now . ToString ( CultureInfo . CurrentCulture ) ;
274274 txtStart . Text = startTime ;
275275 txtPath . Text = path [ 0 ] ;
276276 Text = $ "{ path [ 0 ] } { startTime } ";
277277 }
278278
279- private List < string > GetPath ( string type , string owner , string name , string procedure )
279+ private static List < string > GetPath ( string type , string owner , string name , string procedure )
280280 {
281281 switch ( type )
282282 {
@@ -394,21 +394,19 @@ private void UpdateTestResult(@event @event)
394394
395395 dataTableTestResult . AcceptChanges ( ) ;
396396
397- int i = 0 ;
397+ var rowIndex = 0 ;
398398 foreach ( DataGridViewRow gridRow in gridResults . Rows )
399399 {
400- if ( gridRow . DataBoundItem is DataRowView )
400+ if ( gridRow . DataBoundItem is DataRowView rowTestResult )
401401 {
402- var rowTestResult = ( DataRowView ) gridRow . DataBoundItem ;
403-
404402 if ( rowTestResult [ "Id" ] . ToString ( ) . Equals ( @event . test . id ) )
405403 {
406- gridResults . FirstDisplayedScrollingRowIndex = i ;
407- gridResults . Rows [ i ] . Selected = true ;
404+ gridResults . FirstDisplayedScrollingRowIndex = rowIndex ;
405+ gridResults . Rows [ rowIndex ] . Selected = true ;
408406
409407 break ;
410408 }
411- i ++ ;
409+ rowIndex ++ ;
412410 }
413411 }
414412 }
@@ -539,10 +537,8 @@ private void gridResults_SelectionChanged(object sender, EventArgs e)
539537 {
540538 var row = gridResults . SelectedRows [ 0 ] ;
541539
542- if ( row . DataBoundItem is DataRowView )
540+ if ( row . DataBoundItem is DataRowView rowTestResult )
543541 {
544- var rowTestResult = ( DataRowView ) row . DataBoundItem ;
545-
546542 txtTestOwner . Text = "" + rowTestResult . Row [ "Owner" ] ;
547543 txtTestPackage . Text = "" + rowTestResult . Row [ "Package" ] ;
548544 txtTestProcuedure . Text = "" + rowTestResult . Row [ "Procedure" ] ;
@@ -600,7 +596,7 @@ private void invokeOpenPackageBody(DataGridViewCellEventArgs e)
600596 var rowTestResult = dataTableTestResult . Rows [ e . RowIndex ] ;
601597
602598 var methodInfo = pluginIntegration . GetType ( ) . GetMethod ( "OpenPackageBody" ) ;
603- methodInfo . Invoke ( pluginIntegration , new object [ ] { rowTestResult [ "Owner" ] , rowTestResult [ "Package" ] } ) ;
599+ methodInfo . Invoke ( pluginIntegration , new [ ] { rowTestResult [ "Owner" ] , rowTestResult [ "Package" ] } ) ;
604600 }
605601
606602 private void gridResults_CellContextMenuStripNeeded ( object sender , DataGridViewCellContextMenuStripNeededEventArgs e )
0 commit comments