@@ -372,28 +372,9 @@ private void PerformDNSLookupHostnameAction()
372
372
373
373
private void CustomCommandAction ( object guid )
374
374
{
375
- Debug . WriteLine ( guid . ToString ( ) ) ;
376
-
377
- if ( guid is Guid id )
378
- {
379
- CustomCommandInfo info = ( CustomCommandInfo ) CustomCommands . FirstOrDefault ( x => x . ID == id ) . Clone ( ) ;
380
-
381
- if ( info == null )
382
- return ; // ToDo: Log and error message
383
-
384
- // Replace vars
385
- string hostname = ! string . IsNullOrEmpty ( SelectedHostResult . Hostname ) ? SelectedHostResult . Hostname . TrimEnd ( '.' ) : "" ;
386
- string ipAddress = SelectedHostResult . PingInfo . IPAddress . ToString ( ) ;
387
-
388
- info . FilePath = Regex . Replace ( info . FilePath , "\\ $\\ $hostname\\ $\\ $" , hostname , RegexOptions . IgnoreCase ) ;
389
- info . FilePath = Regex . Replace ( info . FilePath , "\\ $\\ $ipaddress\\ $\\ $" , ipAddress , RegexOptions . IgnoreCase ) ;
390
- info . Arguments = Regex . Replace ( info . Arguments , "\\ $\\ $hostname\\ $\\ $" , hostname , RegexOptions . IgnoreCase ) ;
391
- info . Arguments = Regex . Replace ( info . Arguments , "\\ $\\ $ipaddress\\ $\\ $" , ipAddress , RegexOptions . IgnoreCase ) ;
392
-
393
- CustomCommand . Run ( info ) ;
394
- }
375
+ CustomCommand ( guid ) ;
395
376
}
396
-
377
+
397
378
public ICommand AddProfileSelectedHostCommand => new RelayCommand ( p => AddProfileSelectedHostAction ( ) ) ;
398
379
private async void AddProfileSelectedHostAction ( )
399
380
{
@@ -609,6 +590,28 @@ private void ScanFinished()
609
590
IsScanRunning = false ;
610
591
}
611
592
593
+ private void CustomCommand ( object guid )
594
+ {
595
+ if ( guid is Guid id )
596
+ {
597
+ CustomCommandInfo info = ( CustomCommandInfo ) CustomCommands . FirstOrDefault ( x => x . ID == id ) . Clone ( ) ;
598
+
599
+ if ( info == null )
600
+ return ; // ToDo: Log and error message
601
+
602
+ // Replace vars
603
+ string hostname = ! string . IsNullOrEmpty ( SelectedHostResult . Hostname ) ? SelectedHostResult . Hostname . TrimEnd ( '.' ) : "" ;
604
+ string ipAddress = SelectedHostResult . PingInfo . IPAddress . ToString ( ) ;
605
+
606
+ info . FilePath = Regex . Replace ( info . FilePath , "\\ $\\ $hostname\\ $\\ $" , hostname , RegexOptions . IgnoreCase ) ;
607
+ info . FilePath = Regex . Replace ( info . FilePath , "\\ $\\ $ipaddress\\ $\\ $" , ipAddress , RegexOptions . IgnoreCase ) ;
608
+ info . Arguments = Regex . Replace ( info . Arguments , "\\ $\\ $hostname\\ $\\ $" , hostname , RegexOptions . IgnoreCase ) ;
609
+ info . Arguments = Regex . Replace ( info . Arguments , "\\ $\\ $ipaddress\\ $\\ $" , ipAddress , RegexOptions . IgnoreCase ) ;
610
+
611
+ Utilities . CustomCommand . Run ( info ) ;
612
+ }
613
+ }
614
+
612
615
private void AddHostToHistory ( string ipRange )
613
616
{
614
617
// Create the new list
0 commit comments