當前位置: 首頁>>代碼示例>>C#>>正文


C# VistaFolderBrowserDialog.ShowDialog方法代碼示例

本文整理匯總了C#中Ookii.Dialogs.Wpf.VistaFolderBrowserDialog.ShowDialog方法的典型用法代碼示例。如果您正苦於以下問題:C# VistaFolderBrowserDialog.ShowDialog方法的具體用法?C# VistaFolderBrowserDialog.ShowDialog怎麽用?C# VistaFolderBrowserDialog.ShowDialog使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在Ookii.Dialogs.Wpf.VistaFolderBrowserDialog的用法示例。


在下文中一共展示了VistaFolderBrowserDialog.ShowDialog方法的15個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的C#代碼示例。

示例1: browseServerFolder_Click

        private void browseServerFolder_Click(object sender, RoutedEventArgs e)
        {
            var dialog = new VistaFolderBrowserDialog();

            var showDialog = dialog.ShowDialog();

            if (showDialog.HasValue && showDialog.Value)
            {
            NoDebugOrReleaseFolder:
                if (!(dialog.SelectedPath.IndexOf("debug", StringComparison.OrdinalIgnoreCase) >= 0 || dialog.SelectedPath.IndexOf("release", StringComparison.OrdinalIgnoreCase) >= 0))
                {
                    MessageBoxResult result = MessageBox.Show("The selected folder should contain the authserver.exe and worldserver.exe executables and are most of the time placed inside the 'debug' or 'release' folder. Do you still wish to continue?", "Are you sure?", MessageBoxButton.YesNo, MessageBoxImage.Question);

                    if (result != MessageBoxResult.Yes)
                    {
                        var showDialog2 = dialog.ShowDialog();

                        if (showDialog2.HasValue && showDialog2.Value)
                            goto NoDebugOrReleaseFolder;

                        return;
                    }
                }

                ServerFolderTextBox.SetValue(TextBox.TextProperty, dialog.SelectedPath);
            }
        }
開發者ID:TrinityCore-Manager,項目名稱:TrinityCore-Manager-v3,代碼行數:27,代碼來源:SetupWizard.xaml.cs

示例2: MainWindowViewModel

        public MainWindowViewModel()
        {
            TorrentSelected = new ReactiveCommand();
            DownloadAll = new ReactiveAsyncCommand();
            DeleteSelected = new ReactiveAsyncCommand();

            DeleteSelected.Subscribe(new AnonymousObserver<object>(x =>
            {
                App.streamza.RemoveTorrent(_selectedTorrent.id);
            }));

            DownloadAll.Subscribe(new AnonymousObserver<object>(x =>
            {
                var sel = _selectedTorrent;
                var s = new VistaFolderBrowserDialog();
                var res = s.ShowDialog();
                if (!res.HasValue || res.Value != true) return;

                var files = App.streamza.GetTorrentFiles(sel);
                foreach (var file in files)
                {
                    var uri = App.streamza.GetDownloadLink(file);
                    var cl = new WebClient();
                    var path = Path.Combine(s.SelectedPath, file.path);
                    if (!Directory.Exists(Path.GetDirectoryName(path)))
                        Directory.CreateDirectory(Path.GetDirectoryName(path));
                    cl.DownloadFile(new Uri(uri), path);
                }

                // This probably works best when there are lots of small files; doesn't
                // offer any improvement when there are only a couple of large files.
                // TODO: Check file count and set parallelism appropriately
                //Parallel.ForEach(files,
                //    new ParallelOptions { MaxDegreeOfParallelism = 4 },
                //    (file) =>
                //    {
                //        var uri = App.streamza.GetDownloadLink(file);
                //        var cl = new WebClient();
                //        var path = Path.Combine(s.SelectedPath, file.path);
                //        if (!Directory.Exists(Path.GetDirectoryName(path)))
                //            Directory.CreateDirectory(Path.GetDirectoryName(path));
                //        cl.DownloadFile(new Uri(uri), path);
                //    });
            }));

            _torrents = App.streamza.Torrents;

            Observable
                .Start(() =>
                {
                    Observable
                         .Interval(TimeSpan.FromSeconds(10))
                         .Subscribe(i =>
                         {
                             if (FetchingFiles) return;
                             _torrents = App.streamza.Torrents;
                             raisePropertyChanged("Torrents");
                         });
                });
        }
開發者ID:GeorgeHahn,項目名稱:StreamzaDesktop,代碼行數:60,代碼來源:MainWindow.xaml.cs

