You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

86 lines
2.1 KiB

2 years ago
  1. using System;
  2. using System.Collections.Generic;
  3. using System.Collections.Specialized;
  4. using System.Linq;
  5. using System.Text;
  6. using System.Threading.Tasks;
  7. namespace Euro.Transfer.Jobs.TaskTips
  8. {
  9. public class Config : Base.ServiceConfig
  10. {
  11. #region 基本属性
  12. private string mDescription;
  13. private string mEnabled;
  14. private string mAssembly;
  15. private int mInterval;
  16. /// <summary>
  17. /// 说明
  18. /// </summary>
  19. public override string Description
  20. {
  21. get { return this.mDescription; }
  22. }
  23. /// <summary>
  24. /// 是否开启
  25. /// </summary>
  26. public override string Enabled
  27. {
  28. get { return this.mEnabled; }
  29. }
  30. /// <summary>
  31. /// 处理程序集
  32. /// </summary>
  33. public override string Assembly
  34. {
  35. get { return this.mAssembly; }
  36. }
  37. /// <summary>
  38. /// 间隔时间
  39. /// </summary>
  40. public override int Interval
  41. {
  42. get { return this.mInterval; }
  43. }
  44. #endregion
  45. #region 构造函数
  46. /// <summary>
  47. /// 构造函数,将配置项加载进对象
  48. /// </summary>
  49. public Config()
  50. {
  51. var nvc = Base.ServiceTools.GetSection(nameof(TaskTips));
  52. foreach (string s in nvc.Keys)
  53. {
  54. switch (s.ToLower())
  55. {
  56. //基本
  57. case "description":
  58. this.mDescription = nvc[s].ToString();
  59. break;
  60. case "enabled":
  61. this.mEnabled = nvc[s].ToString();
  62. break;
  63. case "assembly":
  64. this.mAssembly = nvc[s].ToString();
  65. break;
  66. case "interval":
  67. this.mInterval = int.Parse(nvc[s].ToString());
  68. break;
  69. }
  70. }
  71. }
  72. #endregion
  73. }
  74. }