Sometimes we need a List which can notify user when an item is added. Here is the way that you can implement a generic ArrayList which notifies user at the time of an element is added. using System; using System.Collections; namespace ArchiveData.Logging { // A delegate type for hooking up change notifications. public delegate void ChangedEventHandler ( object sender, EventArgs e); public class ListWithChangedEvent : ArrayList { // An event that clients can use to be notified whenever the // elements of the list change. public event ChangedEventHandler Changed; public object NewlyAddedItem {...
Technical Solutions for C, C++, Objective-C, C#, OOP's, Data Structure, Algorithms, Mobile Technology, Mobile Design, HTML/HTML5, Web, iOS/iPad/iPhone, Apple Script, Shell Script, Phonegap, AppAccelerator, Unix, Linux, Mac-OS X, Windows, SQL-Server, PL-SQL, Sqlite3, Database Design issues tips, tricks and hacks by Vinay Mishra.