79 lines
2.2 KiB
C#
79 lines
2.2 KiB
C#
|
|
using System;
|
|||
|
|
using System.Collections.Generic;
|
|||
|
|
using System.ComponentModel;
|
|||
|
|
using System.Linq;
|
|||
|
|
using System.Text;
|
|||
|
|
using System.Threading.Tasks;
|
|||
|
|
using System.Windows.Controls;
|
|||
|
|
|
|||
|
|
namespace Future.Contract
|
|||
|
|
{
|
|||
|
|
/// <summary>
|
|||
|
|
/// 配置声明
|
|||
|
|
/// </summary>
|
|||
|
|
public class Config : INotifyPropertyChanged
|
|||
|
|
{
|
|||
|
|
/// <summary>
|
|||
|
|
/// 标识码
|
|||
|
|
/// </summary>
|
|||
|
|
public string Code { get; set; }
|
|||
|
|
/// <summary>
|
|||
|
|
/// 显示名
|
|||
|
|
/// </summary>
|
|||
|
|
public string Title { get; set; }
|
|||
|
|
/// <summary>
|
|||
|
|
/// 描述
|
|||
|
|
/// </summary>
|
|||
|
|
public string Remark { get; set; }
|
|||
|
|
/// <summary>
|
|||
|
|
/// 分组名
|
|||
|
|
/// </summary>
|
|||
|
|
public string Group { get; set; }
|
|||
|
|
/// <summary>
|
|||
|
|
/// 用于存储配置的默认值
|
|||
|
|
/// </summary>
|
|||
|
|
private string mValue = "";
|
|||
|
|
/// <summary>
|
|||
|
|
/// 值
|
|||
|
|
/// </summary>
|
|||
|
|
public string Value
|
|||
|
|
{
|
|||
|
|
get => this.mValue;
|
|||
|
|
set
|
|||
|
|
{
|
|||
|
|
if (this.mValue == value)
|
|||
|
|
{
|
|||
|
|
this.Value = value;
|
|||
|
|
this.PropertyChanged?.Invoke(this, new PropertyChangedEventArgs("Value"));
|
|||
|
|
}
|
|||
|
|
}
|
|||
|
|
}
|
|||
|
|
/// <summary>
|
|||
|
|
/// 默认值
|
|||
|
|
/// </summary>
|
|||
|
|
public string Default { get; set; }
|
|||
|
|
|
|||
|
|
public event PropertyChangedEventHandler PropertyChanged;
|
|||
|
|
|
|||
|
|
/// <summary>
|
|||
|
|
/// 辅助模式:重置配置=False,智能配置=True;
|
|||
|
|
/// </summary>
|
|||
|
|
public bool AssistMode { get; set; } = false;
|
|||
|
|
/// <summary>
|
|||
|
|
/// 配置数据格式有效性校验
|
|||
|
|
/// </summary>
|
|||
|
|
/// <returns>如果失败则返回原因</returns>
|
|||
|
|
public virtual string InputVerify() { return null; }
|
|||
|
|
/// <summary>
|
|||
|
|
/// 可用性校验及解决方案返回
|
|||
|
|
/// </summary>
|
|||
|
|
/// <returns>如果失败则返回解决问题使用的专用界面</returns>
|
|||
|
|
public virtual Control UsabilityCheck() { return null; }
|
|||
|
|
/// <summary>
|
|||
|
|
/// 重置参数的默认值
|
|||
|
|
/// </summary>
|
|||
|
|
/// <returns>如果失败则返回原因</returns>
|
|||
|
|
public virtual string Resetting() { return null; }
|
|||
|
|
}
|
|||
|
|
}
|