본문 바로가기
반응형

c#4

Covariance and Contravariance Covariance and Contravariance (C#) 용어 정리 Invariance Means that you can use only the type originally specified. An invariant generic type parameter is neither covariant nor contravariant. You cannot assign an instance of List to a variable of type List or vice versa. Variance Convariance Enables you to use a more derived type than originally specified. You can assign an instance of IEnumerable to.. 2022. 1. 19.
[.NET] Windows Registry 등록/삭제 Custom URI Scheme 를 테스트 하다가 Windows 에 Registry 를 자동으로 등록/삭제 하면 편하겠다는 생각이 들어 찾아보게 되었습니다. 공식 문서를 찾아봅니다. https://docs.microsoft.com/ko-kr/dotnet/api/microsoft.win32.registry?view=netframework-4.5 Registry Class (Microsoft.Win32) Windows 레지스트리의 루트 키를 나타내는 개체와 키/값 쌍에 액세스하는 static 메서드를 제공합니다.Provides objects that represent the root keys in the Windows registry, and static methods to access key/value p.. 2019. 9. 8.
[Unity3D] C# Unity와 연관된 C# 지식에 대해 스크랩 하고 정리해 봅니다. 일단은 스크랩 위주로... 환경 설정 Microsoft Visual Studio Professional 2015 (14.0.25431.01 Update 3) Microsft .NET Framework (4.8.03752) Unity (2018.4.2f1) Player Setting Scripting Runtime Version - .NET 4.x Equivalent Scripting Backend - Mono Api Compatibility Level - .NET Standard 2.0 참고 C# 언어 및 .NET Framework 소개 C# 언어 및 .NET Framework 소개 C# 및 .NET의 기본 사항에 대해 알아봅니다. C# .. 2019. 8. 5.
For vs Foreach C# 에서 "For문이 Foreach 보다 좋다"라고 막연하게 알고 있었는데 많은 사람들이 Foreach문을 사용하는 것을 볼 수 있었다. 이에 의심을 갖고 직접 테스트를 해보기로 했다. 연산 속도테스트 코드 class Tester { static int ForWithArray(int[] array) { int t = 0; for (int i = 0; i < array.Length; i++) t += array[i]; return t; } static int ForeachWithArray(int[] array) { int t = 0; foreach (var v in array) t += v; return t; } static int ForWithList(List list) { int t = 0; for .. 2018. 12. 4.
반응형