{
object defaultValue = null;
- ConstructorInit(name, type, ConfigurationPropertyOptions.None, null, null, null);
+ ConstructorInit(name, type, ConfigurationPropertyOptions.None, null, null);
if (type == typeof(string))
{
ConfigurationPropertyOptions options,
string description)
{
- ConstructorInit(name, type, options, validator, typeConverter, description);
+ ConstructorInit(name, type, options, validator, typeConverter);
SetDefaultValue(defaultValue);
}
info.PropertyType,
propertyAttribute.Options,
validator,
- typeConverter,
- descriptionAttribute?.Description);
+ typeConverter);
// Figure out the default value
InitDefaultValueFromTypeInfo(propertyAttribute, defaultValueAttribute);
+
+ // Get the description
+ if (!string.IsNullOrEmpty(descriptionAttribute?.Description))
+ Description = descriptionAttribute.Description;
}
public string Name { get; private set; }
- public string Description { get; private set; }
+ public string Description { get; }
internal string ProvidedName { get; private set; }
Type type,
ConfigurationPropertyOptions options,
ConfigurationValidatorBase validator,
- TypeConverter converter,
- string description)
+ TypeConverter converter)
{
if (typeof(ConfigurationSection).IsAssignableFrom(type))
{
}
Name = name;
- Description = description;
Type = type;
_options = options;
Validator = validator;
Assert.IsType<DummyCanConverter>(property.Converter);
}
- [Fact]
- public void DescriptionValueIsExposed()
- {
- FooFailsValidator validator = new FooFailsValidator();
- DummyCanConverter converter = new DummyCanConverter();
- ConfigurationProperty property = new ConfigurationProperty("foo", typeof(MyConvertableClass), null, converter, validator, ConfigurationPropertyOptions.None, "bar");
- Assert.Equal("bar", property.Description);
- }
-
[TypeConverter(typeof(DummyCantConverter))]
public class MyUnconvertableClass
{