当前位置: 首页>>代码示例>>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;未经允许,请勿转载。