c6474a59f345a4565136595cbf14a0983e209a82.svn-base 3.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104
  1. using System;
  2. using System.Collections.Generic;
  3. using System.ComponentModel;
  4. using System.Data;
  5. using System.Drawing;
  6. using System.Linq;
  7. using System.Text;
  8. using System.Windows.Forms;
  9. namespace IControls_FireManager
  10. {
  11. public partial class Form_System_Config : Form
  12. {
  13. public Form_System_Config()
  14. {
  15. InitializeComponent();
  16. ///
  17. /// 이벤트
  18. ///
  19. // 폼닫기 이벤트를 등록 (이벤트 핸들러 해제용)
  20. this.FormClosing += new FormClosingEventHandler(CreateForm_FormClosing);
  21. // 윈도우 스타일 변경 이벤트 핸들러 등록
  22. _Event.WindowStyleSet_SendMessage_Event += new _Event.WindowStyleSet_SendMessage_Handler(_Event_WindowStyleSet_SendMessage_Event);
  23. ///
  24. /// 스타일 변경
  25. ///
  26. UI_Style_Initialize();
  27. ///
  28. /// UI
  29. ///
  30. this.editBox_ProjectPath.Text = _Data.Project_Path;
  31. // cyim 2016.04.01 : 6자리 혹은 4자리로 맵아이디와 그룹아이디 지정할수 있도록함
  32. if (_Data.Project_MapGroupIDTypeNumber == "6")
  33. {
  34. this.radioButton_6.Checked = true;
  35. this.radioButton_4.Checked = false;
  36. }
  37. else
  38. {
  39. this.radioButton_6.Checked = false;
  40. this.radioButton_4.Checked = true;
  41. }
  42. }
  43. // 폼닫기 이벤트를 등록 (이벤트 핸들러 해제용)
  44. public void CreateForm_FormClosing(object sender, FormClosingEventArgs e)
  45. {
  46. // 윈도우 스타일 변경 이벤트 핸들러 해제
  47. _Event.WindowStyleSet_SendMessage_Event -= new _Event.WindowStyleSet_SendMessage_Handler(_Event_WindowStyleSet_SendMessage_Event);
  48. }
  49. // 윈도우 스타일 변경 이벤트
  50. public void _Event_WindowStyleSet_SendMessage_Event()
  51. {
  52. UI_Style_Initialize();
  53. }
  54. // 스타일 초기화 함수
  55. private void UI_Style_Initialize()
  56. {
  57. }
  58. // 폴더 패스 지정
  59. private void uiButton_ProjectPath_Click(object sender, EventArgs e)
  60. {
  61. FolderBrowserDialog folderBrowserDialog = new FolderBrowserDialog();
  62. if (folderBrowserDialog.ShowDialog() == DialogResult.OK)
  63. {
  64. this.editBox_ProjectPath.Text = folderBrowserDialog.SelectedPath;
  65. }
  66. }
  67. // 확인
  68. private void UiButton_Apply_Click(object sender, EventArgs e)
  69. {
  70. _Data.Project_Path = this.editBox_ProjectPath.Text;
  71. // cyim 2016.04.01 : 6자리 혹은 4자리로 맵아이디와 그룹아이디 지정할수 있도록함
  72. if (this.radioButton_6.Checked == true)
  73. _Data.Project_MapGroupIDTypeNumber = "6";
  74. else
  75. _Data.Project_MapGroupIDTypeNumber = "4";
  76. // 시스템 환경 옵션에 따른 Program_Configuration.xml 쓰기
  77. // 프로젝트 경로만 변경했더라도 xml 파일은 만들어진다.
  78. // 또한 이렇게 저장한 프로젝트는 최근 프로젝트명으로 xml 에 등록되어
  79. // 프로그램 시작시에 제일먼저 프로젝트 명 및 그에 따른 경로를 가져오게 된다
  80. _File.Write_ProgramConfiguration();
  81. this.Close();
  82. }
  83. }
  84. }