diff --git a/Source/Extensions/H.Extensions.Setting/Command.ClearSetting.cs b/Source/Extensions/H.Extensions.Setting/Command.ClearSetting.cs
index 197a4f7e..57e30cfb 100644
--- a/Source/Extensions/H.Extensions.Setting/Command.ClearSetting.cs
+++ b/Source/Extensions/H.Extensions.Setting/Command.ClearSetting.cs
@@ -2,14 +2,26 @@
using H.Providers.Ioc;
using H.Providers.Mvvm;
+using System.Windows;
namespace H.Extensions.Setting
{
public class ClearSettingDataCommand : MarkupCommandBase
{
- public override void Execute(object parameter)
+ public override async void Execute(object parameter)
{
- AppPaths.Instance.ClearSetting();
+ var r = await IocMessage.ShowDialogMessage("清空配置数据无法恢复,确认清空配置?");
+ if (r == false)
+ return;
+
+ r = AppPaths.Instance.ClearSetting();
+ if (r == false)
+ return;
+
+ r = await IocMessage.ShowDialogMessage("重启已生效,是否立即关闭?");
+ if (r == false)
+ return;
+ Application.Current.Shutdown();
}
}
}
diff --git a/Source/Modules/H.Modules.Guide/GuideBox.xaml b/Source/Modules/H.Modules.Guide/GuideBox.xaml
index fd39b0ee..6411aa31 100644
--- a/Source/Modules/H.Modules.Guide/GuideBox.xaml
+++ b/Source/Modules/H.Modules.Guide/GuideBox.xaml
@@ -122,11 +122,11 @@
-
diff --git a/Source/Modules/H.Modules.Setting/SettingViewPresenter.xaml b/Source/Modules/H.Modules.Setting/SettingViewPresenter.xaml
index 1c53f6f2..04399d8e 100644
--- a/Source/Modules/H.Modules.Setting/SettingViewPresenter.xaml
+++ b/Source/Modules/H.Modules.Setting/SettingViewPresenter.xaml
@@ -120,12 +120,12 @@
Content="确定"
DockPanel.Dock="Right" />
-
+ DockPanel.Dock="Right" />-->
diff --git a/Source/Providers/H.Providers.Ioc/Setting/AppPaths.cs b/Source/Providers/H.Providers.Ioc/Setting/AppPaths.cs
index e416d343..772ea56b 100644
--- a/Source/Providers/H.Providers.Ioc/Setting/AppPaths.cs
+++ b/Source/Providers/H.Providers.Ioc/Setting/AppPaths.cs
@@ -82,18 +82,22 @@ public void ClearCache()
}
}
- public void ClearSetting()
+ public bool ClearSetting()
{
try
{
- Directory.Delete(this.Setting, true);
- Directory.Delete(this.UserSetting, true);
- IocMessage.Snack.ShowInfo("操作完成");
+ if (Directory.Exists(this.Setting))
+ Directory.Delete(this.Setting, true);
+ if (Directory.Exists(this.UserSetting))
+ Directory.Delete(this.UserSetting, true);
+ IocMessage.Snack?.ShowInfo("操作完成");
+ return true;
}
catch (Exception ex)
{
IocMessage.Dialog.Show("清空失败,详情请查看日志");
IocLog.Instance?.Error(ex);
+ return false;
}
}
diff --git a/Source/Tests/H.Test.Diagram/MainWindow.xaml b/Source/Tests/H.Test.Diagram/MainWindow.xaml
index 00c427e3..2b69edc8 100644
--- a/Source/Tests/H.Test.Diagram/MainWindow.xaml
+++ b/Source/Tests/H.Test.Diagram/MainWindow.xaml
@@ -49,7 +49,8 @@
-
+
@@ -313,7 +314,8 @@
-
+
@@ -333,7 +335,8 @@
DockPanel.Dock="Right"
TabStripPlacement="Bottom">
-
+
@@ -359,24 +362,6 @@
FlowableZoomMode="Center"
Focusable="True"
UseAnimation="False">
-
@@ -388,10 +373,12 @@
-
+
-
+
diff --git a/Source/Tests/H.Test.Setting/MainWindow.xaml b/Source/Tests/H.Test.Setting/MainWindow.xaml
index 94ac4137..327cc684 100644
--- a/Source/Tests/H.Test.Setting/MainWindow.xaml
+++ b/Source/Tests/H.Test.Setting/MainWindow.xaml
@@ -6,8 +6,8 @@
xmlns:local="clr-namespace:H.Test.Setting"
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
Title="MainWindow"
- Width="800"
- Height="450"
+ Width="900"
+ Height="550"
Style="{StaticResource {x:Type Window}}"
WindowStartupLocation="CenterScreen"
mc:Ignorable="d">
diff --git a/Source/Tests/H.Test.SplashScreen/MainWindow.xaml b/Source/Tests/H.Test.SplashScreen/MainWindow.xaml
index 4616a875..9c39d1f4 100644
--- a/Source/Tests/H.Test.SplashScreen/MainWindow.xaml
+++ b/Source/Tests/H.Test.SplashScreen/MainWindow.xaml
@@ -5,8 +5,8 @@
xmlns:local="clr-namespace:H.Test.SplashScreen"
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
Title="MainWindow"
- Width="800"
- Height="450"
+ Width="900"
+ Height="550"
Style="{StaticResource {x:Type Window}}"
mc:Ignorable="d">