using System;
using System.Collections.Generic;
namespace MyLearn
{
public class MyWork
{
public delegate void CurrentEvent( int process);
public event CurrentEvent ce;
public void DoWorking()
{
for ( int i = 0 ;i < 100 ;i ++ )
{
ce(i);
}
}
}
public class ShowTest
{
public void ShowProcess( int i)
{
Console.WriteLine( " woring is " + i.ToString());
}
}
class MainClass
{
public static void Main( string [] args)
{
ShowTest b = new ShowTest();
MyLearn.MyWork test = new MyLearn.MyWork();
test.ce += new MyLearn.MyWork.CurrentEvent(b.ShowProcess);
test.DoWorking();
Console.ReadLine();
}
}
}