Пример #1
0
        protected string BrowseForFolderInternal(string selectedPath = null, string title = null)
        {
            WpfCustomDialogManager.ConfirmAccess();
            var dialog = new VistaFolderBrowserDialog {
                SelectedPath = selectedPath, Description = title
            };

            return(dialog.ShowDialog() == true ? dialog.SelectedPath : null);
        }
Пример #2
0
        protected string BrowseForFileInternal(string initialDirectory = null, string title = null,
                                               string defaultExt       = null,
                                               bool checkFileExists    = true)
        {
            WpfCustomDialogManager.ConfirmAccess();
            var dialog = new OpenFileDialog {
                InitialDirectory = initialDirectory,
                DefaultExt       = defaultExt,
                CheckFileExists  = checkFileExists,
                Title            = title
            };

            return(dialog.ShowDialog() == true ? dialog.FileName : null);
        }
Пример #3
0
 public Task <string> BrowseForFile(string initialDirectory = null,
                                    string title            = null,
                                    string defaultExt       = null, bool checkFileExists = true)
 =>
 WpfCustomDialogManager.Schedule(
     () => BrowseForFileInternal(initialDirectory, title, defaultExt, checkFileExists));
Пример #4
0
 public Task <string> BrowseForFolder(string selectedPath = null,
                                      string title        = null) => WpfCustomDialogManager.Schedule(() => BrowseForFolderInternal(selectedPath, title));