77 lines
1.8 KiB
C#
77 lines
1.8 KiB
C#
using Api.Framework.Tools;
|
||
using System;
|
||
using System.Collections.Generic;
|
||
using System.IO;
|
||
using System.Linq;
|
||
using System.Runtime.Serialization;
|
||
using System.Runtime.Serialization.Formatters.Binary;
|
||
using System.Text;
|
||
using System.Threading.Tasks;
|
||
using System.Web.Script.Serialization;
|
||
using System.Windows.Forms;
|
||
|
||
namespace Api.Framework.SDK
|
||
{
|
||
/// <summary>
|
||
/// 配置文件属性
|
||
/// </summary>
|
||
public class ConfigAttribute : Attribute
|
||
{
|
||
/// <summary>
|
||
/// 保存的文件名
|
||
/// </summary>
|
||
public string Name { get; set; }
|
||
|
||
/// <summary>
|
||
/// 是否存档到数据库
|
||
/// </summary>
|
||
public bool IsSaveDB { get; set; }
|
||
|
||
|
||
private byte[] _encKey;
|
||
/// <summary>
|
||
/// 16位密钥 - 不填写则使用系统秘钥
|
||
/// </summary>
|
||
public byte[] EncKey
|
||
{
|
||
get { return _encKey; }
|
||
set
|
||
{
|
||
if (value != null)
|
||
{
|
||
if (value.Length != 16) throw new Exception("长度必须等于16字节!");
|
||
_encKey = value;
|
||
}
|
||
}
|
||
}
|
||
|
||
/// <summary>
|
||
/// 是否加密数据信息 默认为False
|
||
/// </summary>
|
||
public bool IsEncryption { get; set; }
|
||
public ConfigAttribute()
|
||
{
|
||
this.IsSaveDB = true;
|
||
this._encKey = new byte[16];
|
||
}
|
||
|
||
}
|
||
|
||
/// <summary>
|
||
/// 配置属性
|
||
/// </summary>
|
||
public class ParamAttribute : Attribute
|
||
{
|
||
/// <summary>
|
||
/// 标签信息 - 一般表示变量
|
||
/// </summary>
|
||
public string[] Tags { get; set; }
|
||
|
||
/// <summary>
|
||
/// 描述信息
|
||
/// </summary>
|
||
public string Describe { get; set; }
|
||
|
||
}
|
||
}
|