Beispiel #1
0
 protected void SetFlag(TestPropertyFlags flags, bool value)
 {
     if (value)
     {
         pflags |= flags;
     }
     else
     {
         pflags &= ~flags;
     }
 }
Beispiel #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));
            }
        }
Beispiel #3
0
 protected void SetFlag(TestPropertyFlags flags, bool value)
 {
     if (value)
         pflags |= flags;
     else
         pflags &= ~flags;
 }
Beispiel #4
0
 //Helpers
 protected bool IsFlag(TestPropertyFlags flags)
 {
     return (pflags & flags) == flags;
 }
Beispiel #5
0
 //Helpers
 protected bool IsFlag(TestPropertyFlags flags)
 {
     return((pflags & flags) == flags);
 }
Beispiel #6
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));
            }
        }
Beispiel #7
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 );
			}
		}
Beispiel #8
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);
            }
        }