Your Privacy Matters: We use our own and third-party cookies to improve your experience on our website. By continuing to use the website we understand that you accept their use. Cookie Policy
410
LabelStyle
posted

Is they a method for serialize a LableStyle similiar to how we serialize a font. See code snipit:

I take the return value and write to xml for saving user set properties. I want to perform the same thing on Annotation.TextStyle that inherits from a LableStyle.

 

 

 

Using

 

 

 

stream As New MemoryStream()

 

 

 

Dim formatter As New BinaryFormatter()

formatter.Serialize(stream, font)

 

 

 

Return Convert.ToBase64String(stream.ToArray())

 

 

 

End Using

Parents
  • 48586
    posted

    Hello ,

     

    If the class is not marked as serializeable , you could use XmlSerializer which will serialize public properties via reflector, but if the calls or some of its fields doesn’t have defined constructors, you wouldn’t be able to use XmlSerializer to desterilize the object, but you will be able to read the data from the serialized XML and to set those properties manually.  More information about XmlSerializer you could find on the following link:

    http://msdn.microsoft.com/en-us/library/system.xml.serialization.xmlserializer.aspx

     

    Please let me know if you have any further questions.

Reply Children