当前位置: 首页>>代码示例>>C#>>正文


C# Wpf.VistaFolderBrowserDialog类代码示例

本文整理汇总了C#中Ookii.Dialogs.Wpf.VistaFolderBrowserDialog的典型用法代码示例。如果您正苦于以下问题:C# VistaFolderBrowserDialog类的具体用法?C# VistaFolderBrowserDialog怎么用?C# VistaFolderBrowserDialog使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。


VistaFolderBrowserDialog类属于Ookii.Dialogs.Wpf命名空间,在下文中一共展示了VistaFolderBrowserDialog类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。

示例1: 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

示例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: 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

示例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: mainForm

        public mainForm()
        {
            try
            {
                finishedLoading = false;
                activeOrInActiveMainForm = this;

                Program.Settings = Settings.LoadSettings();
                Program.Settings.DirectoryList.Initialize();

                InitializeComponent();
                initFilesDataGridViewCheckAllCheckBox();
                foldersListBox.DataSource = Program.Settings.DirectoryList.Directories;
                compileResultsDataGridView.DataSource = new List<Models.CompileCommandResult>();
                folderBrowserDialog = new VistaFolderBrowserDialog();
                outputFileDialog = new VistaSaveFileDialog()
                {
                    AddExtension = true,
                    Filter = "*.css|*.css"
                };

                CheckForLessUpdates();
            }
            catch (Exception e)
            {
                ExceptionHandler.LogException(e);
            }
        }
开发者ID:rs3d,项目名称:WinLess,代码行数:28,代码来源:mainForm.cs

示例7: 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

示例8: 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

示例9: 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

示例10: 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

示例11: GetPath

		public object GetPath(Security security, Type dataType, object arg, DateTime? from, DateTime? to, IMarketDataDrive drive)
		{
			var fileName = security.GetFileName(dataType, arg, from, to, ExportType);

			var dlg = new VistaSaveFileDialog
			{
				FileName = fileName,
				RestoreDirectory = true
			};

			switch (ExportType)
			{
				case ExportTypes.Excel:
					dlg.Filter = @"xlsx files (*.xlsx)|*.xlsx|All files (*.*)|*.*";
					break;
				case ExportTypes.Xml:
					dlg.Filter = @"xml files (*.xml)|*.xml|All files (*.*)|*.*";
					break;
				case ExportTypes.Txt:
					dlg.Filter = @"text files (*.txt)|*.txt|All files (*.*)|*.*";
					break;
				case ExportTypes.Sql:
				{
					var wnd = new DatabaseConnectionWindow();

					if (wnd.ShowModal(this))
					{
						DatabaseConnectionCache.Instance.AddConnection(wnd.Connection);
						return wnd.Connection;
					}

					return null;
				}
				case ExportTypes.Bin:
				{
					var wndFolder = new VistaFolderBrowserDialog();

					if (drive is LocalMarketDataDrive)
						wndFolder.SelectedPath = drive.Path;

					return wndFolder.ShowDialog(this.GetWindow()) == true
						? DriveCache.Instance.GetDrive(wndFolder.SelectedPath)
						: null;
				}
				default:
				{
					new MessageBoxBuilder()
						.Error()
						.Owner(this)
						.Text(LocalizedStrings.Str2910Params.Put(ExportType))
							.Show();

					return null;
				}
			}

			return dlg.ShowDialog(this.GetWindow()) == true ? dlg.FileName : null;
		}
开发者ID:reddream,项目名称:StockSharp,代码行数:58,代码来源:ExportButton.xaml.cs

示例12: 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

示例13: 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

示例14: 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

示例15: 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


注:本文中的Ookii.Dialogs.Wpf.VistaFolderBrowserDialog类示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。