public ConfigurationItem(string name, IConfiguration config, GroupVisiblity access, int priority) { Name = name; this.config = config; this.access = access; this.priority = priority; }
/// <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(); }
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); }