Introduction: Event in C# is a way for a class to provide notifications to client of that some one interesting thing happens to an object the most use for event in graphical user interface. event provide a generally useful way for objects to single state changes that may be useful to clients of that object. event are an important building block for creating classes that can be reuse in a large number of different programs. Here a simple program show a class ListwithChangedEvent.
Example:
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
namespace MyCollections
{
using System.Collections;
public delegate void ChangedEventHandler(object sender, EventArgs e);
public class ListWithChangedEvent : ArrayList
{
public event ChangedEventHandler Changed;
protected virtual void OnChanged(EventArgs e)
{
if (Changed != null)
Changed(this, e);
}


Join the conversation! Your thoughts help the community grow.