Exemplo n.º 1
0
        /// <summary>
        /// Returns a list of <see cref="SettingsPropertyDescriptor"/> objects describing each property belonging
        /// to a settings group.
        /// </summary>
        /// <remarks>
        /// The specified group must refer to a locally installed settings class.
        /// </remarks>
        public static List <SettingsPropertyDescriptor> ListSettingsProperties(SettingsGroupDescriptor group)
        {
            Platform.CheckForNullReference(group, "group");

            var settingsClass = Type.GetType(group.AssemblyQualifiedTypeName);

            if (settingsClass == null)
            {
                throw new SettingsException(string.Format("{0} is not a locally installed settings group.", group.Name));
            }

            return(SettingsClassMetaDataReader.GetSettingsProperties(settingsClass)
                   .Select(property => new SettingsPropertyDescriptor(property)).ToList());
        }
Exemplo n.º 2
0
 private static ICollection <PropertyInfo> GetProperties(Type settingsClass, SettingScope scope)
 {
     return(SettingsClassMetaDataReader.GetSettingsProperties(settingsClass, scope));
 }