Object Initializer 사용법을 설명하는 샘플코드이다. using System; namespace Sample { class Program { static void Main(string[] args) { Line L1 = new Line(); Point myP1 = new Point(); myP1.X = 1; myP1.Y = 2; Point myP2 = new Point(); myP2.X = 3; myP2.Y = 4; L1.P1 = myP1; L1.P2 = myP2; Console.WriteLine(L1.ToString()); Line L2 = new Line(); Point itsP1 = new Point { X = 5, Y = 6 }; // Object Initializers Point i..
Object Initializer를 이용하는 간단한 샘플코드이다. 아래에서 P1과 P2의 property에 값을 대입하는 방식을 살펴보라. using System; namespace Sample { class Program { static void Main(string[] args) { Point P1 = new Point(); P1.X = 2; P1.Y = 3; Console.WriteLine(P1.ToString()); // Object Initializers Point P2 = new Point { X = 7, Y = 8 }; Console.WriteLine(P2.ToString()); } } public class Point { int x; public int X { get { return x; ..
간단한 Lambda Expression 샘플 코드이다. Lambda Expression에서 return 값을 살펴보자. using System; namespace LambdaSample { class Program { delegate int Action(int number); static void Main(string[] args) { Action action1 = number => number + 2; Action action2 = number => { return number + 2; }; int i = action1(3); int j = action2(3); Console.WriteLine(i); Console.WriteLine(j); } } }
- Total
- Today
- Yesterday
- Phalanger
- WinAutomation
- registry
- Regular Expressions
- download.com
- tagREADYSTATE
- 애드센스감추기
- AdSense감추기
- autohotkey
- 유틸리티
- jre
- .net framework
- AdSense숨기기
- c#
- 스크린캡쳐
- Service pack
- Rollback Rx
- java
- READYSTATE_COMPLETE
- 애드센스숨기기
- Sample Code
- windows
- iText
- Microsoft
- iTextSharp
- ScreenHunter
- Automation
- AxWebBrowser
- DotNetMagic
일 | 월 | 화 | 수 | 목 | 금 | 토 |
---|---|---|---|---|---|---|
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 |