Ejemplo n.º 1
0
        public static bool IsSettingFor <TSetting>(TSetting item, SettingsCollectionResourceType type)
            where TSetting : ISetting
        {
            var itemType          = item.GetType();
            var matchingAttribute = GetAttribute <SettingsApplicationAttribute>(itemType);

            return(matchingAttribute != null && type == matchingAttribute.ResourceType);
        }
Ejemplo n.º 2
0
 internal SettingsCollection(SettingsCollectionResourceType type, params ISetting[] settings)
 {
     Type         = type;
     SettingsList = new List <ISetting>();
     if (settings.Length > 0)
     {
         new List <ISetting>(settings).ForEach(s => Add(s));
     }
 }
Ejemplo n.º 3
0
 public static bool IsSettingFor <TSetting>(TSetting item, SettingsCollectionResourceType type)
     where TSetting : ISetting
 {
     return(item.GetResourceType() == SettingsCollectionResourceType.Any ||
            type == item.GetResourceType());
 }