Пример #1
0
 public static ManagementOptions GetInstance(IConfiguration config)
 {
     if (_instance == null)
     {
         _instance = new ManagementOptions(config);
     }
     return(_instance);
 }
Пример #2
0
 public static ManagementOptions GetInstance()
 {
     if (_instance == null)
     {
         _instance = new ManagementOptions();
     }
     return(_instance);
 }
Пример #3
0
        public AbstractOptions(string sectionName, IConfiguration config)
        {
            if (sectionName == null)
            {
                throw new ArgumentNullException(nameof(sectionName));
            }

            if (config == null)
            {
                throw new ArgumentNullException(nameof(config));
            }

            Global = ManagementOptions.GetInstance(config);
            Global.EndpointOptions.Add(this);

            var section = config.GetSection(sectionName);

            if (section != null)
            {
                section.Bind(this);
            }
        }
Пример #4
0
 public static void Reset()
 {
     _instance = null;
 }
Пример #5
0
 public static void SetInstance(ManagementOptions mgmtOptions)
 {
     _instance = mgmtOptions;
 }
Пример #6
0
 public AbstractOptions()
 {
     Global = ManagementOptions.GetInstance();
     Global.EndpointOptions.Add(this);
 }