반응형 eventhandler1 기본기)Event Handler 대리자 EventHandler 대리자 이벤트 데이터가 없는 이벤트를 처리할 메서드를 만들때 사용한다. 어떤 이벤트를 처리하는 메서드를 만들때 사용하는 형태로 += 를 통해서 Event를 등록한다. 하단의 예제는 임계점을 설정후 a버튼에 대한 제한 처리를 하는 로직이다. using System; namespace ConsoleApplication1 { class Program { static void Main(string[] args) { Counter c = new Counter(new Random().Next(10)); c.ThresholdReached += c_ThresholdReached; Console.WriteLine("press 'a' key to increase total"); while (Cons.. 2021. 9. 26. 이전 1 다음 반응형