From e8417bb7be218d0e7c680c9a35f6e552904a8b3a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E6=B4=81=20=E4=BB=BB?= Date: Tue, 25 Mar 2025 11:20:19 +0800 Subject: [PATCH] =?UTF-8?q?=E4=B8=8A=E4=BC=A0=E5=AE=8C=E6=88=90=E5=85=B3?= =?UTF-8?q?=E6=9C=BA?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- App.xaml.cs | 24 +++++++++++++++++++++++- ViewModel/Loyout/LoyoutViewModel.cs | 5 ++++- 2 files changed, 27 insertions(+), 2 deletions(-) diff --git a/App.xaml.cs b/App.xaml.cs index 0f30b23..bd92dbd 100644 --- a/App.xaml.cs +++ b/App.xaml.cs @@ -11,6 +11,9 @@ using HeBianGu.Systems.Identity; using HeBianGu.Systems.Setting; using Hopetry.Services; using SystemSetting = FileUploader.Models.SystemSetting; +using System.Configuration; +using System.ComponentModel.DataAnnotations; +using System.ComponentModel; namespace HeBianGu.App.Disk { @@ -103,7 +106,7 @@ namespace HeBianGu.App.Disk // 引导功能按钮 services.AddGuideViewPresenter(); services.AddHideWindowViewPresenter(); - //services.AddSettingViewPrenter(); + services.AddSettingViewPrenter(); //services.AddThemeRightToolViewPresenter(); services.AddThemeRightViewPresenter(); services.AddWindowCaptionViewPresenter(x => @@ -128,6 +131,9 @@ namespace HeBianGu.App.Disk protected override void Configure(IApplicationBuilder app) { base.Configure(app); + app.UseSetting(x => { + x.Settings.Add(MySetting.Instance); + }); app.UseStyle(); // Do:设置默认主题 app.UseLocalTheme(l => @@ -149,4 +155,20 @@ namespace HeBianGu.App.Disk }); } } + [Displayer(Name = "关机设置", GroupName = "是否关机")] + public class MySetting:LazySettingInstance + { + private bool _ison; + [DefaultValue(false)] + [Display(Name = "是否上传完成关机")] + public bool IsOn + { + get { return _ison; } + set + { + _ison = value; + RaisePropertyChanged("IsOn"); + } + } + } } \ No newline at end of file diff --git a/ViewModel/Loyout/LoyoutViewModel.cs b/ViewModel/Loyout/LoyoutViewModel.cs index 9850d7d..76b3298 100644 --- a/ViewModel/Loyout/LoyoutViewModel.cs +++ b/ViewModel/Loyout/LoyoutViewModel.cs @@ -176,7 +176,10 @@ namespace HeBianGu.App.Disk //更新总进度100% _sendViewModel.Progress = 100; // 关机 - Shutdown(); + if (MySetting.Instance.IsOn) + { + Shutdown(); + } // 停止计时器 timer.Stop(); }