using Euro.Transfer.Base; using System; using System.Collections.Generic; using System.Collections.Specialized; using System.Linq; using System.Text; using System.Threading.Tasks; namespace Euro.Transfer.Jobs.Transfer { public class Config : ServiceConfig { #region 基本属性 private string mDescription; private string mEnabled; private string mAssembly; private int mInterval; /// /// 说明 /// public override string Description { get { return this.mDescription; } } /// /// 是否开启 /// public override string Enabled { get { return this.mEnabled; } } /// /// 处理程序集 /// public override string Assembly { get { return this.mAssembly; } } /// /// 间隔时间 /// public override int Interval { get { return this.mInterval; } } #endregion #region 构造函数 /// /// 构造函数,将配置项加载进对象 /// public Config() { var nvc = ServiceTools.GetSection(nameof(Transfer)); foreach (string s in nvc.Keys) { switch (s.ToLower()) { //基本 case "description": this.mDescription = nvc[s].ToString(); break; case "enabled": this.mEnabled = nvc[s].ToString(); break; case "assembly": this.mAssembly = nvc[s].ToString(); break; case "interval": this.mInterval = int.Parse(nvc[s].ToString()); break; } } } #endregion } }