[DefaultValue(typeof(Point), "0, 0")]
It is an example. Using a string to initialize a value is a necessary evil; the types of types that you can use in the attribute constructor are very limited. Only simple value types, string, type and one-dimensional array of them.
To do this, you need to write a TypeConverter for your structure:
[TypeConverter(typeof(PointConverter))] [
The documentation for type converters in the MSDN library is small. Using .NET converters, the source of which you can see using the Reference Source or reverse engineer with Reflector, is a great starting point for getting your own work. Follow the culture By the way.
source share