[C#] Delegate - Anonymous method 간단한 예제 코드
아래는 Anonymous method를 Adapter로 이용한 간단한 예제이다. using System; namespace DelegateSample2 { delegate void Action(); class Program { static void Main(string[] args) { myAction += delegate() { Console.WriteLine("1st"); }; myAction += delegate() { Console.WriteLine("2nd"); }; myAction(); } public static Action myAction; } }
Code/C#
2007. 11. 26. 19:01
[C#] Delegate & Event 예제 코드
Delegate & Event 예제 간단한 Delegate & Event 예제 입니다. 아래에서 주의 할 점은 public event 를 부를 수 있는 것은 그 event 가 속해있는 class의 method 뿐이라는 것입니다. Anonymous Method 의 사용법도 눈여겨보시기 바랍니다. Anonymous Method 를 사용할 때, close brace " } " 다음에 세미콜론 " ; " 을 붙여야합니다. using System; namespace DelegateSample { class Program { static void Main(string[] args) { Human Tom = new Human(); Tom.ActionDelegate += new Action(Tom.Speak); Tom..
Code/C#
2007. 11. 23. 20:37
공지사항
최근에 올라온 글
최근에 달린 댓글
- Total
- Today
- Yesterday
링크
TAG
- c#
- Phalanger
- Sample Code
- tagREADYSTATE
- java
- 스크린캡쳐
- 애드센스감추기
- iTextSharp
- Regular Expressions
- windows
- Microsoft
- Automation
- Rollback Rx
- 유틸리티
- iText
- AdSense감추기
- download.com
- AdSense숨기기
- Service pack
- .net framework
- registry
- READYSTATE_COMPLETE
- WinAutomation
- DotNetMagic
- AxWebBrowser
- 애드센스숨기기
- ScreenHunter
- autohotkey
- jre
일 | 월 | 화 | 수 | 목 | 금 | 토 |
---|---|---|---|---|---|---|
1 | 2 | 3 | ||||
4 | 5 | 6 | 7 | 8 | 9 | 10 |
11 | 12 | 13 | 14 | 15 | 16 | 17 |
18 | 19 | 20 | 21 | 22 | 23 | 24 |
25 | 26 | 27 | 28 | 29 | 30 | 31 |
글 보관함