using System.Collections.Generic; using Chernobyl.Utility; namespace Chernobyl.Collections.Generic.Event { /// /// Decorates a type to allow client /// code to know when the has been /// modified. Also designed to make the implementation of new /// easier to create. /// /// The type of the key. /// The type of the value. public class DecoratingEventDictionary : EventDictionary { /// /// Initializes a new instance of the /// class that uses /// an instance of as the /// instance it is decorating. /// public DecoratingEventDictionary() : this(new Dictionary()) {} /// /// Initializes a new instance of the class. /// /// The instance that is being decorated with /// event capabilities. public DecoratingEventDictionary(IDictionary dictionaryDecorated) { dictionaryDecorated.ThrowIfNull("dictionaryDecorated"); _dictionaryDecorated = dictionaryDecorated; } /// /// The instance that is being decorated with event capabilities. /// protected override IDictionary DictionaryDecorated { get { return _dictionaryDecorated; } } /// /// The backing field to . /// readonly IDictionary _dictionaryDecorated; } }