|
I can see the list well. Just one more thing. I tried to seralize & deseralize the List but I got stacked.
Since this information is linked to a diagram, I would like to serialize/deserialize the Enum |
We suggest you to add serialization entries for your custom properties in your custom symbol. Please refer the below code snippet to achieve your requirement.
''' <summary>
''' Serialization constructor for the MySymbol class.
''' </summary>
''' <param name="info">Serialization state information</param>
''' <param name="context">Streaming context information</param>
Protected Sub New(ByVal info As SerializationInfo, ByVal context As StreamingContext)
MyBase.New(info, context)
For Each entry As SerializationEntry In info
Select Case entry.Name
Case "Car"
m_car = CType(entry.Value, Cars)
Case "Price"
m_price = entry.Value.ToString()
End Select
Next entry
End Sub
Protected Overrides Sub GetObjectData(ByVal info As SerializationInfo, ByVal context As StreamingContext)
info.AddValue("Car", m_car)
info.AddValue("Price", m_price)
MyBase.GetObjectData(info, context)
End Sub |
|
As to the file browser button (as diagram dependant), I would like to have it in the propertyEditor. Would you have an example? The example you provided doesn't place the file path |
While adding custom property in customized class, we suggest you to add System “EditorAttribute()” with the parameter as “GetType(System.Windows.Forms.Design.FileNameEditor), GetType(System.Drawing.Design.UITypeEditor)” to change the file browser attribute in property grid. please refer to the below code example.
Code example:
[VB]
<EditorAttribute(GetType(System.Windows.Forms.Design.FileNameEditor), GetType(System.Drawing.Design.UITypeEditor))> _
|