示例3: btnFolderSelect_Click

        private void btnFolderSelect_Click(object sender, RoutedEventArgs e)
        {
            VistaFolderBrowserDialog dialog = new VistaFolderBrowserDialog();
            dialog.Description = "Please select a folder.";
            dialog.UseDescriptionForTitle = true; // This applies to the Vista style dialog only, not the old dialog.

            if ((bool)dialog.ShowDialog(this))
            {
                umbracoFolder.Text = dialog.SelectedPath;

                LanguageRepository.Init(System.IO.Path.Combine(umbracoFolder.Text, @"umbraco\config\lang"));

                string[] languagecodes = LanguageRepository.ListLanguages();

                foreach (var code in languagecodes)
                {
                    Language lang = LanguageRepository.GetLanguage(code);

                    cmbSourceLanguage.Items.Add(new ComboBoxItem() { Content = string.Format("{0} [{1}]", lang.InternationalName, lang.Id), Tag = code });
                    cmbDestinationLanguage.Items.Add(new ComboBoxItem() { Content = string.Format("{0} [{1}]", lang.InternationalName, lang.Id), Tag = code });
                }

                cmbSourceLanguage.IsEnabled = true;
                cmbDestinationLanguage.IsEnabled = true;

            }
        }
開發者ID:mwulffn,項目名稱:LanguageTranslator,代碼行數:27,代碼來源:MainWindow.xaml.cs

示例4: ShowFolderBrowser

        /// <summary>
        /// Presents the user with a folder browser dialog.
        /// </summary>
        /// <param name="filter">Filename filter for if the OS doesn't support a folder browser.</param>
        /// <returns>Full path the user selected.</returns>
        private static string ShowFolderBrowser(string filter)
        {
            bool cancelled = false;
            string path = null;

            if (VistaFolderBrowserDialog.IsVistaFolderDialogSupported)
            {
                var dlg = new VistaFolderBrowserDialog();

                cancelled = !(dlg.ShowDialog() ?? false);

                if (!cancelled)
                {
                    path = Path.GetFullPath(dlg.SelectedPath);
                }
            }
            else
            {
                var dlg = new Microsoft.Win32.SaveFileDialog();
                dlg.Filter = filter;
                dlg.FilterIndex = 1;

                cancelled = !(dlg.ShowDialog() ?? false);

                if (!cancelled)
                {
                    path = Path.GetFullPath(Path.GetDirectoryName(dlg.FileName)); // Discard whatever filename they chose
                }
            }

            return path;
        }
開發者ID:wfraser,項目名稱:FooSync,代碼行數:37,代碼來源:SyncGroupEntryWindow.xaml.cs

示例5: BtnOpenSourceDirOnClick

 private void BtnOpenSourceDirOnClick(object sender, RoutedEventArgs e)
 {
     var dlg = new VistaFolderBrowserDialog();
     var showDialog = dlg.ShowDialog(this);
     if (showDialog != null && !(bool)showDialog) return;
     TxtSourceDir.Text = dlg.SelectedPath;
 }
開發者ID:perfectdev,項目名稱:MassImageConverter,代碼行數:7,代碼來源:MainWindow.xaml.cs

示例6: BrowseSteam_Click

 private void BrowseSteam_Click(object sender, RoutedEventArgs e)
 {
     var dialog = new VistaFolderBrowserDialog();
     if (dialog.ShowDialog() == true)
     {
         SteamDirectoryTextBox.Text = dialog.SelectedPath;
     }
 }
開發者ID:goldsziggy,項目名稱:Emulation-Manager,代碼行數:8,代碼來源:EmuManager.xaml.cs

示例7: SetLocationSurfaces

 public void SetLocationSurfaces()
 {
     var dlg = new VistaFolderBrowserDialog();
     var showDialog = dlg.ShowDialog();
     if (showDialog == null || !((bool) showDialog)) return;
     SurfacesPath = dlg.SelectedPath;
     //SurfacesPath = @"B:\DEV\UIEdit\UIEdit\bin\Debug\surfaces.pck.files";
 }
開發者ID:perfectdev,項目名稱:UIEdit,代碼行數:8,代碼來源:ProjectController.cs

示例8: OnGotFocus

        private void OnGotFocus([NotNull] object sender,
                                [NotNull] RoutedEventArgs e)
        {
            var dialog = new VistaFolderBrowserDialog();
            if(dialog.ShowDialog() != true) return;

            Model.WorkingPath = dialog.SelectedPath;
        }
開發者ID:vba,項目名稱:config-watcher,代碼行數:8,代碼來源:MainWindow.xaml.cs

