System.Configuration.ConfigurationElement.CreateConfigurationPropertyFromAttributes C# (CSharp) Метод

CreateConfigurationPropertyFromAttributes() приватный статический Метод

private static CreateConfigurationPropertyFromAttributes ( PropertyInfo propertyInformation ) : ConfigurationProperty
propertyInformation System.Reflection.PropertyInfo
Результат ConfigurationProperty
        private static ConfigurationProperty CreateConfigurationPropertyFromAttributes(PropertyInfo propertyInformation) {
            Debug.Assert(propertyInformation != null, "propertyInformation != null");

            ConfigurationProperty result = null;

            ConfigurationPropertyAttribute attribProperty =
                Attribute.GetCustomAttribute(propertyInformation,
                                                typeof(ConfigurationPropertyAttribute)) as ConfigurationPropertyAttribute;

            // If there is no ConfigurationProperty attrib - this is not considered a property
            if (attribProperty != null) {
                result = new ConfigurationProperty(propertyInformation);
            }

            // Handle some special cases of property types
            if (result != null && typeof(ConfigurationElement).IsAssignableFrom(result.Type)) {
                ConfigurationPropertyCollection unused = null;

                PropertiesFromType(result.Type, out unused);
            }

            return result;
        }