/* */
}
}
///<summary>
/// EventReader1 : 事件的订阅者1。
///</summary>
public class EventReader1
{
public EventReader1(EventPublisher publisher)
{
publisher.sampleEvent +=
new EventExample.EventPublisher.sampleEventDelegate(ResponseEvent);
}
private int ResponseEvent(string msg)
{
Console.WriteLine(msg + " --- This is from reader1");
return 0;
}
}
///<summary>
/// EventReader2 : 事件的订阅者2。
///</summary>
public class EventReader2
{
public EventReader2(EventPublisher publisher)
{
publisher.sampleEvent +=
new EventExample.EventPublisher.sampleEventDelegate(ResponseEvent);
publisher.sampleEvent +=
new EventExample.EventPublisher.sampleEventDelegate(ResponseEvent);
}
private int ResponseEvent(string msg)
{
Console.WriteLine(msg + " --- This is from reader2");
Console.WriteLine("Please:down enter key!");
Console.ReadLine();
Console.WriteLine("ok");
return 0;
}
}
}