Exemplo n.º 1
0
 public ConfigurationItem(string name, IConfiguration config, GroupVisiblity access, int priority)
 {
     Name          = name;
     this.config   = config;
     this.access   = access;
     this.priority = priority;
 }
Exemplo n.º 2
0
        /// <summary>
        /// Register configuration
        /// </summary>
        /// <param name="config"></param>
        /// <param name="access"></param>
        /// <param name="priority"></param>
        public static void RegisterConfiguration(string name, IConfiguration config, GroupVisiblity access, int priority)
        {
            int index = configs.Count;

            for (int i = 0; i < configs.Count; i++)
            {
                if (priority < configs[i].Priority)
                {
                    index = i;
                    break;
                }
            }
            configs.Insert(index, new ConfigurationItem(name, config, access, priority));
            config.Load();
        }
Exemplo n.º 3
0
 private static ConfigurationCollection GetConfigurations(UserGroup access)
 {
     _configurations.Clear();
     foreach (ConfigurationItem item in configs)
     {
         GroupVisiblity role = item.Access;
         if (!role.IsVisible(access))
         {
             continue;
         }
         IConfiguration c = item.Configuration;
         if (c == null)
         {
             continue;
         }
         _configurations.Add(c);
     }
     return(_configurations);
 }