C#
-
03/24 SortedList, IComparable 연습C#/수업내용 2021. 3. 24. 15:16
Program.cs using System; namespace Study07 { class Program { static void Main(string[] args) { Console.WriteLine("Main"); new App(); } } } App.cs using System; using System.Collections.Generic; using System.Linq; using System.Threading; namespace Study07 { public class App { //생성자 public App() { Console.WriteLine("App"); //컬렉션 인스턴스화 SortedList temps = new SortedList(); //요소 추가 temps.Add(new Temp..
-
03/24 callback 연습C#/수업내용 2021. 3. 24. 12:32
Program.cs using System; namespace Study07 { class Program { static void Main(string[] args) { Console.WriteLine("Main"); new App(); } } } App.cs using System; using System.Collections.Generic; using System.Linq; using System.Threading; namespace Study07 { public class Barracks { public Barracks() { Console.WriteLine("배럭스가 생성되었습니다."); } public void CreateUnit(eUnitType unitType, Action callback)..
-
03/24 델리게이트 연습C#/수업내용 2021. 3. 24. 11:08
Program.cs using System; namespace Study07 { class Program { static void Main(string[] args) { Console.WriteLine("Main"); new App(); } } } App.cs using System; using System.Collections.Generic; using System.Linq; using System.Threading; namespace Study07 { //대리자 선언 public delegate void DelPrint(string msg); public delegate string DelPrintWithLogo(string logo, string msg); //프린터기 public class Pri..
-
03/24 Event연습C#/수업내용 2021. 3. 24. 09:53
Program.cs using System; namespace Study07 { class Program { static void Main(string[] args) { Console.WriteLine("Program"); new App(); } } } App.cs using System; using System.Collections.Generic; using System.Linq; using System.Threading; namespace Study07 { public class DoorEventArgs : EventArgs { public DateTime Time { get; set; } public DoorEventArgs() { Time = DateTime.Now; } } public class..
-
03/23 수업내용 메모C#/수업내용 2021. 3. 23. 18:22
2021/03/23 익명함수 대리자 형식이 예상되는 곳에서 명명된 대리자를 초기화, 매개 변수로 전달가능 람다 식 식 람다, 문 람다 (input-parameters) => expression (input-parameters) => { } Action 대리자 Func 대리자 대리자 + 익명함수(Lambda) + Linq Linq 데이터를 편리하게 추출하고 가공하기 위해 사용 대리자를 사용하여 여러 메서드를 다중 호출(멀티캐스트 대리자) += -= Delegate.Combine(); 이벤트 번개표시
-
03/23 List<T>.Find(Predicate<T>) 메서드 연습C#/수업내용 2021. 3. 23. 12:46
Program.cs using System; namespace Study07 { class Program { static void Main(string[] args) { Console.WriteLine("Program"); new App(); } } } App.cs using System; using System.Collections.Generic; using System.Linq; namespace Study07 { public class Book { public string ID { get; set; } public string Title { get; set; } } public class App { //생성자 public App() { Console.WriteLine("App"); //컬렉션 인스턴..
-
03/23 Linq Where 연습C#/수업내용 2021. 3. 23. 12:30
아이템 등급이 Rare이상인 아이템만 출력 등급 Common -> UnCommon -> Rare -> Unique -> Legendary Program.cs using System; namespace Study07 { class Program { static void Main(string[] args) { Console.WriteLine("Program"); new App(); } } } App.cs using System; using System.Collections.Generic; using System.Linq; namespace Study07 { public class App { //생성자 public App() { Console.WriteLine("App"); //컬렉션 생성 List items..
-
03/23 Linq Find, Where, FindAll, Sort 연습C#/수업내용 2021. 3. 23. 12:16
Program.cs using System; namespace Study07 { class Program { static void Main(string[] args) { Console.WriteLine("Program"); new App(); } } } App.cs using System; using System.Collections.Generic; using System.Linq; namespace Study07 { public class App { //생성자 public App() { Console.WriteLine("App"); //컬렉션 생성 List items = new List(); //Item객체 생성 Item item1 = new Item("장검"); Item item2 = new Item..