Skip to content

Commit

Permalink
bug+
Browse files Browse the repository at this point in the history
  • Loading branch information
HeBianGu committed Mar 5, 2024
1 parent e4786da commit aea8fcb
Show file tree
Hide file tree
Showing 7 changed files with 39 additions and 36 deletions.
16 changes: 14 additions & 2 deletions Source/Extensions/H.Extensions.Setting/Command.ClearSetting.cs
Original file line number Diff line number Diff line change
Expand Up @@ -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();
}
}
}
2 changes: 1 addition & 1 deletion Source/Modules/H.Modules.Guide/GuideBox.xaml
Original file line number Diff line number Diff line change
Expand Up @@ -122,11 +122,11 @@
<Button HorizontalAlignment="Left"
Command="{x:Static local:GuideBox.SkipCommand}"
Content="跳过指南&gt;&gt;" />

<Button x:Name="bt_next"
Width="100"
HorizontalAlignment="Left"
Background="{DynamicResource {x:Static h:BrushKeys.Orange}}"
Foreground="White"
Command="{x:Static local:GuideBox.NextCommand}"
Content="下一步" />
</DockPanel>
Expand Down
4 changes: 2 additions & 2 deletions Source/Modules/H.Modules.Setting/SettingViewPresenter.xaml
Original file line number Diff line number Diff line change
Expand Up @@ -120,12 +120,12 @@
Content="确定"
DockPanel.Dock="Right" />

<Button MinWidth="100"
<!--<Button MinWidth="100"
Margin="2,0"
Command="{CloseDialogCommand}"
CommandParameter="{Binding RelativeSource={RelativeSource Mode=Self}}"
Content="取消"
DockPanel.Dock="Right" />
DockPanel.Dock="Right" />-->
</DockPanel>
</Grid>
</DataTemplate>
Expand Down
12 changes: 8 additions & 4 deletions Source/Providers/H.Providers.Ioc/Setting/AppPaths.cs
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}
}

Expand Down
33 changes: 10 additions & 23 deletions Source/Tests/H.Test.Diagram/MainWindow.xaml
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,8 @@
<Button Command="{x:Static h:DiagramCommands.Previous}"
CommandTarget="{Binding ElementName=diagram}"
Content="上一个" />
<BulletDecorator Margin="10,0" DockPanel.Dock="Right">
<BulletDecorator Margin="10,0"
DockPanel.Dock="Right">
<BulletDecorator.Bullet>
<TextBlock Text="执行流程方式 " />
</BulletDecorator.Bullet>
Expand Down Expand Up @@ -313,7 +314,8 @@

<ItemsControl.ItemsPanel>
<ItemsPanelTemplate>
<UniformGrid VerticalAlignment="Top" Columns="2" />
<UniformGrid VerticalAlignment="Top"
Columns="2" />
</ItemsPanelTemplate>
</ItemsControl.ItemsPanel>
</ItemsControl>
Expand All @@ -333,7 +335,8 @@
DockPanel.Dock="Right"
TabStripPlacement="Bottom">
<TabItem Header="画板属性">
<h:PropertyGrid HideInheritedProperties="True" SelectedObject="{Binding ElementName=diagram}" />
<h:PropertyGrid HideInheritedProperties="True"
SelectedObject="{Binding ElementName=diagram}" />
</TabItem>

<TabItem Header="选中节点属性">
Expand All @@ -359,24 +362,6 @@
FlowableZoomMode="Center"
Focusable="True"
UseAnimation="False">
<!--<h:Diagram.InputBindings>
<KeyBinding Key="A"
Command="{x:Static h:DiagramCommands.SelectAll}"
CommandTarget="{Binding ElementName=diagram}"
Modifiers="Ctrl" />
<KeyBinding Key="Tab"
Command="{x:Static h:DiagramCommands.Next}"
CommandTarget="{Binding ElementName=diagram}" />
<KeyBinding Key="Delete"
Command="{x:Static h:DiagramCommands.DeleteSelected}"
CommandTarget="{Binding ElementName=diagram}" />
<KeyBinding Key="Left"
Command="{x:Static h:DiagramCommands.Previous}"
CommandTarget="{Binding ElementName=diagram}" />
<KeyBinding Key="Right"
Command="{x:Static h:DiagramCommands.Next}"
CommandTarget="{Binding ElementName=diagram}" />
</h:Diagram.InputBindings>-->
<h:Diagram.Layout>
<h:LocationLayout />
</h:Diagram.Layout>
Expand All @@ -388,10 +373,12 @@
</b:Interaction.Behaviors>
<b:Interaction.Triggers>
<b:EventTrigger EventName="ItemsChanged">
<b:InvokeCommandAction Command="{Binding ItemsChangedCommand}" PassEventArgsToCommand="True" />
<b:InvokeCommandAction Command="{Binding ItemsChangedCommand}"
PassEventArgsToCommand="True" />
</b:EventTrigger>
<b:EventTrigger EventName="SelectedPartChanged">
<b:InvokeCommandAction Command="{Binding SelectedPartChangedCommand}" PassEventArgsToCommand="True" />
<b:InvokeCommandAction Command="{Binding SelectedPartChangedCommand}"
PassEventArgsToCommand="True" />
</b:EventTrigger>
</b:Interaction.Triggers>
</h:Diagram>
Expand Down
4 changes: 2 additions & 2 deletions Source/Tests/H.Test.Setting/MainWindow.xaml
Original file line number Diff line number Diff line change
Expand Up @@ -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">
Expand Down
4 changes: 2 additions & 2 deletions Source/Tests/H.Test.SplashScreen/MainWindow.xaml
Original file line number Diff line number Diff line change
Expand Up @@ -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">
<UniformGrid>
Expand Down

0 comments on commit aea8fcb

Please sign in to comment.