"이벤트 핸들러"의 두 판 사이의 차이

잔글 (봇: 자동으로 텍스트 교체 (-==참고 자료== +==참고==))
47번째 줄: 47번째 줄:


==같이 보기==
==같이 보기==
*[[이벤트]]
* [[이벤트]]
*[[콜백 함수]]
* [[콜백 함수]]
*[[인터럽트]]
* [[인터럽트]]
*[[인터럽트 핸들러]]
* [[인터럽트 핸들러]]
*[[옵저버 패턴]]
* [[옵저버 패턴]]
*[[리액터 패턴]]
* [[리액터 패턴]]
*[[프로액터 패턴]]
* [[프로액터 패턴]]
*[[이벤트 기반 프로그래밍]]
* [[이벤트 기반 프로그래밍]]
*[[자바스크립트 이벤트]]
* [[자바스크립트 이벤트]]
* [[미디어위키 훅]]


==참고==
==참고==
*https://en.wikipedia.org/wiki/Event_(computing)
*https://en.wikipedia.org/wiki/Event_(computing)
*http://terms.naver.com/entry.nhn?docId=822666&cid=42344&categoryId=42344
*http://terms.naver.com/entry.nhn?docId=822666&cid=42344&categoryId=42344

2017년 8월 24일 (목) 00:32 판

1 개요

event handler, listener
이벤트 핸들러, 이벤트 처리기, 이벤트 리스너; 리스너
  • 프로그램 내부에서 입력을 받아 처리하는 일종의 콜백 서브루틴

 

2 예시

delegate void Notifier (string sender);
 
class Model {
    public event Notifier notifyViews;
    public void Change() { ... notifyViews("Model"); }
}
 
class View1 {
    public View1(Model m) {
        m.notifyViews += new Notifier(this.Update1);
    }
 
    void Update1(string sender) {
        Console.WriteLine(sender + " was changed during update"); 
    }
}
 
class View2 {
    public View2(Model m) {
        m.notifyViews += new Notifier(this.Update2); 
    }
 
    void Update2(string sender) {
        Console.WriteLine(sender + " was changed"); 
    }
}
 
class Test {
    static void Main() {
        Model model = new Model();
 
        new View1(model);
        new View2(model);
        model.Change();
    }
}

3 같이 보기

4 참고

문서 댓글 ({{ doc_comments.length }})
{{ comment.name }} {{ comment.created | snstime }}