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

@ -116,15 +116,11 @@ namespace SourceGit.UI {
/// <param name="sender"></param>
/// <param name="e"></param>
private void SelectDefaultClonePath(object sender, RoutedEventArgs e) {
var dialog = new System.Windows.Forms.FolderBrowserDialog();
dialog.Description = "Select Folder To Clone Repository Into As Default";
dialog.RootFolder = Environment.SpecialFolder.MyComputer;
dialog.ShowNewFolderButton = true;
if (dialog.ShowDialog() == System.Windows.Forms.DialogResult.OK) {
txtGitCloneDir.Text = dialog.SelectedPath;
App.Preference.GitDefaultCloneDir = dialog.SelectedPath;
}
var dialog = new FolderDailog("Select Folder To Clone Repository Into As Default", null);
dialog.Open(path => {
txtGitCloneDir.Text = path;
App.Preference.GitDefaultCloneDir = path;
});
}
/// <summary>