コード例 #1
0
ファイル: RemoteObject.cs プロジェクト: alannet/example
        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");
        }
コード例 #2
0
 public void StatusHandler(object sender, StatusEventArgs e)
 {
     Console.WriteLine("EventSink: Event occurred: " + e.Message);
 }