1
- using System ;
1
+ using log4net ;
2
+ using MahApps . Metro . Controls . Dialogs ;
3
+ using NETworkManager . Controls ;
4
+ using NETworkManager . Documentation ;
5
+ using NETworkManager . Localization ;
6
+ using NETworkManager . Localization . Resources ;
7
+ using NETworkManager . Models ;
8
+ using NETworkManager . Models . AWS ;
9
+ using NETworkManager . Models . EventSystem ;
10
+ using NETworkManager . Models . Network ;
11
+ using NETworkManager . Models . PowerShell ;
12
+ using NETworkManager . Models . PuTTY ;
13
+ using NETworkManager . Profiles ;
14
+ using NETworkManager . Settings ;
15
+ using NETworkManager . Update ;
16
+ using NETworkManager . Utilities ;
17
+ using NETworkManager . ViewModels ;
18
+ using NETworkManager . Views ;
19
+ using System ;
2
20
using System . Collections . Generic ;
3
21
using System . Collections . ObjectModel ;
4
22
using System . ComponentModel ;
19
37
using System . Windows . Interop ;
20
38
using System . Windows . Markup ;
21
39
using System . Windows . Threading ;
22
- using log4net ;
23
- using MahApps . Metro . Controls . Dialogs ;
24
- using NETworkManager . Controls ;
25
- using NETworkManager . Documentation ;
26
- using NETworkManager . Localization ;
27
- using NETworkManager . Localization . Resources ;
28
- using NETworkManager . Models ;
29
- using NETworkManager . Models . AWS ;
30
- using NETworkManager . Models . EventSystem ;
31
- using NETworkManager . Models . Network ;
32
- using NETworkManager . Models . PowerShell ;
33
- using NETworkManager . Models . PuTTY ;
34
- using NETworkManager . Profiles ;
35
- using NETworkManager . Settings ;
36
- using NETworkManager . Update ;
37
- using NETworkManager . Utilities ;
38
- using NETworkManager . ViewModels ;
39
- using NETworkManager . Views ;
40
40
using Application = System . Windows . Application ;
41
41
using ContextMenu = System . Windows . Controls . ContextMenu ;
42
42
using MouseEventArgs = System . Windows . Forms . MouseEventArgs ;
@@ -329,21 +329,6 @@ public bool FlyoutRunCommandIsOpen
329
329
}
330
330
}
331
331
332
- private bool _flyoutRunCommandAreAnimationsEnabled ;
333
-
334
- public bool FlyoutRunCommandAreAnimationsEnabled
335
- {
336
- get => _flyoutRunCommandAreAnimationsEnabled ;
337
- set
338
- {
339
- if ( value == _flyoutRunCommandAreAnimationsEnabled )
340
- return ;
341
-
342
- _flyoutRunCommandAreAnimationsEnabled = value ;
343
- OnPropertyChanged ( ) ;
344
- }
345
- }
346
-
347
332
private bool _isRestartRequired ;
348
333
349
334
public bool IsRestartRequired
@@ -701,7 +686,7 @@ private void LoadApplicationList()
701
686
// Select the application
702
687
// Set application via command line, or select the default one, fallback to the first visible one
703
688
var applicationList = Applications . Cast < ApplicationInfo > ( ) . ToArray ( ) ;
704
-
689
+
705
690
if ( CommandLineManager . Current . Application != ApplicationName . None )
706
691
SelectedApplication = applicationList . FirstOrDefault ( x => x . Name == CommandLineManager . Current . Application ) ;
707
692
else
@@ -1244,7 +1229,6 @@ private void OpenRunAction()
1244
1229
{
1245
1230
ConfigurationManager . OnDialogOpen ( ) ;
1246
1231
1247
- FlyoutRunCommandAreAnimationsEnabled = true ;
1248
1232
FlyoutRunCommandIsOpen = true ;
1249
1233
}
1250
1234
@@ -1259,7 +1243,7 @@ private void RunCommandDoAction()
1259
1243
1260
1244
private void RunCommandCloseAction ( )
1261
1245
{
1262
- RunCommandFlyoutClose ( ) . ConfigureAwait ( false ) ;
1246
+ RunCommandFlyoutClose ( ) ;
1263
1247
}
1264
1248
1265
1249
#endregion
@@ -1321,28 +1305,24 @@ private void RunCommandDo()
1321
1305
}
1322
1306
1323
1307
// Close the flyout
1324
- RunCommandFlyoutClose ( true ) . ConfigureAwait ( false ) ;
1308
+ RunCommandFlyoutClose ( true ) ;
1325
1309
}
1326
1310
1327
1311
/// <summary>
1328
1312
/// Close the run command flyout and clear the search.
1329
1313
/// </summary>
1330
- private async Task RunCommandFlyoutClose ( bool clearSearch = false )
1314
+ private void RunCommandFlyoutClose ( bool clearSearch = false )
1331
1315
{
1332
1316
if ( ! FlyoutRunCommandIsOpen )
1333
1317
return ;
1334
-
1335
- FlyoutRunCommandAreAnimationsEnabled = false ;
1318
+
1336
1319
FlyoutRunCommandIsOpen = false ;
1337
1320
1338
1321
ConfigurationManager . OnDialogClose ( ) ;
1339
1322
1340
1323
// Clear the search
1341
1324
if ( clearSearch )
1342
- {
1343
- await Task . Delay ( 500 ) ; // Wait for the animation to finish
1344
1325
RunCommandSearch = string . Empty ;
1345
- }
1346
1326
}
1347
1327
1348
1328
#endregion
@@ -1360,7 +1340,7 @@ private void FlyoutRunCommand_IsKeyboardFocusWithinChanged(object sender, Depend
1360
1340
if ( e . NewValue is not false )
1361
1341
return ;
1362
1342
1363
- RunCommandFlyoutClose ( ) . ConfigureAwait ( false ) ;
1343
+ RunCommandFlyoutClose ( ) ;
1364
1344
}
1365
1345
1366
1346
#endregion
@@ -1946,7 +1926,7 @@ private async void OnNetworkHasChanged()
1946
1926
_isNetworkChanging = true ;
1947
1927
1948
1928
// Wait, because the event may be triggered several times.
1949
- await Task . Delay ( GlobalStaticConfiguration . StatusWindowDelayBeforeOpen ) ;
1929
+ await Task . Delay ( GlobalStaticConfiguration . NetworkChangeDetectionDelay ) ;
1950
1930
1951
1931
Log . Info ( "Network availability or address has changed!" ) ;
1952
1932
0 commit comments