/// <summary>
        ///		Creates a shallow copy of the <b>HtmlOptionCollection</b>.
        /// </summary>
        /// <returns>A shallow copy of the <see cref="HtmlOptionCollection"/>.</returns>
        public virtual object Clone()
        {
            HtmlOptionCollection newList = new HtmlOptionCollection(count);
            Array.Copy(keys, 0, newList.keys, 0, count);
            Array.Copy(values, 0, newList.values, 0, count);
            newList.count = count;
            newList.version = version;
            newList.comparer = comparer;

            return newList;
        }
 internal KeyList(HtmlOptionCollection list)
 {
     this.list = list;
 }
        /// <summary>
        ///		Returns a synchronized (thread-safe) wrapper for the <b>HtmlOptionCollection</b>.
        /// </summary>
        /// <param name="list">The <see cref="HtmlOptionCollection"/> to synchronize.</param>
        /// <returns>A synchronized (thread-safe) wrapper for the <see cref="HtmlOptionCollection"/>.</returns>
        /// <exception cref="ArgumentNullException"><paramref name="list"/> is a null reference.</exception>
        public static HtmlOptionCollection Synchronized(HtmlOptionCollection list)
        {
            if (list == null)
                throw new ArgumentNullException("list", "The list cannot be null.");

            return new SyncSortedList(list);
        }
 internal ValueList(HtmlOptionCollection list)
 {
     this.list = list;
 }
 internal SyncSortedList(HtmlOptionCollection list)
 {
     this.list = list;
     this.root = list.SyncRoot;
 }
 internal SortedListEnumerator(HtmlOptionCollection list, int index, int count, int returnType)
 {
     this.list = list;
     this.index = index;
     this.startIndex = index;
     this.endIndex = index + count;
     this.version = list.version;
     this.returnType = returnType;
     this.currentValid = false;
 }
        /// <summary>
        /// Retrieves an ArrayList containing the options element from a HtmlOptionCollection.
        /// </summary>
        /// <param name="coll"> The HtmlOptionCollection.</param>
        /// <returns> An ArrayList containing the option values.</returns>
        private ArrayList GetList(HtmlOptionCollection coll)
        {
            ArrayList t = new ArrayList();
            foreach (DictionaryEntry de in coll)
            {
                t.Add(((HtmlOptionTag)de.Value).Value);
            }

            return t;
        }