public static UpdaterStartupSettings GetSettings(string[] args) { if (args.Length == 0 || args.All(string.IsNullOrEmpty)) { return(null); } UpdaterStartupSettings startupSettings = new UpdaterStartupSettings { InstructionsFile = GetInstructionsArg(args) }; return(startupSettings); }
private void App_Startup(object sender, StartupEventArgs e) { UpdaterStartupSettings settings = CommandLineArgumentParser.GetSettings(e.Args); MainWindow mainWindow; if (settings == null) { #if DEBUG mainWindow = new MainWindow(new UpdateInstructions() { LatestVersion = "1.2.3.4" }); #else mainWindow = new MainWindow(); #endif } else { mainWindow = new MainWindow(settings); } mainWindow.Show(); }
public MainWindow(UpdaterStartupSettings updaterStartupSettings) : this(UpdateInstructionsReader.Read(updaterStartupSettings.InstructionsFile)) { }