Grofit
August 3rd, 2009, 02:28 AM
Hey,
Im just updating some of my user controls and ive just found out about the Browsable and DefaultValue attributes, which are great. However ive got certain properties that are more complex objects, like rectangles and points.
Now im sure that these can be done as alot of the .net controls have points and rectangles as attributes, but whenever i try:
[DefaultValue(new Point(0,0))]
public Point SomeProperty(){...}
It tells me that its an invalid type, which is fair enough as looking through the overloads the closes i can find is using an object type, however ive tried casting the new point to an object and it doesnt seem to like it.
So can anyone shed any light on the right way to do this?
Im just updating some of my user controls and ive just found out about the Browsable and DefaultValue attributes, which are great. However ive got certain properties that are more complex objects, like rectangles and points.
Now im sure that these can be done as alot of the .net controls have points and rectangles as attributes, but whenever i try:
[DefaultValue(new Point(0,0))]
public Point SomeProperty(){...}
It tells me that its an invalid type, which is fair enough as looking through the overloads the closes i can find is using an object type, however ive tried casting the new point to an object and it doesnt seem to like it.
So can anyone shed any light on the right way to do this?