DataControlReferenceCollection.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 / xsp / System / DynamicData / DynamicData / DataControlReferenceCollection.cs / 1305376 / DataControlReferenceCollection.cs

                            namespace System.Web.DynamicData { 
    using System;
    using System.Collections.Generic;
    using System.Collections.ObjectModel;
    using System.ComponentModel; 
    using System.Diagnostics.CodeAnalysis;
    using System.Security.Permissions; 
 
    /// 
    /// Represents a collectin of DataControlReferences 
    /// 
    public class DataControlReferenceCollection : Collection {
        public DataControlReferenceCollection(DynamicDataManager owner) {
            if (owner == null) { 
                throw new ArgumentNullException("owner");
            } 
 
            Owner = owner;
        } 

        public DynamicDataManager Owner {
            get;
            private set; 
        }
 
        internal void Initialize() { 
            foreach (DataControlReference reference in this) {
                reference.Owner = Owner; 
            }
        }

        [SuppressMessage("Microsoft.Security", "CA2123:OverrideLinkDemandsShouldBeIdenticalToBase")] 
        protected override void SetItem(int index, DataControlReference item) {
            item.Owner = Owner; 
            base.SetItem(index, item); 
        }
 
        [SuppressMessage("Microsoft.Security", "CA2123:OverrideLinkDemandsShouldBeIdenticalToBase")]
        protected override void InsertItem(int index, DataControlReference item) {
            item.Owner = Owner;
            base.InsertItem(index, item); 
        }
 
        [SuppressMessage("Microsoft.Security", "CA2123:OverrideLinkDemandsShouldBeIdenticalToBase")] 
        protected override void RemoveItem(int index) {
            this[index].Owner = null; 
            base.RemoveItem(index);
        }
    }
} 

// File provided for Reference Use Only by Microsoft Corporation (c) 2007.
// Copyright (c) Microsoft Corporation. All rights reserved.


                        

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