This question concerns C# and Design Mode.
Suppose you have a class called Clock with internal properties: Time (DateTime), and Description (string).
Suppose you created a custom class which derives from Control. You add to the custom class a property of type Clock:
private Clock currentTime = DateTime.Now();
public Clock CurrentTime{get{return currentTime;} set{currentTime = value}};
I am confused about getting property serialized.
If I add the attribute
[DesignerSerializationVisibility(DesignerSerializationVisibility.Content)]
before the property, there doesn't usually seem to be a problem with serialization.
A TypeConverter seems to also have a role in serializing an object. The TypeConverter also seems useful for providing display text in a property grid, for example.
Generally speaking, is the attribute DesignerSerializationVisibility(DesignerSerializationVisibility.Content)] sufficient for serialization, or is a TypeConverter needed in some instances so that Visual Studio knows how to create objects at Design Time?