private async void CheckCommandLine() { var userInputs = VepixCommandLineParser.ResultsInstance(); foreach (var treeFolder in userInputs.TreeFolders) { FolderTreeViewModel.TryLoad(treeFolder); } var searchPatterns = userInputs.SearchPatterns; var firstLoad = true; foreach (var folder in userInputs.Folders) { if (firstLoad) { SelectedPictureGridViewModel = await LoadAPictureGridViewModel(folder, searchPatterns); firstLoad = false; } else { await LoadAPictureGridViewModel(folder, searchPatterns); } } }
public void Parse_ShouldPopulateListsCorrectly_WhenTopDirAndPatternSwitchIsUsed() { string[] args = { "-f", _validPath, "-p", validSearchPattern }; _consoleParser.Parse(args); var results = VepixCommandLineParser.ResultsInstance(); Assert.IsTrue(_validPath == results.Folders[0] && validSearchPattern == results.SearchPatterns[0]); }
public void Parse_ShouldPopulateListsCorrectly_When2FolderTreesAnd1PatternSwitchIsUsed() { string[] args = { "-t", _validPath, "C:\\", "-p", validSearchPattern, "1*.png" }; _consoleParser.Parse(args); var results = VepixCommandLineParser.ResultsInstance(); Assert.IsTrue(_validPath == results.TreeFolders[0] && "C:\\" == results.TreeFolders[1] && validSearchPattern == results.SearchPatterns[0] && "1*.png" == results.SearchPatterns[1] && results.Folders.Count == 0); }
public void Parse_ShouldPopulateListsCorrectly_WhenFolderFolderTreeAndPatternSwitchIsUsed() { var docsFolder = Environment.GetFolderPath(Environment.SpecialFolder.MyDocuments); string[] args = { "-f", _validPath, "-t", docsFolder, "-p", validSearchPattern }; _consoleParser.Parse(args); var results = VepixCommandLineParser.ResultsInstance(); Assert.IsTrue(_validPath == results.Folders[0] && docsFolder == results.TreeFolders[0] && validSearchPattern == results.SearchPatterns[0]); }
protected override void OnStartup(StartupEventArgs e) { if (e.Args.Count() > 0) { try { var consoleParser = new VepixCommandLineParser(); if (!consoleParser.Parse(e.Args)) { consoleParser.DisplayHelp(); this.Shutdown(); return; } } catch (ArgumentException ae) { VepixCommandLineParser.AttachConsole(); Console.WriteLine(string.Format("{0}\n{1}", ae.Message, VepixCommandLineParser.CommandLineHelp)); VepixCommandLineParser.DetachConsole(); this.Shutdown(); return; } } ThemeManager.AddAccent("CustomAccent", new Uri("/Resources/CustomAccent.xaml", UriKind.Relative)); // get the current app style (theme and accent) from the application Tuple <AppTheme, Accent> theme = ThemeManager.DetectAppStyle(Application.Current); // now change app style to the custom accent and current theme ThemeManager.ChangeAppStyle(Application.Current, ThemeManager.GetAccent("CustomAccent"), theme.Item1); base.OnStartup(e); }