Programming/C#
-
Build Event Dll Copy !Programming/C# 2020. 4. 7. 11:33
C#에서 필요한 DLL을 따로 모아두고 빌드시 복사하는 방법입니다. 프로젝트 속성 > 빌드 이벤트 에서 아래와 같이 설정합니다. DLL을 복사할 폴더에 접근할때 폴더가 없으면 오류가 발생합니다. 그렇기 때문에 빌드전 이벤트에 아래와 같이 입력합니다. if not exist "$(SolutionDir)DLL" mkdir "$(SolutionDir)DLL" $(SolutionDir)은 매크로 입니다. 원하는 경로를 따로 지정하셔도 됩니다. 위 내용은 솔루션 디렉토리에 있는 DLL 폴더가 없을 시 솔루션 디렉토리에 DLL 폴더를 생성하라는 명령어 입니다. 그리고 빌드후 이벤트에 아래와 같이 입력합니다. copy "$(SolutionDir)DLL" "$(TargetDir)" 위 내용은 솔루션 디렉토리에 있는 D..
-
[WPF] Grid Row & ColumnProgramming/C# 2020. 3. 26. 22:22
WPF에서 Grid 컨트롤을 분할하는 방법을 알아보겠습니다. XAML에서 하는 방법은 아래와 같습니다. 1 2 3 4 5 6 7 8 9 10 11 12 13 cs에서 하는 방법은 아래와 같습니다. 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 RowDefinition gridRow1 = new RowDefinition(); gridRow1.Height = new GridLength(1, GridUnitType.Star); RowDefinition gridRow2 = new RowDefinition(); gridRow1.Height = new GridLength(2, GridUnitType.Star); ColumnDefinition grid..
-
Summary !Programming/C# 2020. 3. 20. 20:05
c#에서 무언가에 대한 설명을 쓸 때, Summary를 사용합니다. 변수나 함수 위에 아래와 같은 형식으로 입력하면 됩니다. 변수 1 2 3 4 /// /// 숫자입니다. /// public int value; 함수 1 2 3 4 5 6 7 8 9 /// /// 함수입니다. /// /// 문자입니다. /// 리턴값 입니다. public int function(string value) { return 1; } 주의! dll 같이 다른 프로젝트에서 사용할 경우 프로젝트 속성 -> 빌드 -> 출력 부분에서 XML 문서 파일을 같이 생성하도록 설정해 줘야 합니다. 그리고 dll과 xml을 함께 배포하면 주석을 확인할 수 있습니다.
-
[WPF] WindowChrome !Programming/C# 2020. 3. 20. 00:20
WPF에서 타이틀 바를 바꿀 때 WindowStyle="None"로 설정한 뒤, 새로 만드는 경우가 많습니다. 하지만 이런 경우 타이틀 바의 기능을 직접 다 구현해 줘야 하는데, 타이틀 바에서 사용되는 애니메이션과 다양한 기능을 구현하는데 어려움이 있고, 다양한 버그가 있을 수 있습니다. 이러한 문제를 해결할 수 있는 것이 WindowChrome입니다. WindowStyle="None"를 하는 순간 비 클라이언트 영역을 없애버리지만, WindowChrome는 비 클라이언트 영역까지 확장해서 사용자가 사용할 수 있도록 해줍니다!
-
Json.NET을 사용해보자!Programming/C# 2019. 4. 7. 17:58
안녕하세요. Teemol입니다.오늘은 Json.NET의 사용법을 알아보겠습니다. Json.NET이란? .Net에서 Json을 처리하는 라이브러리입니다. 먼저 Json.Net을 사용하려면 NuGet을 사용해 Newtonsoft.Json을 설치해야 합니다.패키지 관리자 콘솔에서는 Install-Package Newtonsoft.Json로 설치할 수 있습니다. Json을 처리하기 위한 라이브러리기 때문에 당연히 Json이 필요하겠죠!?먼저 아래와 같이 제이슨을 만들겠습니다. TestJson.json12345678910111213{ "TestJson": { "DataStr": "Data", "DataInt": 100, "DataArry": ["Arry1", "Arry2", "Arry3"] } }Colored b..