ResourceDictionaryCollection.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 / wpf / src / Framework / System / Windows / ResourceDictionaryCollection.cs / 1305600 / ResourceDictionaryCollection.cs

                            using System; 
using System.Windows;
using System.Collections.ObjectModel;
using System.Diagnostics;
 
namespace System.Windows
{ 
    internal class ResourceDictionaryCollection : ObservableCollection 
    {
        #region Constructor 

        internal ResourceDictionaryCollection(ResourceDictionary owner)
        {
            Debug.Assert(owner != null, "ResourceDictionaryCollection's owner cannot be null"); 

            _owner = owner; 
        } 

        #endregion Constructor 

        #region ProtectedMethods

        ///  
        /// Called by base class Collection<T> when the list is being cleared;
        /// raises a CollectionChanged event to any listeners. 
        ///  
        protected override void ClearItems()
        { 
            for (int i=0; i 
        /// Called by base class Collection<T> when an item is added to list;
        /// raises a CollectionChanged event to any listeners.
        /// 
        protected override void InsertItem(int index, ResourceDictionary item) 
        {
            if (item == null) 
            { 
                throw new ArgumentNullException("item");
            } 

            base.InsertItem(index, item);
        }
 
        /// 
        /// Called by base class Collection<T> when an item is set in list; 
        /// raises a CollectionChanged event to any listeners. 
        /// 
        protected override void SetItem(int index, ResourceDictionary item) 
        {
            if (item == null)
            {
                throw new ArgumentNullException("item"); 
            }
 
            base.SetItem(index, item); 
        }
 
        #endregion ProtectedMethods

        #region Data
 
        private ResourceDictionary _owner;
 
        #endregion Data 
    }
} 


// 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