Anonymous Method와 Lambda Expression을 비교해보자. Lambda Expression이 조금 더 단순해보인다. using System; namespace DelegateSample { class Program { static void Main(string[] args) { Human Tom = new Human(); // Anonymous Method Tom.ActionDelegate += delegate(string text) { Console.WriteLine("Anonymous:" + text); }; // Lambda Expression Tom.ActionDelegate += (string text) => Console.WriteLine("Lambda1:" + text);..
Extension Methods 사용법은 2가지이다. 기존의 static method 사용법과 동일하게 쓰는 방법도 가능하다. 아래 예제는 exception 발생없이 잘 실행된다. Extension methods are static methods. Extension methods can only be declared in static classes. using System; namespace ConsoleApplication1 { class Program { static void Main(string[] args) { string s = "123"; int i = s.ToInt32(); int j = Extensions.ToInt32(s); Console.WriteLine(i); Console.Write..
const 대 readonly 비교 using System; namespace Test { class Program { static void Main(string[] args) { Some s1 = new Some(); Console.WriteLine(Some.constField); // const : 항상 static Console.WriteLine(s1.readonlyField1); Console.WriteLine(s1.readonlyField2); Some s2 = new Some(5); Console.WriteLine(s2.readonlyField2); } } class Some { // const readonly 공통 : 클래스 밖에서 값을 바꿀 수 없음 // const : 항상 static (..
- Total
- Today
- Yesterday
- java
- WinAutomation
- autohotkey
- 스크린캡쳐
- DotNetMagic
- download.com
- 유틸리티
- registry
- Rollback Rx
- AxWebBrowser
- 애드센스숨기기
- READYSTATE_COMPLETE
- tagREADYSTATE
- Sample Code
- Automation
- Regular Expressions
- iText
- 애드센스감추기
- Microsoft
- AdSense감추기
- c#
- windows
- AdSense숨기기
- iTextSharp
- Phalanger
- .net framework
- Service pack
- ScreenHunter
- 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 |