Saturday

How to create abstract object with serialization methods.

C#,CSharp : it will be easy to serialize/deserialize inherited object into xml string
   23     abstract public class AbstractXMLObject
   24     {
   25         public string XML
   26         {
   27             get
   28             {
   29                 XmlSerializer xmlSerializer = new XmlSerializer(this.GetType());
   30                 StringWriter stringWriter = new StringWriter();
   31                 xmlSerializer.Serialize(stringWriter, this);
   32                 return stringWriter.ToString();
   33             }
   34             set
   35             {
   36                 XmlSerializer xmlSerializer = new XmlSerializer(this.GetType());
   37                 StringReader stringReader = new StringReader(value);
   38                 this = xmlSerializer.Deserialize(stringReader);
   39             }
   40         }
   41     }

No comments:

imagemagic add text to image

rem different types of text annotations on existing images rem cyan yellow orange gold rem -gravity SouthWest rem draw text and anno...