Example #1
0
		/// <summary>
		/// Adds new attribute to the node decorations.
		/// </summary>
		/// <param name="attr">An attriubute.</param>
		protected void Add( object attr )
		{
			if( attr is NodePolicyAttribute )
			{
				if( _nodePolicy == null )
					_nodePolicy = (NodePolicyAttribute)attr;
			}
			else if( attr is ConverterAttribute )
			{
				if( _converter == null )
					_converter = (ConverterAttribute)attr;
			}
			else if( attr is TransparentAttribute ) 
			{
				_transparent = (TransparentAttribute)attr;
			}
			else if( attr is SkipNavigableRootAttribute ) 
			{
				_skipNavigableRoot = (SkipNavigableRootAttribute)attr;
			}
			else if( attr is ChildXmlElementAttribute ) 
			{
				_childXmlElementName = (ChildXmlElementAttribute)attr;
			}
			else if( attr is XmlRootAttribute ) 
			{
				if( _xmlRoot == null ) 
					_xmlRoot = (XmlRootAttribute)attr;
			}
			else if( attr is XmlAttributeAttribute ) 
			{
				if( NodeTypeUndefined() )
					_xmlAttribute = (XmlAttributeAttribute)attr;
			}
			else if( attr is XmlElementAttribute ) 
			{
				if( NodeTypeUndefined() ) 
				{
					_xmlElement = (XmlElementAttribute)attr;
					_isNullable = _xmlElement.IsNullable;
				}
			}
			else if( attr is XmlAnyElementAttribute ) 
			{
				if( NodeTypeUndefined() )
					_xmlAnyElement = (XmlAnyElementAttribute)attr;
			}
			else if( attr is XmlTextAttribute ) 
			{
				if( NodeTypeUndefined() )
					_xmlText = (XmlTextAttribute)attr;
			}
			else if( attr is XmlIgnoreAttribute ) 
			{
				_xmlIgnore = (XmlIgnoreAttribute)attr;
			}
			else if( attr is XmlTypeAttribute ) 
			{
				_xmlType = (XmlTypeAttribute)attr;
			}
		}
Example #2
0
 /// <summary>
 /// Adds new attribute to the node decorations.
 /// </summary>
 /// <param name="attr">An attriubute.</param>
 protected void Add(object attr)
 {
     if (attr is NodePolicyAttribute)
     {
         if (_nodePolicy == null)
         {
             _nodePolicy = (NodePolicyAttribute)attr;
         }
     }
     else if (attr is ConverterAttribute)
     {
         if (_converter == null)
         {
             _converter = (ConverterAttribute)attr;
         }
     }
     else if (attr is TransparentAttribute)
     {
         _transparent = (TransparentAttribute)attr;
     }
     else if (attr is SkipNavigableRootAttribute)
     {
         _skipNavigableRoot = (SkipNavigableRootAttribute)attr;
     }
     else if (attr is ChildXmlElementAttribute)
     {
         _childXmlElementName = (ChildXmlElementAttribute)attr;
     }
     else if (attr is XmlRootAttribute)
     {
         if (_xmlRoot == null)
         {
             _xmlRoot = (XmlRootAttribute)attr;
         }
     }
     else if (attr is XmlAttributeAttribute)
     {
         if (NodeTypeUndefined())
         {
             _xmlAttribute = (XmlAttributeAttribute)attr;
         }
     }
     else if (attr is XmlElementAttribute)
     {
         if (NodeTypeUndefined())
         {
             _xmlElement = (XmlElementAttribute)attr;
             _isNullable = _xmlElement.IsNullable;
         }
     }
     else if (attr is XmlAnyElementAttribute)
     {
         if (NodeTypeUndefined())
         {
             _xmlAnyElement = (XmlAnyElementAttribute)attr;
         }
     }
     else if (attr is XmlTextAttribute)
     {
         if (NodeTypeUndefined())
         {
             _xmlText = (XmlTextAttribute)attr;
         }
     }
     else if (attr is XmlIgnoreAttribute)
     {
         _xmlIgnore = (XmlIgnoreAttribute)attr;
     }
     else if (attr is XmlTypeAttribute)
     {
         _xmlType = (XmlTypeAttribute)attr;
     }
 }