Ejemplo n.º 1
0
 /// <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));
 }
Ejemplo n.º 2
0
 /// <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));
 }
Ejemplo n.º 3
0
        /// <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);
        }
Ejemplo n.º 4
0
        /// <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);
        }
Ejemplo n.º 5
0
 internal ReadOnlyHtmlAttributeCollection(HtmlAttributeCollection list) : base(Tag.Default)
 {
     _collection = list;
 }
Ejemplo n.º 6
0
 public override int AddRange(HtmlAttributeCollection x)
 {
     lock (this._root)
         return(_collection.AddRange(x));
 }
Ejemplo n.º 7
0
 internal SyncHtmlAttributeCollection(HtmlAttributeCollection list) : base(Tag.Default)
 {
     _root       = list.SyncRoot;
     _collection = list;
 }
Ejemplo n.º 8
0
 /// <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;
 }
Ejemplo n.º 9
0
 /// <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);
 }
Ejemplo n.º 10
0
 public override int AddRange(HtmlAttributeCollection x)
 {
     throw new NotSupportedException(RD.GetString("readOnlyCollection"));
 }
Ejemplo n.º 11
0
 /// <summary>
 /// Initializes a new instance of the <see cref="HtmlLinkedNode"/>
 /// </summary>
 public HtmlLinkedNode()
 {
     _childNodes = new HtmlNodeCollection();
     _attributes = new HtmlAttributeCollection();
 }