본문 바로가기
반응형

C#61

[C#] StackTrace, StackFrame StackTrace 클래스 StackTrace 클래스 (System.Diagnostics) 여러 스택 프레임의 정렬된 컬렉션에 해당하는 스택 추적을 나타냅니다. learn.microsoft.com namespace System.Diagnostics { public class StackTrace { public StackTrace(); public StackTrace(bool fNeedFileInfo); public StackTrace(int skipFrames); public StackTrace(Exception e); public StackTrace(StackFrame frame); public StackTrace(int skipFrames, bool fNeedFileInfo); public Stack.. 2023. 10. 24.
[C#] Debugger 디버깅을 위한 방법 - VS의 경우 디버그 메뉴 -> 프로세스에 연결: IED에서 설정한 중단점은 작동하지 않음 응용프로그램 스스로 Debugger.Break 호출 Debugger 클래스 Debugger 클래스 (System.Diagnostics) 디버거와 통신할 수 있습니다. 이 클래스는 상속될 수 없습니다. learn.microsoft.com namespace System.Diagnostics { public sealed class Debugger { // 사용되지 않음 - 인스턴스를 만들지 말고 써야함 public Debugger(); // 디버거와 연결되어 있는지 여부 public static bool IsAttached { get; } // 디버거와 연결되어 로깅이 활성화 되어있는지 여부 pub.. 2023. 10. 22.
[C#] Contract, Code Contracts(코드 계약) Contract 클래스 Contract 클래스 (System.Diagnostics.Contracts) 사전 조건, 사후 조건, 개체 고정 조건 같은 프로그램 계약을 나타내는 정적 메서드가 포함됩니다. learn.microsoft.com namespace System.Diagnostics.Contracts { public static class Contract { // 계약 위반 이벤트 public static event EventHandler ContractFailed; // 전제 조건 [Conditional("CONTRACTS_FULL")] public static void Requires(bool condition); [Conditional("CONTRACTS_FULL")] public static .. 2023. 10. 20.
[C#] Debug, Trace Debug 클래스 Debug 클래스 (System.Diagnostics) 코드 디버깅에 도움이 되는 메서드 및 속성들을 제공합니다. learn.microsoft.com namespace System.Diagnostics { public static class Debug { public static int IndentSize { get; set; } public static bool AutoFlush { get; set; } public static TraceListenerCollection Listeners { get; } public static int IndentLevel { get; set; } public static void Close(); public static void Flush(); pu.. 2023. 10. 18.
[C#] WeakReference WeakReference 클래스 WeakReference 클래스 (System) 가비지 수집에 의한 개체 회수를 허용하면서 개체를 참조하는 약한 참조를 나타냅니다. learn.microsoft.com namespace System { public class WeakReference : ISerializable { public WeakReference(object target); public WeakReference(object target, bool trackResurrection); protected WeakReference(SerializationInfo info, StreamingContext context); ~WeakReference(); public virtual bool IsAlive { g.. 2023. 10. 14.
[C#] GC, GCSettings, 쓰레기 수거(Garbege Collection) GC 클래스 GC 클래스 (System) 사용하지 않는 메모리를 자동적으로 회수하는 서비스인 시스템 가비지 수집기를 제어합니다. learn.microsoft.com namespace System { public static class GC { public static int MaxGeneration { get; } public static int CollectionCount(int generation); public static int GetGeneration(object obj); public static int GetGeneration(WeakReference wo); public static long GetTotalMemory(bool forceFullCollection); public static.. 2023. 10. 12.
[C#] IDisposable (Dispose), 종료자(Finalizer) IDisposable 인터페이스 https://learn.microsoft.com/ko-kr/dotnet/api/system.idisposable?view=net-7.0 IDisposable 인터페이스 (System) 관리되지 않은 리소스 해제를 위한 메커니즘을 제공합니다. learn.microsoft.com namespace System { public interface IDisposable { void Dispose(); } } - C#의 using문은 IDisposable을 구현하는 개체에 대해 Dispose 메서드를 try/finally 블록을 이용해서 호출하는 코드를 단축 표기 // 컴파일러는 이 코드를 using (FileStream fs = new FileStream("myfile.txt",.. 2023. 10. 10.
[C#] IStructuralEquatable, IStructuralComparable IStructuralEquatable 인터페이스 IStructuralEquatable 인터페이스 (System.Collections) 개체의 구조가 같은지 비교할 수 있는 메서드를 정의합니다. learn.microsoft.com namespace System.Collections { public interface IStructuralEquatable { bool Equals(object other, IEqualityComparer comparer); int GetHashCode(IEqualityComparer comparer); } } IStructuralComparable 인터페이스 IStructuralComparable 인터페이스 (System.Collections) 컬렉션 개체의 구조 비교를 지원합.. 2023. 10. 8.
[C#] StringComparer StringComparer 클래스 StringComparer 클래스 (System) 특정 대/소문자 및 문화권 기반 또는 서수 비교 규칙을 사용하는 문자열 비교 연산을 나타냅니다. learn.microsoft.com namespace System { public abstract class StringComparer : IComparer, IEqualityComparer, IComparer, IEqualityComparer { protected StringComparer(); public static StringComparer InvariantCulture { get; } public static StringComparer InvariantCultureIgnoreCase { get; } public sta.. 2023. 10. 6.
[C#] IComparer<T>, IComparer, Comparer<T> IComparer 인터페이스 IComparer 인터페이스 (System.Collections.Generic) 형식에서 두 개체를 비교하기 위해 구현하는 메서드를 정의합니다. learn.microsoft.com namespace System.Collections.Generic { public interface IComparer { int Compare(T x, T y); } } IComparer 인터페이스 IComparer 인터페이스 (System.Collections) 두 개체를 비교하는 메서드를 노출합니다. learn.microsoft.com namespace System.Collections { public interface IComparer { int Compare(object x, object y.. 2023. 10. 4.
반응형