private void comboBox_search_type_SelectedIndexChanged(object sender, EventArgs e) { search_type_enum = (SEARCH_TYPE_ENUM)comboBox_search_type.SelectedIndex; ReloadConfig(); UpdateLrcTextBox(""); }
// 搜索按钮点击事件 private void searchBtn_Click(object sender, EventArgs e) { ReloadConfig(); UpdateLrcTextBox(" "); SEARCH_TYPE_ENUM type = globalSearchInfo.SerchType; if (type == SEARCH_TYPE_ENUM.SONG_ID) { string[] ids = globalSearchInfo.SearchIds; if (ids.Length < 1) { MessageBox.Show(ErrorMsg.INPUT_ID_ILLEGAG, "提示"); return; } // 初始化结果 map globalSaveVOMap = new Dictionary <string, SaveVO>(); if (ids.Length > 1) { BatchSearch(ids); } else { SingleSearchBySongId(ids[0]); } } else { MessageBox.Show(ErrorMsg.FUNCTION_NOT_SUPPORT, "提示"); return; } }
// 输入参数校验 public static long CheckInputId(string input, SEARCH_TYPE_ENUM type, out string errorMsg) { long result = 0; if (type == SEARCH_TYPE_ENUM.SONG_ID) { if (input == "" || input == null || !NeteaseMusicUtils.CheckNum(input)) { errorMsg = ErrorMsg.INPUT_ID_ILLEGAG; } else { errorMsg = ErrorMsg.SUCCESS; result = long.Parse(input); } } else { errorMsg = ErrorMsg.FUNCTION_NOT_SUPPORT; } return(result); }