/// <summary> /// 初始化 /// </summary> void Init() { this.Title = Config.g_title;//标题 WindowHook.RepairWindowBehavior(this); //充电监控 Frame cim = (Frame)FindName("frame_cim"); cim.Content = m_cim; OpenCIM(); //配电监控 Frame pdm = (Frame)FindName("frame_pdm"); pdm.Content = m_pdm; //安防监控 Frame sem = (Frame)FindName("frame_sem"); sem.Content = m_sem; //消防监控 Frame ffm = (Frame)FindName("frame_ffm"); ffm.Content = m_ffm; TCPStar(); }
/// <summary> /// 初始化 /// </summary> void Init() { this.Title = Config.g_title;//标题 WindowHook.RepairWindowBehavior(this); if (!File.Exists(Config.g_root + "\\config.ini")) { using (StreamWriter sw = File.CreateText(Config.g_root + "\\config.ini")) { } } else { List <string> list = new List <string>(); using (StreamReader sr = new StreamReader(Config.g_root + "\\config.ini")) { while (!sr.EndOfStream) { list.Add(sr.ReadLine()); } } for (int i = 0; i < list.Count; i++) { string[] arr = list[i].Split(':'); switch (arr[0]) { case "check_remember_checked": m_check_remember_checked = bool.Parse(arr[1]); break; case "text_name_text": m_text_name_text = arr[1]; break; } } } check_remember.IsChecked = m_check_remember_checked; text_name.Text = m_text_name_text; }