Exemple #1
0
 protected void SetFlag(TestPropertyFlags flags, bool value)
 {
     if (value)
         pflags |= flags;
     else
         pflags &= ~flags;
 }
Exemple #2
0
        protected void AddProperty(XElement element, string name, object value, TestPropertyFlags flags)
        {
            //Ignore all the properties that have no name or value (as to not bloat the xml)
            if (name == null || value == null)
                return;

            //How to serialize (elements or attributes)
            if ((flags & TestPropertyFlags.MultipleValues) != 0)
            {
                AddValue(element, name, value);
            }
            else
            {
                element.SetAttributeValue(name, StringEx.ToString(value));
            }
        }
Exemple #3
0
 //Helpers
 protected bool IsFlag(TestPropertyFlags flags)
 {
     return (pflags & flags) == flags;
 }
Exemple #4
0
		protected void			AddProperty(XmlNode element, string name, object value, TestPropertyFlags flags)
		{
			//Ignore all the properties that have no name or value (as to not bloat the xml)
			if(name == null || value == null)
				return;
				
			//How to serialize (elements or attributes)
			if((flags & TestPropertyFlags.MultipleValues) != 0)
			{
				//Property as Element
				AddValue(element, name, value);
			}
			else
			{
				//Property as Attribute
				XmlAttribute xmlattribute  = _xmldoc.CreateAttribute(name);
				xmlattribute.Value         = StringEx.ToString(value);
				element.Attributes.Append( xmlattribute );
			}
		}