Ejemplo n.º 1
0
        public IViewAdaper <SelectPathDialog, SelectPathDialogResult> GetSelectPathDialog(DirectoryItemType searchToLevel,
                                                                                          string rootPath      = "",
                                                                                          string startPath     = "",
                                                                                          string fileExtantion = "")
        {
            SelectPathDialog    dialog    = new SelectPathDialog();
            SelectPathViewModel viewModel = new SelectPathViewModel(this, searchToLevel, this.iOWrapper, rootPath, startPath, fileExtantion);

            dialog.DataContext = viewModel;

            return(new SelectPathDialogAdapter(dialog));
        }
        private void OnFolderBrowserClick(object window)
        {
            SelectPathDialog    dialog    = new SelectPathDialog();
            SelectPathViewModel viewModel = new SelectPathViewModel(DirectoryItemType.Folder, PackagePath);

            dialog.DataContext = viewModel;
            dialog.Owner       = window as Window;

            if (dialog.ShowDialog() == true)
            {
                this.PackagePath = viewModel.SelectedPath;
            }
        }
Ejemplo n.º 3
0
        public void SaveCurrentSimulation()
        {
            DialogResult result = SelectPathDialog.ShowDialog();

            SelectPathDialog.OverwritePrompt = true;
            if (result == DialogResult.OK)
            {
                string path = SelectPathDialog.FileName;
                if (path.Substring(path.Length - 5) == ".gols")
                {
                    SimulationSaver.Save(simulation, path);
                }
                else
                {
                    MessageBox.Show("Wrong file format! File name should end with '.gols'");
                }
            }
        }