OnEnvironmentInitAttribute.cs 808 B

12345678910111213141516171819202122232425262728
  1. using System;
  2. namespace IFramework
  3. {
  4. /// <summary>
  5. /// 环境初始化时候调用被标记的静态类
  6. /// </summary>
  7. [AttributeUsage(AttributeTargets.Class, AllowMultiple = false, Inherited = false)]
  8. public class OnEnvironmentInitAttribute : Attribute
  9. {
  10. /// <summary>
  11. /// 配合初始化的版本 0,
  12. /// 默认初始化,其他自行规定,用于区分环境,
  13. /// 一般某个环境特有的静态类和环境编号一致
  14. /// </summary>
  15. public EnvironmentType type { get; }
  16. /// <summary>
  17. /// Ctor
  18. /// </summary>
  19. /// <param name="type"></param>
  20. public OnEnvironmentInitAttribute(EnvironmentType type = EnvironmentType.None)
  21. {
  22. this.type = type;
  23. }
  24. }
  25. }