feature<FolderDialog>: add FolderDialog to remove dependency on System.Windows.Forms

This commit is contained in:
leo 2020-11-23 13:41:13 +08:00
parent 6bf06c87f1
commit e42290eef1
14 changed files with 336 additions and 121 deletions

View file

@ -1,4 +1,3 @@
using System;
using System.Threading.Tasks;
using System.Windows;
using System.Windows.Controls;
@ -46,14 +45,8 @@ namespace SourceGit.UI {
/// <param name="sender"></param>
/// <param name="e"></param>
private void SelectParentFolder(object sender, RoutedEventArgs e) {
var dialog = new System.Windows.Forms.FolderBrowserDialog();
dialog.Description = "Git Repository URL";
dialog.RootFolder = Environment.SpecialFolder.MyComputer;
dialog.ShowNewFolderButton = true;
if (dialog.ShowDialog() == System.Windows.Forms.DialogResult.OK) {
txtParentFolder.Text = dialog.SelectedPath;
}
var dialog = new FolderDailog("Select folder to store repository", null);
dialog.Open(path => txtParentFolder.Text = path);
}
/// <summary>