internal static void GetAddressOfAttributeInterval(AttributeInterval interval, XmlWriter xmlWriter)
        {
            Debug.Assert(interval != null);
            if (interval._next == null)
            {
                if (interval._firstAttr == interval._lastAttr)
                {
                    xmlWriter.WriteAttributeString("match", interval._firstAttr.GetRelativeAddress());
                    return;
                }

                if (interval._firstAttr._parent._firstChildNode == interval._firstAttr &&
                    (interval._lastAttr._nextSibling == null ||
                     interval._lastAttr._nextSibling.NodeType != XmlDiffNodeType.Attribute))
                {
                    xmlWriter.WriteAttributeString("match", "@*");
                    return;
                }
            }

            string match = string.Empty;

            for (;;)
            {
                XmlDiffAttribute attr = (XmlDiffAttribute)interval._firstAttr;
                for (;;)
                {
                    match += attr.GetRelativeAddress();

                    if (attr == interval._lastAttr)
                    {
                        break;
                    }
                    match += "|";
                    attr   = (XmlDiffAttribute)attr._nextSibling;
                    Debug.Assert(attr != null);
                }

                interval = interval._next;
                if (interval == null)
                {
                    xmlWriter.WriteAttributeString("match", match);
                    return;
                }

                match += "|";
            }
        }
Beispiel #2
0
        internal static void GetAddressOfAttributeInterval(
            AttributeInterval interval,
            XmlWriter xmlWriter)
        {
            if (interval._next == null)
            {
                if (interval._firstAttr == interval._lastAttr)
                {
                    xmlWriter.WriteAttributeString("match", interval._firstAttr.GetRelativeAddress());
                    return;
                }
                if (interval._firstAttr._parent._firstChildNode == interval._firstAttr && (interval._lastAttr._nextSibling == null || interval._lastAttr._nextSibling.NodeType != XmlDiffNodeType.Attribute))
                {
                    xmlWriter.WriteAttributeString("match", "@*");
                    return;
                }
            }
            var    str1 = string.Empty;
            string str2;

            while (true)
            {
                var xmlDiffAttribute = interval._firstAttr;
                while (true)
                {
                    str2 = str1 + xmlDiffAttribute.GetRelativeAddress();
                    if (xmlDiffAttribute != interval._lastAttr)
                    {
                        str1             = str2 + "|";
                        xmlDiffAttribute = (XmlDiffAttribute)xmlDiffAttribute._nextSibling;
                    }
                    else
                    {
                        break;
                    }
                }
                interval = interval._next;
                if (interval != null)
                {
                    str1 = str2 + "|";
                }
                else
                {
                    break;
                }
            }
            xmlWriter.WriteAttributeString("match", str2);
        }
Beispiel #3
0
 internal bool AddAttribute(XmlDiffAttribute srcAttr)
 {
     if (this._operationID != 0UL || srcAttr._parent != this._attributes._firstAttr._parent)
     {
         return(false);
     }
     if (srcAttr._nextSibling == this._attributes._firstAttr)
     {
         this._attributes._firstAttr = srcAttr;
     }
     else
     {
         this._attributes = new AttributeInterval(srcAttr, this._attributes);
     }
     return(true);
 }
	internal static void GetAddressOfAttributeInterval( AttributeInterval interval, XmlWriter xmlWriter )
	{
		Debug.Assert( interval != null );
		if ( interval._next == null )
		{
			if ( interval._firstAttr == interval._lastAttr )
			{
				xmlWriter.WriteAttributeString( "match", interval._firstAttr.GetRelativeAddress() );
				return;
			}

            if ( interval._firstAttr._parent._firstChildNode == interval._firstAttr && 
				 ( interval._lastAttr._nextSibling == null || 
				   interval._lastAttr._nextSibling.NodeType != XmlDiffNodeType.Attribute ) )
			{
				xmlWriter.WriteAttributeString( "match", "@*" );
				return;
			}
		}
			
		string match = string.Empty;
		
		for(;;)
		{
			XmlDiffAttribute attr = (XmlDiffAttribute) interval._firstAttr;
			for (;;)
			{
				match += attr.GetRelativeAddress();
		
				if ( attr == interval._lastAttr )
					break;
				match += "|";
				attr = (XmlDiffAttribute) attr._nextSibling;
				Debug.Assert( attr != null );
			}

			interval = interval._next;
			if ( interval == null )
			{
				xmlWriter.WriteAttributeString( "match", match );
				return;
			}
			
			match += "|";
		}
	}
// Constructor
        internal DiffgramRemoveAttributes(XmlDiffAttribute sourceAttr) : base(0)
        {
            Debug.Assert(sourceAttr != null);
            _attributes = new AttributeInterval(sourceAttr, null);
        }
 internal AttributeInterval(XmlDiffAttribute attr, AttributeInterval next)
 {
     _firstAttr = attr;
     _lastAttr  = attr;
     _next      = next;
 }
Beispiel #7
0
 internal DiffgramRemoveAttributes(XmlDiffAttribute sourceAttr)
     : base(0UL)
 {
     this._attributes = new AttributeInterval(sourceAttr, (AttributeInterval)null);
 }
        internal bool AddAttribute( XmlDiffAttribute srcAttr )
        {
            if ( _operationID != 0 ||
             srcAttr._parent != _attributes._firstAttr._parent )
            return false;

            if ( srcAttr._nextSibling == _attributes._firstAttr )
            _attributes._firstAttr = srcAttr;
            else
            _attributes = new AttributeInterval( srcAttr, _attributes );

            return true;
        }
 // Constructor
 internal DiffgramRemoveAttributes( XmlDiffAttribute sourceAttr )
     : base(0)
 {
     Debug.Assert( sourceAttr != null );
     _attributes = new AttributeInterval( sourceAttr, null );
 }
 internal AttributeInterval( XmlDiffAttribute attr, AttributeInterval next )
 {
     _firstAttr = attr;
     _lastAttr = attr;
     _next = next;
 }