将以往的代码复制到代码库
This commit is contained in:
78
Future.Contract/Business/Config.cs
Normal file
78
Future.Contract/Business/Config.cs
Normal file
@@ -0,0 +1,78 @@
|
||||
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; }
|
||||
}
|
||||
}
|
||||
13
Future.Contract/Business/IArchiveRetriever.cs
Normal file
13
Future.Contract/Business/IArchiveRetriever.cs
Normal file
@@ -0,0 +1,13 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
|
||||
namespace Future.Contract
|
||||
{
|
||||
public interface IArchiveRetriever
|
||||
{
|
||||
void Init(IBusinessModule module);
|
||||
}
|
||||
}
|
||||
27
Future.Contract/Business/IBusinessModule.cs
Normal file
27
Future.Contract/Business/IBusinessModule.cs
Normal file
@@ -0,0 +1,27 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
using System.Windows;
|
||||
using System.Security;
|
||||
using System.Windows.Shapes;
|
||||
|
||||
namespace Future.Contract
|
||||
{
|
||||
/// <summary>
|
||||
/// 业务模块的接口
|
||||
/// </summary>
|
||||
[SecurityCritical]
|
||||
public interface IBusinessModule
|
||||
{
|
||||
void Init(IModuleContainer container);
|
||||
|
||||
Path ICON { get; }
|
||||
string ModuleTitle { get; }
|
||||
string ModuleRemark { get; }
|
||||
UIElement ModuleMainview { get; }
|
||||
|
||||
Thickness IconMargin { get; }
|
||||
}
|
||||
}
|
||||
12
Future.Contract/Business/IModuleContainer.cs
Normal file
12
Future.Contract/Business/IModuleContainer.cs
Normal file
@@ -0,0 +1,12 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
|
||||
namespace Future.Contract
|
||||
{
|
||||
public interface IModuleContainer
|
||||
{
|
||||
}
|
||||
}
|
||||
43
Future.Contract/Business/Permit.cs
Normal file
43
Future.Contract/Business/Permit.cs
Normal file
@@ -0,0 +1,43 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
|
||||
namespace Future.Contract
|
||||
{
|
||||
/// <summary>
|
||||
/// 权限声明
|
||||
/// </summary>
|
||||
public class Permit
|
||||
{
|
||||
/// <summary>
|
||||
/// 权限码
|
||||
/// </summary>
|
||||
public string Code { get; set; }
|
||||
/// <summary>
|
||||
/// 权限名
|
||||
/// </summary>
|
||||
public string Title { get; set; }
|
||||
/// <summary>
|
||||
/// 备注信息
|
||||
/// </summary>
|
||||
public string Remark { get; set; }
|
||||
/// <summary>
|
||||
/// 值
|
||||
/// </summary>
|
||||
public bool Value { get; set; }
|
||||
/// <summary>
|
||||
/// 默认值
|
||||
/// </summary>
|
||||
public bool Default { get; set; }
|
||||
/// <summary>
|
||||
/// 权限分组
|
||||
/// </summary>
|
||||
public string Group { get; set; }
|
||||
/// <summary>
|
||||
/// 前置权限
|
||||
/// </summary>
|
||||
public List<string> PrePermits { get; set; } = new List<string>();
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user