public void LongWorking(int ms) { Console.WriteLine("RemoteObject: LongWorking() Started"); StatusEventArgs e = new StatusEventArgs( "Message for Client: LongWorking() Started"); // fire event if (Status != null) { Console.WriteLine("RemoteObject: Firing Starting Event"); Status(this, e); } System.Threading.Thread.Sleep(ms); e.Message = "Message for Client: LongWorking() Ending"; // fire ending event if (Status != null) { Console.WriteLine("RemoteObject: Firing Ending Event"); Status(this, e); } Console.WriteLine("RemoteObject: LongWorking() Ending"); }
public void StatusHandler(object sender, StatusEventArgs e) { Console.WriteLine("EventSink: Event occurred: " + e.Message); }