Code:[XmlRootAttribute("Customer", Namespace="", IsNullable=false)] public class Customer { private Bitmap picture; public Customer() { } [XmlAttributeAttribute(DataType="date")] public System.DateTime DateTimeValue; public int CustomerID; public string CustomerName; public int Age; [XmlIgnoreAttribute()] public bool CustomerPaid; [XmlIgnoreAttribute()] public Bitmap Picture { get { return picture; } set { picture = value; } } . [XmlElementAttribute("Picture")] public byte[] PictureByteArray { get { if (picture != null) { TypeConverter BitmapConverter = TypeDescriptor.GetConverter(picture.GetType()); return (byte[]) BitmapConverter.ConvertTo(picture, typeof(byte[])); } else return null; } set { if (value != null) picture = new Bitmap(new MemoryStream(value)); else picture = null; } } [XmlArray ("Hobbies"), XmlArrayItem("Hobby", typeof(string))] public System.Collections.ArrayList Hobbies = new System.Collections.ArrayList(); [XmlArray ("EmailAddresses"), XmlArrayItem("EmailAddress", typeof(EmailAddress))] public System.Collections.ArrayList EmailAddresses = new System.Collections.ArrayList(); }




Reply With Quote