/// <summary>Copy a whole set of attributes.</summary> public virtual void SetAttributes(IAttributes atts) { if (atts == null) { throw new ArgumentNullException("atts"); } Clear(); int attLen = atts.Length; if (Capacity < attLen) { Capacity = attLen; } for (int attIndx = 0; attIndx < attLen; attIndx++) { InternalSetAttribute( ref this.atts[attIndx], atts.GetUri(attIndx), atts.GetLocalName(attIndx), atts.GetQName(attIndx), atts.GetType(attIndx), atts.GetValue(attIndx), atts.IsSpecified(attIndx)); } }
/// <summary>Add an attribute taken from an existing set of attributes.</summary> /// <returns>Index of added attribute.</returns> public virtual int AddAttribute(IAttributes atts, int index) { if (atts == null) { throw new ArgumentNullException("atts"); } return(AddAttribute( atts.GetUri(index), atts.GetLocalName(index), atts.GetQName(index), atts.GetType(index), atts.GetValue(index), atts.IsSpecified(index))); }