From 23d3038c922e1f9fad514666c8ef2921ebc7aebe Mon Sep 17 00:00:00 2001 From: ZCShou <72115@163.com> Date: Wed, 3 Feb 2021 16:26:32 +0800 Subject: [PATCH] =?UTF-8?q?optimize:=20=E4=BF=AE?= =?UTF-8?q?=E6=94=B9=E6=AC=A2=E8=BF=8E=E9=A1=B5=E7=9A=84=E6=89=93=E5=BC=80?= =?UTF-8?q?=E6=9C=AC=E5=9C=B0=E4=BB=93=E5=BA=93=E7=9A=84=E5=BC=B9=E5=87=BA?= =?UTF-8?q?=E7=AA=97=E5=8F=A3=E4=B8=BA=E6=A8=A1=E6=80=81=E7=AA=97=E5=8F=A3?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/UI/FolderDailog.xaml.cs | 21 +++++++++++++++++++++ src/UI/NewPage.xaml.cs | 2 +- 2 files changed, 22 insertions(+), 1 deletion(-) diff --git a/src/UI/FolderDailog.xaml.cs b/src/UI/FolderDailog.xaml.cs index 5d46b945..70a0d350 100644 --- a/src/UI/FolderDailog.xaml.cs +++ b/src/UI/FolderDailog.xaml.cs @@ -121,8 +121,29 @@ namespace SourceGit.UI { /// public static void Open(string title, Action onOK) { new FolderDailog(title, onOK).Show(); + } + + /// + /// modeless. + /// + /// + /// + public static void Show(string title, Action onOK) + { + new FolderDailog(title, onOK).Show(); } + /// + /// modal. + /// + /// + /// + public static void ShowDialog(string title, Action onOK) + { + new FolderDailog(title, onOK).ShowDialog(); + } + + #region EVENTS private void OnSure(object sender, RoutedEventArgs e) { if (selected != null) cb?.Invoke(selected.Path); diff --git a/src/UI/NewPage.xaml.cs b/src/UI/NewPage.xaml.cs index 01d30a2b..e52713a2 100644 --- a/src/UI/NewPage.xaml.cs +++ b/src/UI/NewPage.xaml.cs @@ -42,7 +42,7 @@ namespace SourceGit.UI { /// /// private void OpenOrAddRepo(object sender, RoutedEventArgs e) { - FolderDailog.Open(App.Text("NewPage.OpenOrInitDialog"), path => { + FolderDailog.ShowDialog(App.Text("NewPage.OpenOrInitDialog"), path => { CheckAndOpenRepo(path); }); }