增加保温层和整理管线的功能,修复自动保存功能等修复多个bug

This commit is contained in:
GG Z
2024-10-27 00:19:48 +08:00
parent b6647218be
commit 77655c9ef5
67 changed files with 3159 additions and 731 deletions

View File

@@ -1,5 +1,6 @@
using System.ComponentModel;
using System.ComponentModel.DataAnnotations;
using CommunityToolkit.Mvvm.ComponentModel;
using CommunityToolkit.Mvvm.Input;
@@ -7,27 +8,33 @@ namespace Sai.RvKits.RvCommon;
public partial class AutoSaveViewModel : ObservableValidator
{
public AutoSaveViewModel()
{
IsActiveAutoSave = Properties.Settings.Default.IsActiveAutoSave;
IntervalTime = Properties.Settings.Default.AutoSaveIntervalTime;
}
public AutoSaveViewModel()
{
IsActiveAutoSave = Properties.Settings.Default.IsActiveAutoSave;
IntervalTime = Properties.Settings.Default.AutoSaveIntervalTime;
}
[ObservableProperty]
private bool isActiveAutoSave;
private bool isActiveAutoSave;
//partial void OnIsActiveAutoSaveChanged(bool value)
//{
// throw new NotImplementedException();
//}
[Required(ErrorMessage = "不可为空")]
[DefaultValue(15)]
[DefaultValue(10)]
[NotifyDataErrorInfo]
[Range(5, 30, ErrorMessage = "输入值应在5~30分钟之间")]
[Range(1, 30, ErrorMessage = "输入值应在1~30分钟之间")]
[ObservableProperty]
private int intervalTime;
[RelayCommand]
private void Closing()
{
Properties.Settings.Default.IsActiveAutoSave = IsActiveAutoSave;
Properties.Settings.Default.AutoSaveIntervalTime = IntervalTime;
Properties.Settings.Default.Save();
}
[RelayCommand]
private void Closing()
{
Properties.Settings.Default.IsActiveAutoSave = IsActiveAutoSave;
Properties.Settings.Default.AutoSaveIntervalTime = IntervalTime;
Properties.Settings.Default.Save();
Variables.AutoSaveTimer.Interval = IntervalTime * 60 * 1000;
}
}