Zdarzenia oraz delegaty (tak to chyba się tłumaczy?) pełnią podobną funkcje w C#. Jaka jest jednak różnica? Przyjrzyjmy się sposobowi ich użycia:class Program { publicstaticevent EventHandler SimpleEvent =null; publicstatic EventHandler SimpleDelegate =null; staticvoid Main(string[] args) { SimpleEvent+=new EventHandler(EventMethod); SimpleDelegate +=new EventHandler(DelegateMethod); SimpleEvent(null, null); SimpleDelegate(null, null); } staticvoid D...

Tagi: delegaty, eventy
Dziel się z innymi:
Piotr Zieliński  » Events vs. Delegates

Inne 4730 dni, 19 godzin, 17 minut temu pzielinski 181 pokaż kod licznika zwiń

Najaktywniejsi w tym miesiącu