전체 글
-
[WPF Tip] ObservableCollectionMicrosoft .NET/WPF Tip 2019. 3. 7. 01:39
ObservableCollection특징ListBox, ComboBox, ListView 등의 ItemSource에 직접적으로 연결하여 Item 변경 시에 직접적으로 변경하지 않고 ObervableCollection의 항목을 변경해야된다. 추가, 제거, 순서변경을 할 경우 자동으로 UIElement의 표출영역을 갱신한다. INotifyCollectionChanged, INotifyPropertyChanged을 상속받고 있어 항목에 변동이 있으면 이벤트를 발동시킬 수 있다.
-
[C#] #if, #else, #endif (Debug or Release에서 동작하는 코드 만들기)Microsoft .NET/C# 2019. 3. 6. 01:56
Debug 또는 Release에서 동작하는 코드 만들기 컴파일러의 상태에 따라 해당되지 않는 코드는 자동으로 주석 처리된다. //지금은 Release string strCompiler = string.Empty; #if DEBUG strCompiler = "DEBUG"; #else strCompiler = "RELEASE"; #endif Console.WriteLine(string.Format("Compiler : {0}", strCompiler)); //출력 - Compiler : RELEASE
-
[C#] 폴더 경로 / Folder PathMicrosoft .NET/C# 2019. 3. 6. 01:35
폴더 경로 받기 Environment.CurrentDirectory Forms System.Windows.Forms.Application.StartupPath 실행파일폴더 System.AppDomain.CurrentDomain.BaseDirectory 실행된 exe의 경로 System.IO.Path.GetDirectoryName(System.IO.Path.GetDirectoryName(System.AppDomain.CurrentDomain.BaseDirectory)) "../" 상위폴더 Environment.SystemDirectory 시스템폴더 Path.GetFileName(Environment.CurrentDirectory) 현재 폴더의 명
-
[C#] 날짜 출력 형식 변경(영문) 및 시간 측정Microsoft .NET/C# 2019. 3. 5. 01:21
날짜 출력 형식 변경 //16-Jun-2021 string result0 = DateTime.Now.ToString("dd-MMM-yyyy", new System.Globalization.CultureInfo("en-US")); //hh = 12시간 기준 //HH = 24시간 시준 //2018-06-21 06:48:40.4868 string result1 = DateTime.Now.ToString("yyyy-MM-dd hh:mm:ss.ffff"); //18-06-21 06:48:57.7224 string result2 = DateTime.Now.ToString("yy-MM-dd hh:mm:ss.ffff"); //18년06월21일 06시49분49.8483초 string result3 = DateTime.N..
-
[C#] 소수점 자릿수 변경, 소수점 반올림 올림 버림Microsoft .NET/C# 2019. 3. 5. 01:19
string.Format을 이용한 2가지 반올림 방법 //string.Format을 이용한 2가지 반올림 방법 double value = 5.123456789; //방법1 string result = string.Format("{0:0.#####0}", value); //결과값 result = "5.123457" //7번째 자리의 값을 반올림하여 출력. //방법2 string result = string.Format("{0:F6}", value); //결과값 result = "5.123457" //7번째 자리의 값을 반올림하여 출력. Math Class를 이용한 반올림, 올림, 내림 //Math Class를 이용 double value = 5.123456789; // 반올림 double result = ..
-
[JS_LIB] 1.0.6NuGet Package/JS_LIB 2019. 2. 28. 14:05
https://www.nuget.org/packages/JS_LIB/ Version 1.0.6 License https://virtualgiraffe.tistory.com/pages/NugetJSLIBLicense Window Window WIN_NULL Constructor public WIN_NULL(UserControl uc, string title = "", int startWidth = 1024, int startHeight = 768) uc Content 영역에 출력되는 UserControl title 제목 startWidth 창의 가로 크기 startHeight 창의 세로 크기 Attribute Function Start_Loading(string gifPath) 해당 경로의 GIF를 이용하..