Пример #1
0
        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 += "|";
            }
        }
Пример #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);
        }
Пример #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);
 }
Пример #4
0
	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 += "|";
		}
	}
Пример #5
0
// Constructor
        internal DiffgramRemoveAttributes(XmlDiffAttribute sourceAttr) : base(0)
        {
            Debug.Assert(sourceAttr != null);
            _attributes = new AttributeInterval(sourceAttr, null);
        }
Пример #6
0
 internal AttributeInterval(XmlDiffAttribute attr, AttributeInterval next)
 {
     _firstAttr = attr;
     _lastAttr  = attr;
     _next      = next;
 }
Пример #7
0
 internal DiffgramRemoveAttributes(XmlDiffAttribute sourceAttr)
     : base(0UL)
 {
     this._attributes = new AttributeInterval(sourceAttr, (AttributeInterval)null);
 }
Пример #8
0
        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;
        }
Пример #9
0
 // Constructor
 internal DiffgramRemoveAttributes( XmlDiffAttribute sourceAttr )
     : base(0)
 {
     Debug.Assert( sourceAttr != null );
     _attributes = new AttributeInterval( sourceAttr, null );
 }
Пример #10
0
 internal AttributeInterval( XmlDiffAttribute attr, AttributeInterval next )
 {
     _firstAttr = attr;
     _lastAttr = attr;
     _next = next;
 }