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