/// <summary> /// 初始化界面数据 /// </summary> private void InitData() { // 检索条件部分 this.search_id_numericUpDown.Text = ""; // 资源组信息 this.search_group_comboBox.Items.Add(""); string[] groups = MainForm.ReadGroup(); if (groups != null) { foreach (var item in groups) { this.search_group_comboBox.Items.Add(item); } this.search_group_comboBox.Text = TFSRecordForm.m_strGroupName; } // 提交和Review名称提供记忆功能 string strCoder = IniInterface.GetValue("Search", "Checkin").Trim(); this.search_code_textBox.Text = strCoder; string strReviewer = IniInterface.GetValue("Search", "Reviewer").Trim(); this.search_review_textBox.Text = strReviewer; // 清空List this.record_listView.Items.Clear(); // 清空统计信息 UpdateStatuesBar(0, 0, 0, 0); }
/// <summary> /// 读取问题指定级别对应的类型信息 /// </summary> /// <returns></returns> public static List <string> ReadQuestionType(string strLevel) { List <string> retList = new List <string>(); int iCount = int.Parse(IniInterface.GetValue("Question", "Count")); for (int iIdx = 1; iIdx <= iCount; ++iIdx) { string strKey = string.Format("Level_{0}", iIdx); string strValue = IniInterface.GetValue("Question", strKey); if (strValue == strLevel) { strKey = string.Format("Type_{0}", iIdx); strValue = IniInterface.GetValue("Question", strKey); string[] types = Regex.Split(strValue, ",", RegexOptions.IgnoreCase); foreach (var item in types) { retList.Add(item); } break; } } return(retList); }
/// <summary> /// 读取问题的级别信息 /// </summary> /// <returns></returns> public static List <string> ReadQuestionLevel() { List <string> retList = new List <string>(); int iCount = int.Parse(IniInterface.GetValue("Question", "Count")); for (int iIdx = 1; iIdx <= iCount; ++iIdx) { string strKey = string.Format("Level_{0}", iIdx); string strValue = IniInterface.GetValue("Question", strKey); retList.Add(strValue); } return(retList); }
/// <summary> /// 初始化界面数据 /// </summary> private void InitData() { try { // 加载数据库信息 string strServer = IniInterface.GetValue("Database", "Server").Trim(); this.db_ip_textBox.Text = strServer; // 加载资源组信息 string strGroups = IniInterface.GetValue("Group", "Names").Trim(); string[] groups = Regex.Split(strGroups, ","); group_name_comboBox.Items.Clear(); foreach (var item in groups) { group_name_comboBox.Items.Add(item); } // 当前资源组 string strGroup = IniInterface.GetValue("Group", "Name").Trim(); if (strGroup != "") { group_name_comboBox.Text = strGroup; } else { group_name_comboBox.SelectedIndex = 0; } // 读取快捷键信息 string strCheckinKey = IniInterface.GetValue("HotKey", "Checkin").Trim(); key_checkin_textBox.Text = strCheckinKey; MainForm.m_strCheckinHotKey = strCheckinKey; string strReviewKey = IniInterface.GetValue("HotKey", "Review").Trim(); key_review_textBox.Text = strReviewKey; MainForm.m_strReviewHotKey = strReviewKey; } catch (System.Exception ex) { this.db_ip_textBox.Text = ""; } }
/// <summary> /// 读取配置文件的组信息 /// </summary> /// <returns></returns> public static string[] ReadGroup() { string strGroups = IniInterface.GetValue("Group", "Names"); return(Regex.Split(strGroups, ",", RegexOptions.IgnoreCase)); }