示例9: edNetLogBrowserButton_Click

 private void edNetLogBrowserButton_Click(object sender, RoutedEventArgs e)
 {
     VistaFolderBrowserDialog vfbd = new VistaFolderBrowserDialog();
     vfbd.Description = "Please select your Elite:Dangerous NetLog folder (Containing NetLog files)";
     vfbd.UseDescriptionForTitle = true;
     if ((bool)vfbd.ShowDialog(this))
         Properties.Settings.Default.NetLogPath= vfbd.SelectedPath;
 }
開發者ID:kenneaal,項目名稱:RatTracker,代碼行數:8,代碼來源:Settings.xaml.cs

示例10: AddSpecificFolder

 private void AddSpecificFolder(object sender, RoutedEventArgs e)
 {
     VistaFolderBrowserDialog folderDialog = new VistaFolderBrowserDialog();
     bool? dialogResult = folderDialog.ShowDialog();
     if (dialogResult.GetValueOrDefault(false))
     {
         Sources.AddSpecificFolder(folderDialog.SelectedPath);
     }
 }
開發者ID:hamstercat,項目名稱:perfect-media,代碼行數:9,代碼來源:SourcesWindow.xaml.cs

示例11: onSelectGameDir

    private void onSelectGameDir() {
      VistaFolderBrowserDialog fbd = new VistaFolderBrowserDialog();

      bool? result = fbd.ShowDialog();

      if (!result.HasValue || !result.Value) return;

      viewModel.Message.Settings.PathToGame = fbd.SelectedPath;
    }
開發者ID:stricq,項目名稱:UPKManager,代碼行數:9,代碼來源:SettingsDialogController.cs

示例12: ChooseClipDirectory

 private void ChooseClipDirectory(object sender, RoutedEventArgs e)
 {
     VistaFolderBrowserDialog fbd = new VistaFolderBrowserDialog();
     Nullable<bool> r = fbd.ShowDialog();
     if (r.Value)
     {
         CurrentSession.CurrentDirectory = fbd.SelectedPath;
     }
 }
開發者ID:doctorpangloss,項目名稱:KinectRecorder,代碼行數:9,代碼來源:VideoRecorderControl.xaml.cs

示例13: FolderBrowserUI

 /// <summary>
 /// Displays the folder browser dialog
 /// </summary>
 /// <param name="title"></param>
 /// <param name="filename"></param>
 public static void FolderBrowserUI(String title, out String filename)
 {
     filename = null;
     var dialog = new VistaFolderBrowserDialog
                                           {Description = title, UseDescriptionForTitle = true};
     if (dialog.ShowDialog() == true)
     {
         filename = dialog.SelectedPath;
     }
 }
開發者ID:naveedmurtuza,項目名稱:crypto-tools,代碼行數:15,代碼來源:Utilities.cs

示例14: SetLocationInterfaces

 public void SetLocationInterfaces() {
     var dlg = new VistaFolderBrowserDialog();
     var showDialog = dlg.ShowDialog();
     if (showDialog == null || !((bool) showDialog)) return;
     InterfacesPath = dlg.SelectedPath;
     Properties.Settings.Default.interfaceFilePath = InterfacesPath;
     Properties.Settings.Default.Save();
     //InterfacesPath = @"B:\DEV\UIEdit\UIEdit\bin\Debug\interfaces.pck.files";
     GenerateFileList();
 }
開發者ID:MadHacker666,項目名稱:UIEdit,代碼行數:10,代碼來源:ProjectController.cs

示例15: Browse_OnClick

 /// <summary>
 /// Handles the OnClick event of the Browse control.
 /// </summary>
 /// <param name="sender">The source of the event.</param>
 /// <param name="e">The <see cref="RoutedEventArgs"/> instance containing the event data.</param>
 /// <exception cref="System.NotImplementedException"></exception>
 private void Browse_OnClick(object sender, RoutedEventArgs e)
 {
     var picker = new VistaFolderBrowserDialog {SelectedPath = Settings.ExperimentDirectory, ShowNewFolderButton = true};
     if (picker.ShowDialog().Value)
     {
         ExperimentFolder.Text = picker.SelectedPath;
         Settings.ExperimentDirectory = picker.SelectedPath;
         Directory.SetCurrentDirectory(Settings.ExperimentDirectory);
         Settings.SetPath(Settings.ExperimentDirectory);
     }
 }
開發者ID:modulexcite,項目名稱:FRESHER,代碼行數:17,代碼來源:MainWindow.xaml.cs


注:本文中的Ookii.Dialogs.Wpf.VistaFolderBrowserDialog.ShowDialog方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。