Enter this topic and press ctrl+v in a reply

  • Thread starter Thread starter Mangofett
  • Start date Start date
  • Views Views 76,748
  • Replies Replies 1,007
Code:
 Â Â Â Â Â Â Â Â Â Â//if this is a serialized property
         Âif (Attribute.IsDefined(property, typeof(XmlSerializedAttribute)))
         Â{
           Â//obtain it's value
           ÂXmlSerializedAttribute attribute = (XmlSerializedAttribute)Attribute.GetCustomAttribute(property, typeof(XmlSerializedAttribute), false);
           Âobject value = property.GetValue(this, null);

           Âif (typeof(IXmlSerializable).IsAssignableFrom(property.PropertyType))
           Â{
             Â//if there is actually a value
             Âif (value != null)
             Â{
               Â// this child implements ToXml(), so cascade the call
               ÂrootElem.InnerXml += ((IXmlSerializable)value).ToXml(attribute.ElementName);
             Â}
           Â}
           Âelse
           Â{
             ÂXmlElement childElem = doc.CreateElement(attribute.ElementName);

             ÂchildElem.InnerText = value.ToString();
             ÂrootElem.AppendChild(childElem);
           Â}
         Â}

Migrating business logic code... kinda boring
dry.gif
 
Sexy Purple Ruffle Basque

Erm my Mrs was on this earlier. Maybe I'm in for a treat soon?
 
JAG KLARADE METROID PRIME 3! Mohahahaha! Vilket jääävla spel
biggrin.gif


-----------------------------------------

Yeah, it's swedish but I think most of you know what it means anyway (more or less)
tongue.gif
 
ZeWarrior: i know software that does that! PM me for it.

vvv

awesome freeware list

^^^
looking for content for my siggy topic
 

Site & Scene News

Popular threads in this forum