/// <summary>
 /// Creates a synchronized (thread-safe) wrapper for an
 /// <see cref="HtmlAttributeCollection"/> instance.
 /// </summary>
 /// <returns>
 /// A thread-safe wrapper for <see cref="HtmlAttributeCollection"/>.
 /// </returns>
 public static HtmlAttributeCollection Synchronized(HtmlAttributeCollection list)
 {
     if (list == null)
     {
         throw new ArgumentNullException("list");
     }
     return(new SyncHtmlAttributeCollection(list));
 }
 /// <summary>
 /// Creates a read-only wrapper for an
 /// <see cref="HtmlAttributeCollection"/> instance.
 /// </summary>
 /// <returns>
 /// An <see cref="HtmlAttributeCollection"/> wrapper that is read-only.
 /// </returns>
 public static HtmlAttributeCollection ReadOnly(HtmlAttributeCollection list)
 {
     if (list == null)
     {
         throw new ArgumentNullException("list");
     }
     return(new ReadOnlyHtmlAttributeCollection(list));
 }
        /// <summary>
        /// Creates a shallow copy of the <see cref="HtmlAttributeCollection"/>.
        /// </summary>
        public virtual object Clone()
        {
            HtmlAttributeCollection newColl = new HtmlAttributeCollection(_count);

            Array.Copy(_array, 0, newColl._array, 0, _count);
            newColl._count   = _count;
            newColl._version = _version;

            return(newColl);
        }
        /// <summary>
        /// Adds the elements of another <see cref="HtmlAttributeCollection"/>
        /// to the current <see cref="HtmlAttributeCollection"/>.
        /// </summary>
        /// <param name="x">The <see cref="HtmlAttributeCollection"/> whose
        /// elements should be added to the end of the current
        /// <see cref="HtmlAttributeCollection"/>.</param>
        /// <returns>The new <see cref="HtmlAttributeCollection.Count"/> of the
        /// <see cref="HtmlAttributeCollection"/>.</returns>
        public virtual int AddRange(HtmlAttributeCollection x)
        {
            if (_count + x.Count >= _array.Length)
            {
                EnsureCapacity(_count + x.Count);
            }

            Array.Copy(x._array, 0, _array, _count, x.Count);
            _count += x.Count;
            _version++;

            return(_count);
        }
 internal ReadOnlyHtmlAttributeCollection(HtmlAttributeCollection list) : base(Tag.Default)
 {
     _collection = list;
 }
 public override int AddRange(HtmlAttributeCollection x)
 {
     lock (this._root)
         return(_collection.AddRange(x));
 }
 internal SyncHtmlAttributeCollection(HtmlAttributeCollection list) : base(Tag.Default)
 {
     _root       = list.SyncRoot;
     _collection = list;
 }
 /// <summary>
 /// Initializes a new instance of the <c>Enumerator</c> class.
 /// </summary>
 /// <param name="tc"></param>
 internal Enumerator(HtmlAttributeCollection tc)
 {
     _collection = tc;
     _index      = -1;
     _version    = tc._version;
 }
 /// <summary>
 /// Initializes a new instance of the <see cref="HtmlAttributeCollection"/>
 /// class that contains elements copied from the specified
 /// <see cref="HtmlAttributeCollection"/>.
 /// </summary>
 /// <param name="c">The <see cref="HtmlAttributeCollection"/> whose
 /// elements are copied to the new collection.</param>
 public HtmlAttributeCollection(HtmlAttributeCollection c)
 {
     _array = new HtmlAttribute[c.Count];
     AddRange(c);
 }
 public override int AddRange(HtmlAttributeCollection x)
 {
     throw new NotSupportedException(RD.GetString("readOnlyCollection"));
 }
Exemple #11
0
 /// <summary>
 /// Initializes a new instance of the <see cref="HtmlLinkedNode"/>
 /// </summary>
 public HtmlLinkedNode()
 {
     _childNodes = new HtmlNodeCollection();
     _attributes = new HtmlAttributeCollection();
 }