/// <summary> /// 获取配置 /// </summary> /// <param name="index">配置索引</param> /// <param name="type">商城类型</param> /// <returns>配置</returns> public static mw.RandConfig GetConfig(int index, mw.Enums.RandType type) { int realIndex = RandTable.GetRealIndex(index, type); if (realIndex >= 0) { return(RandTable.RandList[realIndex]); } else { return(null); } }
/// <summary> /// 删除按钮响应 /// </summary> protected void deleteButton_Click(object sender, EventArgs e) { if (this.configListBox.SelectedIndex < 0) { return; } mw.Enums.RandType type = (mw.Enums.RandType) int.Parse(this.randTypeDropDownList.SelectedValue); RandTable.RandList.RemoveAt(RandTable.GetRealIndex(this.configListBox.SelectedIndex, type)); this.configListBox.Items.RemoveAt(this.configListBox.SelectedIndex); TableManager.Save(RandTable.RandList); this.addButton.Enabled = this.configListBox.Items.Count < Mall.GetRandTypeLimit(type); }