DefaultPropertyValue Mutator
Mutator that takes initializes a property to the value specified in the
DefaultValueAttribute attribute.
- Defined in: CciSharp.DefaultPropertyValue.dll
Example
using System.ComponentModel;
class Foo {
[DefaultValue(10)]
public int Value {get; private set;}
public Foo() { }
}
class Foo {
[DefaultValue(10)]
public int Value {get; private set;}
public Foo() {
this.Value = 10;
}
}
Requirements:
- an non-virtual instance auto-property with a setter
- marked with a System.ComponentModel.DefaultValueAttribute.
- the attribute argument must match the property type