주 메뉴 열기

wwiki β

바뀜

CSharp

1,655 바이트 추가됨, 2023년 4월 7일 (금) 00:42
Events
== 형식 및 변수 ==https://docs.microsoft.com/ko-kr/dotnet/csharp/
=== 값 형식 =C# concepts ==
==== 단순 형식 ==How-to C# articles ==
==== 열거형 형식 ==The .NET Compiler Platform SDK(Roslyn APIs) ==
==== 구조체 형식 ==C# programming guide ==
===Overview = Nullable == === Inside a c# program === === Main() and command-line arguments === === Programming concepts === ==== Overview ==== ==== Asynchronous programming ==== ==== Attributes ==== ==== Collections ==== ====[[Covariance and contravariance]](공변성과 반공변성) ==== ==== [[Expression trees]] ==== ==== Interators ==== ==== Languae-Intergrated Query(LINQ) ==== ==== Reflection ==== ==== Serialization ==== === statements, expressions, and operators === === Types === === Class and Structs === === Interface === ===[[Delegates]]=== === Arrays === === Strings === === Indexers === === Events === ==== 개요 ==== ==== [[이벤트를 구독 및 구독취소하는 방법]] ====[[.NET 지침을 따르는 이벤트를 게시하는 방법]] ===Generics=== ==== [[Overview(Generic)|Overview]] ==== ==== [[Generic Type Parameters]] ==== === [[Constraints on type parameters]] === ==== Generic Classes ==== ==== Generic Interfaces ==== ==== Generic Methods ==== ==== Generics And Arrays ==== ==== Generic Delegates ==== ==== Differences Between C++ Templates and C# Generics ==== ==== Generics in the Run Time ==== ==== Generics and Reflection ==== ==== Generics and Attributes ==== === Namespaces === === Unsafe Code and Pointers === === XML documentation comments === === Exceptions and Exception Handling === === File System and the Registry === === Interoperability === == Language reference == ===[[Overview(Language reference)|Overview]]=== === Configure language version === === Types === ==== Value types(값 형식 ) ==== ==== Reference types ====null을 허용하지 않는 형식을 T라고 한다면, 이에 대응되는 nullalbe형식 T==== void ==== ==== var ==== ==== Built-in types ==== ==== Unmanaged types ==== ==== Default value ==== === Keywords === ==== Overview ==== ==== Modifiers ==== ==== Statement Keywords ==== ==== Method Parameters ==== ==== Namespace Keywords ==== ==== Type-testing Keywords ==== ==== Generic Type Constraint Keywords ==== ==== Access Keywords ==== ==== Literal Keywords ==== ==== Contextual Keywords ==== ==== Query Keywords ==== === Operators and expressions === ==== Overview ==== ==== Arithmetic operators ==== ==== Boolean logical operators ==== ==== Bitwise and shift operators ==== ==== Equality operators ==== ==== Comparison operators ==== ==== Member access operator and expressions ==== ====[[Type-testing operators and cast expressions]]==== ==== User-defined conversion operators ==== ==== Pointer-related operators ==== ==== Assignment operators ==== ====[[Lambda expressions]]==== ==== + and += operators ==== ==== - and -= operators ==== ==== ?: operators ==== ==== !(null-forgiving) operator ==== ==== ?? and ?가 있다. string?은 string 또는 null값을 보유할 수 있는 형식이다.= operators ==== ==== => operators ==== ==== :: operator ==== ==== await operator ==== ==== default value expressions ==== ==== delegate operator ==== ==== nameof expression ==== ==== new operator ==== ==== sizeof operator ==== ==== stackalloc expression ==== ==== switch expression ==== ==== true and false operators ==== ==== with expression ==== ==== Operator overloading ==== === Special characters ===
==== 튜블 값 형식 =Attributes read by the compiler ===
=== 참조 형식 Preprocessor directives ===
==== 클래스 형식 =Compiler options ===
===== string(UTF-16) ==Compiler errors ===
==== 인터페이스 형식 =C# 6.0 draft specification ===
==== 배열 형식 =C# 7.0-9.0 proposals ===
==== 대리자 형식(delegate) ====
delegate는 대표(자), 위임하다는 의미를 가지고 있다.
메서드에 대한 참조를 나타내는 형식이다. 함수 포인터와 달리 delegate는 객체지향적이며 형식이 안전하다.
<br />===== 단순 형식 === 한정자 ==
=== internal == 열거형 형식 =====동일한 어셈블리의 파일 내에서만 액세스할 수 있습니다.
== 콜렉션 ==가변크기 컨테이너, Vector, ArrayList, LinkedList, HashSet, Stack, HashMap<key, value>= 구조체 형식 =====
=== IEnumerable == Nullable 값 형식 =====foreach, 임의접근이 가능null을 허용하지 않는 형식을 T라고 한다면, 내부적으로 Enumerator를 가지고 이에 대응되는 nullalbe형식 T?가 있다. string?은 string 또는 null값을 보유할 수 있는 형식이다.
=== IEnumerator == 튜블 값 형식 =====순차접근 가능(MoveNext()), 접근위치를 내부적으로 가지고 있다.
== Lambda Expression(람다 표현식) ==LISP에 들어 있다. λxyㆍplus(x, y) 처럼 함수를 사용하는 변수를 명시하는 표기방법이다. λ(람다)는 그리스 문자로 물리에서는 소립자의 하나이고, 부피의 단위로 100만분의 1을 나타내기도 한다.참조 형식 ====
c#에서 람다표현식을 사용해서 익명함수를 만든다.===== 클래스 형식 =====
=> : 람다 선언 연산자이다. ===== string(inputUTF-parameter, ...16) => expression=====
(input-parameters) => { <sequence-of-statements> }<syntaxhighlight lang="c#">class Program{ delegate int Calc(int a, int b); public static void Main(string [] args) { Calc c = (a, b) => a +b; int sum = c(1,1); }}인터페이스 형식 =====
===== 배열 형식 =====
===== 대리자 형식(delegate) =====<br /syntaxhighlight>
=== Action 대리자 한정자 ===람다 식에서 값을 반환하지 않는 경우 Action 대리자 형식 중 하나로 변환할 수 있다.<syntaxhighlight lang="c#">Action hello = () => Console.WriteLine("Hello");
hell();</syntaxhighlight>매개변수가 2개이고 값을 반환하지 않는 람다식은 Action<T1, T2>대리자로 변환할 수 있다.<syntaxhighlight lang="c#">Action<int, int> showSum = (x, y) => { int sum = x + y;internal ==== Console동일한 어셈블리의 파일 내에서만 액세스할 수 있습니다.Write(sum);}showSum(1, 2);</syntaxhighlight>
=== Func 대리자 콜렉션 ===값을 반환하는 경우 Func대리자 형식으로 변환할 수 있다. 가변크기 컨테이너, Vector, ArrayList, LinkedList, HashSet, Stack, HashMap<key, value>
매개변수가 하나이고 값을 반환하는 람다식은 Func<T, TResult> 대리자로 변환할 수 있다. <syntaxhighlight lang="c#">Func<int> func = () => 10; // 10을 반환= IEnumerable ====int ten = func();foreach, 임의접근이 가능, 내부적으로 Enumerator를 가지고 있다.
Func<int, int> square = (x) => x*x;== IEnumerator ====Cosole.Write순차접근 가능(squareMoveNext(10)); // 100출력</syntaxhighlight>, 접근위치를 내부적으로 가지고 있다.
=== LINQ(Language Integrated Query) ===
var value = from 익명변수명 in ~
select 추출할_항목;
=== 라이브러리 ===
====[[CommandLineParser]]====[[분류:.net]]
편집
2,431