Utils
네임스페이스 Going.Basis.Utils — 비동기 태스크, 외부 프로세스, 타이머, 정렬, 압축
public class EasyTask
비동기 반복 루프 태스크 관리. Started/Loop/Stopped 이벤트 기반으로 비동기 작업 라이프사이클 관리.
Properties
| bool | IsStart get | 태스크 실행 중 여부 |
Methods
| void | Start | () | 태스크 시작 |
| void | Start | (CancellationToken cancellationToken) | 외부 취소 토큰으로 시작 |
| void | Stop | () | 태스크 정지 요청 |
Events
| Func<CancellationToken, Task> | Loop | 반복 실행할 비동기 루프 핸들러 |
| Func<Task> | Started | 태스크 시작 시 한 번 호출 |
| Func<Task> | Stopped | 태스크 종료 시 한 번 호출 |
public class ExternalProgram
외부 프로세스 실행 및 종료 관리
Constructor
| ExternalProgram | (string PATH) | 실행 파일 경로로 생성 |
Properties
| Process? | Process get | 실행 중인 프로세스 인스턴스 |
| string | Path get | 실행 파일 경로 |
| string | ProcessName get | 프로세스 이름 |
Methods
| void | Start | () | 프로세스 시작 |
| void | Stop | () | 프로세스 종료 |
public class HiResTimer
고해상도 타이머. System.Diagnostics.Stopwatch 기반으로 밀리초 단위 정밀 주기 타이머.
Constructors
| HiResTimer | () | 기본 생성 |
| HiResTimer | (float interval) | 주기 지정 생성 (ms) |
Properties
| float | Interval get set | 타이머 주기 (ms) |
| float | IgnoreElapsedThreshold get set | 지연 무시 임계값. 이 값 초과 시 이벤트 건너뜀. |
| bool | Enabled get set | 타이머 활성 여부 |
Methods
| void | Start | () | 타이머 시작 |
| void | Stop | () | 타이머 정지 |
Events
| EventHandler<HiResTimerElapsedEventArgs> | Elapsed | 주기마다 발생. HiResTimerElapsedEventArgs: Delay(실제 지연 ms), Fallouts(누락 횟수) |
public class NaturalSortComparer : IComparer<string>
자연 정렬 비교자. 숫자 부분을 수치로 비교 ("item2" < "item10").
Constructor
| NaturalSortComparer | (bool ascending = true, bool ignoreCase = true, CultureInfo? culture = null) | 정렬 방향·대소문자 무시 여부 지정 |
Methods
| int | Compare | (string? x, string? y) | 두 문자열 자연 정렬 비교 |
public static class NaturalSortExtensions
자연 정렬 LINQ 확장 메서드
Static Methods
| static IOrderedEnumerable<TSource> | OrderByNatural<TSource> | (this IEnumerable<TSource> source, Func<TSource, string?> keySelector, bool ascending = true, bool ignoreCase = true) | LINQ 자연 정렬 |
| static IOrderedEnumerable<TSource> | OrderByNaturalDescending<TSource> | (this IEnumerable<TSource> source, Func<TSource, string?> keySelector, bool ignoreCase = true) | LINQ 자연 역순 정렬 |
| static void | SortNatural<T> | (this List<T> list, Func<T, string?> keySelector, bool ascending = true) | List 인플레이스 자연 정렬 |
public static class CompressionUtility
JSON 데이터 GZip 압축/해제 유틸리티. 데이터 크기가 임계값 이상일 때 자동 압축.
Nested Classes
| class | CompressionResult | 압축 결과. Data(string?), IsCompressed(bool), OriginalSize(int), ProcessedSize(int), CompressionRatio(double, 계산 프로퍼티) |
| class | DecompressionResult<T> | 해제 결과. Data(T?), WasCompressed(bool), OriginalSize(int), DecompressedSize(int) |
Static Methods
| static CompressionResult | CompressJson<T> | (T obj) | 객체를 JSON 직렬화 후 GZip 압축 |
| static DecompressionResult<T> | DecompressJson<T> | (string base64Data, bool isCompressed, int originalSize) | Base64 데이터 해제 후 역직렬화 |
| static bool | ShouldCompress | (int dataSize) | 데이터 크기 기반 압축 여부 판단 |
| static string | GetCompressionInfo | (int originalSize, int processedSize, bool isCompressed) | 압축 결과 설명 문자열 |
검색 결과가 없습니다.