Store/retrieve font in user settings and isolated storage
-
I have class FormData { public System.Drawing.Font TextBoxFont; } I need to read/store this class in isolated storage in Winforms application and also in user settings. Using XmlSerializer formatter = new XmlSerializer(typeof(FormData), "MyNameSpace"); causes exception System.Drawing.Font cannot be serialized because it does not have a parameterless constructor. How to fix ?
Andrus
-
I have class FormData { public System.Drawing.Font TextBoxFont; } I need to read/store this class in isolated storage in Winforms application and also in user settings. Using XmlSerializer formatter = new XmlSerializer(typeof(FormData), "MyNameSpace"); causes exception System.Drawing.Font cannot be serialized because it does not have a parameterless constructor. How to fix ?
Andrus
AndrusM wrote:
How to fix ?
Well you are going to want to check out how to control Serialization, there are a number of ways. You probably want to start with this[^] You may end up implementing IXmlSerializable[^] It shouldn't take you long to get up to speed, I have used it in the past and it's fairly simple.
led mike