예제 #1
0
파일: Program.cs 프로젝트: syuru04/csharp
 public void Do()
 {
     if (MyEvent != null)
     {
         EventPublisherArgs args = new EventPublisherArgs("데이터");
         MyEvent(this, args);
     }
 }
예제 #2
0
 public event MyEventHandler MyEvent; //이벤트 정의
 public void Do()
 {
     //이벤트 가입자가 있는지 확인
     if (MyEvent != null)
     {
         EventPublisherArgs args = new EventPublisherArgs("데이터");
         MyEvent(this, args); //이벤트 발생
     }
 }
예제 #3
0
파일: Program.cs 프로젝트: syuru04/csharp
 static void doAction(object sender, EventPublisherArgs e)
 {
     Console.WriteLine("MyEvent 라는 이벤트 발생");
     Console.WriteLine("이벤트 매개변수 : " + e.myEventData);
 }