コード例 #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));
 }
コード例 #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));
 }
コード例 #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);
        }
コード例 #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);
        }
コード例 #5
0
 internal ReadOnlyHtmlAttributeCollection(HtmlAttributeCollection list) : base(Tag.Default)
 {
     _collection = list;
 }
コード例 #6
0
 public override int AddRange(HtmlAttributeCollection x)
 {
     lock (this._root)
         return(_collection.AddRange(x));
 }
コード例 #7
0
 internal SyncHtmlAttributeCollection(HtmlAttributeCollection list) : base(Tag.Default)
 {
     _root       = list.SyncRoot;
     _collection = list;
 }
コード例 #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;
 }
コード例 #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);
 }
コード例 #10
0
 public override int AddRange(HtmlAttributeCollection x)
 {
     throw new NotSupportedException(RD.GetString("readOnlyCollection"));
 }
コード例 #11
0
ファイル: HtmlLinkedNode.cs プロジェクト: minskowl/MY
 /// <summary>
 /// Initializes a new instance of the <see cref="HtmlLinkedNode"/>
 /// </summary>
 public HtmlLinkedNode()
 {
     _childNodes = new HtmlNodeCollection();
     _attributes = new HtmlAttributeCollection();
 }