rendered paste bodyusing System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
namespace ConsoleApplication1
{
public delegate void SomeEvent( object sender, EventArgs e );
class Button
{
public event SomeEvent EventRecieved;
public void FireClick()
{
if ( EventRecieved != null )
EventRecieved( this, EventArgs.Empty );
}
}
class Program
{
static void Main( string[] args )
{
Button b = new Button();
b.EventRecieved += new SomeEvent( b_EventRecieved );
b.FireClick();
}
private static void b_EventRecieved( object sender, EventArgs e )
{
Console.WriteLine( "CLICK!" );
}
}
}