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 ;
220using System . Collections . Generic ;
321using System . Collections . ObjectModel ;
422using System . ComponentModel ;
1937using System . Windows . Interop ;
2038using System . Windows . Markup ;
2139using 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 ;
4040using Application = System . Windows . Application ;
4141using ContextMenu = System . Windows . Controls . ContextMenu ;
4242using MouseEventArgs = System . Windows . Forms . MouseEventArgs ;
@@ -329,21 +329,6 @@ public bool FlyoutRunCommandIsOpen
329329 }
330330 }
331331
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-
347332 private bool _isRestartRequired ;
348333
349334 public bool IsRestartRequired
@@ -701,7 +686,7 @@ private void LoadApplicationList()
701686 // Select the application
702687 // Set application via command line, or select the default one, fallback to the first visible one
703688 var applicationList = Applications . Cast < ApplicationInfo > ( ) . ToArray ( ) ;
704-
689+
705690 if ( CommandLineManager . Current . Application != ApplicationName . None )
706691 SelectedApplication = applicationList . FirstOrDefault ( x => x . Name == CommandLineManager . Current . Application ) ;
707692 else
@@ -1244,7 +1229,6 @@ private void OpenRunAction()
12441229 {
12451230 ConfigurationManager . OnDialogOpen ( ) ;
12461231
1247- FlyoutRunCommandAreAnimationsEnabled = true ;
12481232 FlyoutRunCommandIsOpen = true ;
12491233 }
12501234
@@ -1259,7 +1243,7 @@ private void RunCommandDoAction()
12591243
12601244 private void RunCommandCloseAction ( )
12611245 {
1262- RunCommandFlyoutClose ( ) . ConfigureAwait ( false ) ;
1246+ RunCommandFlyoutClose ( ) ;
12631247 }
12641248
12651249 #endregion
@@ -1321,28 +1305,24 @@ private void RunCommandDo()
13211305 }
13221306
13231307 // Close the flyout
1324- RunCommandFlyoutClose ( true ) . ConfigureAwait ( false ) ;
1308+ RunCommandFlyoutClose ( true ) ;
13251309 }
13261310
13271311 /// <summary>
13281312 /// Close the run command flyout and clear the search.
13291313 /// </summary>
1330- private async Task RunCommandFlyoutClose ( bool clearSearch = false )
1314+ private void RunCommandFlyoutClose ( bool clearSearch = false )
13311315 {
13321316 if ( ! FlyoutRunCommandIsOpen )
13331317 return ;
1334-
1335- FlyoutRunCommandAreAnimationsEnabled = false ;
1318+
13361319 FlyoutRunCommandIsOpen = false ;
13371320
13381321 ConfigurationManager . OnDialogClose ( ) ;
13391322
13401323 // Clear the search
13411324 if ( clearSearch )
1342- {
1343- await Task . Delay ( 500 ) ; // Wait for the animation to finish
13441325 RunCommandSearch = string . Empty ;
1345- }
13461326 }
13471327
13481328 #endregion
@@ -1360,7 +1340,7 @@ private void FlyoutRunCommand_IsKeyboardFocusWithinChanged(object sender, Depend
13601340 if ( e . NewValue is not false )
13611341 return ;
13621342
1363- RunCommandFlyoutClose ( ) . ConfigureAwait ( false ) ;
1343+ RunCommandFlyoutClose ( ) ;
13641344 }
13651345
13661346 #endregion
@@ -1946,7 +1926,7 @@ private async void OnNetworkHasChanged()
19461926 _isNetworkChanging = true ;
19471927
19481928 // Wait, because the event may be triggered several times.
1949- await Task . Delay ( GlobalStaticConfiguration . StatusWindowDelayBeforeOpen ) ;
1929+ await Task . Delay ( GlobalStaticConfiguration . NetworkChangeDetectionDelay ) ;
19501930
19511931 Log . Info ( "Network availability or address has changed!" ) ;
19521932
0 commit comments