public static string GetCustomConfig(string key) { Dictionary <string, MedicalDocElement> docs = MedicalDocSettings.GetCustomForms(); foreach (KeyValuePair <string, MedicalDocElement> keyValuePair in docs) { if (keyValuePair.Key.Trim() == key) { return(keyValuePair.Value.Type); } } return(""); }
/// <summary> /// 导航菜单相关内容显示 /// </summary> /// <param name="currentButtonStrings"></param> /// <param name="groupIndex"></param> private void SetNavigateAndGrid(string[] currentButtonStrings, int groupIndex) { List <string> menus = new List <string>(); dgvMenuCanSelect.Rows.Clear(); Type type = typeof(ViewNames); FieldInfo[] fieldInfos = type.GetFields(); foreach (FieldInfo fieldInfo in fieldInfos) { dgvMenuCanSelect.Rows.Add(new string[] { fieldInfo.GetRawConstantValue().ToString().Trim() }); menus.Add(fieldInfo.GetRawConstantValue().ToString().Trim()); } Dictionary <string, MedicalDocElement> customViews = MedicalDocSettings.GetCustomForms(); foreach (KeyValuePair <string, MedicalDocElement> keyValuePair in customViews) { if (!menus.Contains(keyValuePair.Key)) { dgvMenuCanSelect.Rows.Add(new string[] { keyValuePair.Key }); menus.Add(keyValuePair.Key); } } dgvMenuSelected.Rows.Clear(); foreach (string str in currentButtonStrings) { string[] groupButtons = str.Split(new char[] { ',' }, StringSplitOptions.RemoveEmptyEntries); foreach (string text in groupButtons) { string btnText = text; if (btnText.Contains("\t")) { btnText = btnText.Replace("\t", ""); } while (btnText.Contains(" ")) { btnText = btnText.Replace(" ", ""); } if (!string.IsNullOrEmpty(btnText)) { if (str == currentButtonStrings[groupIndex]) { dgvMenuSelected.Rows.Add(new string[] { btnText }); } RemoveFromGrid(dgvMenuCanSelect, btnText); } } } }