File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -10,13 +10,7 @@ public partial class App : Application
1010 {
1111 public App ( )
1212 {
13- ShutdownMode = ShutdownMode . OnLastWindowClose ;
14-
15- // Parse the command line arguments and store them in the current configuration
16- CommandLineManager . Parse ( ) ;
17-
18- // Detect the current configuration
19- ConfigurationManager . Detect ( ) ;
13+ ShutdownMode = ShutdownMode . OnLastWindowClose ;
2014 }
2115 }
2216}
Original file line number Diff line number Diff line change @@ -220,6 +220,12 @@ public MainWindow()
220220 InitializeComponent ( ) ;
221221 DataContext = this ;
222222
223+ // Parse the command line arguments and store them in the current configuration
224+ CommandLineManager . Parse ( ) ;
225+
226+ // Detect the current configuration
227+ ConfigurationManager . Detect ( ) ;
228+
223229 // Load settings
224230 SettingsManager . Load ( ) ;
225231
Original file line number Diff line number Diff line change 33 public class CommandLineInfo
44 {
55 public bool Autostart { get ; set ; }
6+ public bool ResetSettings { get ; set ; }
67
78 public CommandLineInfo ( )
89 {
Original file line number Diff line number Diff line change 1- using System ;
1+ using NETworkManager . Views . Settings ;
2+ using System ;
3+ using System . Windows ;
24
35namespace NETworkManager . Models . Settings
46{
57 public static class CommandLineManager
68 {
79 public const string ParameterIdentifier = "--" ;
8- public const string ParameterAutostart = "Autostart" ;
10+ public const string ParameterAutostart = "autostart" ;
11+ public const string ParameterResetSettings = "reset-settings" ;
912
1013 public static CommandLineInfo Current { get ; set ; }
1114
@@ -30,6 +33,13 @@ public static void Parse()
3033 // Autostart
3134 if ( parameter . TrimStart ( trimChars ) . Equals ( ParameterAutostart , StringComparison . InvariantCultureIgnoreCase ) )
3235 Current . Autostart = true ;
36+ else if ( parameter . TrimStart ( trimChars ) . Equals ( ParameterResetSettings , StringComparison . InvariantCultureIgnoreCase ) )
37+ Current . ResetSettings = true ;
38+ else
39+ {
40+ MetroMessageBox msg = new MetroMessageBox ( ) ;
41+ msg . ShowDialog ( ) ;
42+ }
3343 }
3444 }
3545 }
Original file line number Diff line number Diff line change @@ -105,7 +105,7 @@ public static string SettingsLocationNotPortable
105105 #region XmlSerializer (save and load)
106106 public static void Load ( )
107107 {
108- if ( File . Exists ( SettingsFilePath ) )
108+ if ( File . Exists ( SettingsFilePath ) && ! CommandLineManager . Current . ResetSettings )
109109 {
110110 SettingsInfo settingsInfo = new SettingsInfo ( ) ;
111111
You can’t perform that action at this time.
0 commit comments