BaseCollection.cs source code in C# .NET

Source code for the .NET framework in C#

                        

Code:

/ 4.0 / 4.0 / untmp / DEVDIV_TFS / Dev10 / Releases / RTMRel / ndp / fx / src / WinForms / Managed / System / WinForms / BaseCollection.cs / 1305376 / BaseCollection.cs

                            //------------------------------------------------------------------------------ 
// 
//     Copyright (c) Microsoft Corporation.  All rights reserved.
// 
//----------------------------------------------------------------------------- 

namespace System.Windows.Forms { 
    using System.Runtime.InteropServices; 

    using System; 
    using System.ComponentModel;
    using System.Collections;
    using ArrayList = System.Collections.ArrayList;
 
    /// 
    ///  
    ///    Provides the base functionality for creating collections. 
    /// 
    public class BaseCollection : MarshalByRefObject, ICollection { 

        //==================================================
        // the ICollection methods
        //================================================== 
        /// 
        ///  
        ///    Gets the total number of elements in a collection. 
        /// 
        [ 
        Browsable(false), EditorBrowsable(EditorBrowsableState.Advanced)
        ]
        public virtual int Count {
            get { 
                return List.Count;
            } 
        } 

        ///  
        /// 
        ///    [To be supplied.]
        /// 
        public void CopyTo(Array ar, int index) { 
            List.CopyTo(ar, index);
        } 
 
        /// 
        ///  
        ///    Gets an IEnumerator for the collection.
        /// 
        public IEnumerator GetEnumerator() {
            return List.GetEnumerator(); 
        }
 
        ///  
        /// 
        ///    [To be supplied.] 
        /// 
        [
        Browsable(false), EditorBrowsable(EditorBrowsableState.Advanced)
        ] 
        public bool IsReadOnly {
            get { 
                return false; 
            }
        } 

        /// 
        /// 
        ///    [To be supplied.] 
        /// 
        [Browsable(false), EditorBrowsable(EditorBrowsableState.Advanced)] 
        public bool IsSynchronized { 
            get {
                // so the user will know that it has to lock this object 
                return false;
            }
        }
 
        /// 
        ///  
        ///    [To be supplied.] 
        /// 
        [Browsable(false), EditorBrowsable(EditorBrowsableState.Advanced)] 
        public object SyncRoot {
            get {
                return this;
            } 
        }
 
        ///  
        /// 
        ///    [To be supplied.] 
        /// 
        protected virtual ArrayList List {
            get {
                return null; 
            }
        } 
    } 
}

// File provided for Reference Use Only by Microsoft Corporation (c) 2007.
                        

Link Menu

Network programming in C#, Network Programming in VB.NET, Network Programming in .NET
This book is available now!
Buy at Amazon US or
Buy at Amazon UK