public SettingsGroupsCollection(IEnumerable <Type> taskSettings) { foreach (var taskType in taskSettings) { var groups = SettingsIni.GetSections(taskType.Name); groups.ForEach(x => _list.Add(SettingsIni.GetGroupName(x))); } _list = _list.Distinct().ToList(); }
public SettingsGroupRepresentDictionary(string groupName, IEnumerable <Type> taskSettings) { GroupName = groupName; var typeMap = taskSettings.ToDictionary(t => t.Name); var sections = SettingsIni.GetSectionsByGroupName(groupName); foreach (var section in sections) { var className = SettingsIni.GetClassName(section); if (typeMap.ContainsKey(className)) { Add(className, Activator.CreateInstance(typeMap[className], groupName)); } } }
public SettingsRepresentCollection(Type settingRepresentType) { SettingsRepresentTypeName = settingRepresentType.Name; SettingsIni.GetSections(SettingsRepresentTypeName).ForEach(t => _list.Add(Activator.CreateInstance(settingRepresentType, t))); }