public void WriteXml(XmlWriter writer)
        {
            writer.WriteElementString("BaseValue", m_BaseValue.ToString());

            writer.WriteStartElement("Modifiers");
            int count = m_Modifiers.Count;

            for (int i = 0; i < count; ++i)
            {
                writer.WriteStartElement("Modifier");

                var mod = m_Modifiers[i];
                writer.WriteElementString("Type", mod.GetType().AssemblyQualifiedName);

                XMLHelpers.Serialize(mod, writer);

                writer.WriteEndElement();
            }

            writer.WriteEndElement();
        }
Ejemplo n.º 2
0
        public void WriteXml(XmlWriter writer)
        {
            int typeCount = m_AllowedTypes.Count;

            if (typeCount > 0)
            {
                writer.WriteStartElement("AllowedTypes");
                for (int i = 0; i < typeCount; i++)
                {
                    writer.WriteStartElement("PropertyType")
                    ;
                    writer.WriteElementString("Type", m_AllowedTypes[i].Type.FullName);
                    if (!string.IsNullOrEmpty(m_AllowedTypes[i].FilterData))
                    {
                        writer.WriteElementString("FilterData", m_AllowedTypes[i].FilterData);
                    }

                    writer.WriteEndElement();
                }
                writer.WriteEndElement();
            }

            int itemCount = Items.Count;

            if (itemCount > 0)
            {
                writer.WriteStartElement("Items");
                for (int i = 0; i < itemCount; i++)
                {
                    writer.WriteStartElement("Item");

                    writer.WriteElementString("Type", Items[i].GetType().FullName);

                    XMLHelpers.Serialize(Items[i], writer);

                    writer.WriteEndElement();
                }
                writer.WriteEndElement();
            }
        }
Ejemplo n.º 3
0
 public void WriteXml(XmlWriter writer)
 {
     writer.WriteElementString("Name", m_Name);
     writer.WriteElementString("PropertyType", Property.GetType().FullName);
     XMLHelpers.Serialize(Property, writer);
 }