Ejemplo n.º 1
0
        private void ChangeWorkspace_Click(object sender, RoutedEventArgs e)
        {
            var set    = new Settings();
            var dialog = new SelectFolderDialog
            {
                WorkspaceFolder = Root.FullName,
                Owner           = this
            };

            if (dialog.ShowDialog() == true)
            {
                var browsePath = dialog.WorkspaceFolder;
                set.WorkspaceFolder = browsePath;
                set.Save();

                ScanFolder(browsePath);
            }
        }
Ejemplo n.º 2
0
        private void App_OnStartup(object sender, StartupEventArgs e)
        {
            var mainWindow = new MainWindow();

            string browsePath = null;

            if (e.Args.Length > 0)
            {
                browsePath = e.Args[0];
            }
            else
            {
                var set             = new Settings();
                var workspaceFolder = set.WorkspaceFolder;
                if (string.IsNullOrWhiteSpace(workspaceFolder) || !Directory.Exists(workspaceFolder))
                {
                    var dialog = new SelectFolderDialog();
                    if (dialog.ShowDialog() == true)
                    {
                        browsePath          = dialog.WorkspaceFolder;
                        set.WorkspaceFolder = browsePath;
                        set.Save();
                    }
                }
                else
                {
                    browsePath = workspaceFolder;
                }
            }

            if (string.IsNullOrWhiteSpace(browsePath))
            {
                mainWindow.Close();
            }
            else
            {
                mainWindow.Show(browsePath);
            }
        }