@@ -132,6 +132,11 @@ private void lvDetail_ColumnClick(object sender, ColumnClickEventArgs e)
132132
133133 RefreshDetailSub ( e . Column ) ;
134134 }
135+
136+ private void lvDetail_DoubleClick ( object sender , EventArgs e )
137+ {
138+ SetActiveProxy ( ) ;
139+ }
135140 #endregion
136141
137142
@@ -442,13 +447,42 @@ public void ProxiesReload()
442447 lvProxies . Focus ( ) ;
443448 }
444449
445- public void ProxiesDelayTest ( )
450+ public void ProxiesDelayTest ( bool blAll = true )
446451 {
447- MainFormHandler . Instance . ClashProxiesDelayTest ( it =>
452+ if ( blAll )
448453 {
449- _updateFunc ( false , "Clash Proxies Delay Test" ) ;
450- GetClashProxies ( true ) ;
451- } ) ;
454+ MainFormHandler . Instance . ClashProxiesDelayTest ( it =>
455+ {
456+ _updateFunc ( false , "Clash Proxies Latency Test" ) ;
457+ GetClashProxies ( true ) ;
458+ } ) ;
459+ }
460+ else
461+ {
462+ if ( lstDetail == null )
463+ {
464+ return ;
465+ }
466+ _updateFunc ( false , "Clash Proxies Part Latency Test" ) ;
467+
468+ MainFormHandler . Instance . ClashProxiesDelayTestPart ( lstDetail , ( item , result ) =>
469+ {
470+ _updateFunc ( false , $ "{ item . name } ={ result } ") ;
471+
472+ var dicResult = Utils . FromJson < Dictionary < string , object > > ( result ) ;
473+ if ( dicResult . ContainsKey ( "delay" ) )
474+ {
475+ int k = lstDetail . FindIndex ( it => it . name == item . name ) ;
476+ if ( k >= 0 && k < lvDetail . Items . Count )
477+ {
478+ lvDetail . BeginInvoke ( new Action ( ( ) =>
479+ {
480+ lvDetail . Items [ k ] . SubItems [ "testResult" ] . Text = $ "{ dicResult [ "delay" ] } ms";
481+ } ) ) ;
482+ }
483+ }
484+ } ) ;
485+ }
452486 }
453487 public void ProxiesSelectActivity ( )
454488 {
@@ -490,6 +524,11 @@ private void tsbProxiesSelectActivity_Click(object sender, EventArgs e)
490524 ProxiesSelectActivity ( ) ;
491525 }
492526
527+ private void tsbProxiesSpeedtestPart_Click ( object sender , EventArgs e )
528+ {
529+ ProxiesDelayTest ( false ) ;
530+ }
531+
493532 #endregion
494533
495534 #region task
@@ -524,5 +563,6 @@ public void DelayTestTask()
524563 }
525564
526565 #endregion
566+
527567 }
528568}
0 commit comments