private void listBox1_SelectedIndexChanged(object sender, EventArgs e) { CardLimitedList[] cll = LimitedListManager.GetInstance().GetItems(); if (listBox1.SelectedIndex >= 0 && listBox1.SelectedIndex < cll.Length) { richTextBox1.Text = cll[listBox1.SelectedIndex].Desc; } }
private void button3_Click(object sender, EventArgs e) { string YFCCDir = null; mAppInterface.GetAppDirEx(mAppInterface.AppName_YFCC, ref YFCCDir); string YFCCData = YFCCDir + "\\YGODATA\\YGODAT.DAT"; if (!File.Exists(YFCCData)) { YFCCData = YFCCDir + "\\YGODATA\\YGOSYS.DB"; } else { YFCCData = ""; } //MessageBox.Show("请选择天堂狐查卡器数据文件所在位置"); OpenFileDialog openFileDialog1 = new OpenFileDialog(); openFileDialog1.InitialDirectory = YFCCDir + "\\YGODATA\\"; openFileDialog1.Filter = "天堂狐查卡器数据文件 (YGODAT.DAT;YGOSYS.DB)|YGODAT.DAT;YGOSYS.DB|YGODAT.MDB)|YGODAT.MDB|All files (*.*)|*.*"; openFileDialog1.FilterIndex = 0; openFileDialog1.RestoreDirectory = true; openFileDialog1.Title = "请选择天堂狐查卡器数据文件所在位置"; openFileDialog1.FileName = "YGODAT.DAT"; if (openFileDialog1.ShowDialog() == DialogResult.OK) { this.Text = "数据读入中,请稍候"; DisableAllButton(); Application.DoEvents(); CardsReader mReader = new YFCCReader(); CardLibrary cardLibrary = new CardLibrary(mReader.Read(openFileDialog1.FileName, ProcessChanged)); //选择禁卡表 LimitedListManager llm = LimitedListManager.GetInstance(); llm.LoadFromYFCC(openFileDialog1.FileName); frmLimitedList form = new frmLimitedList(); form.ShowDialog(); this.Text = "索引建立中,请稍候"; CardsSaver lSaver = new LuceneSaver(); lSaver.Save("CardIndex", cardLibrary.GetCards(), ProcessChanged); this.Text = "卡包列表生成中,请稍候"; BuildPackageList(cardLibrary); this.Text = "辅助转换工具"; EnableAllButton(); MessageBox.Show("索引建立完成!\r\r请接着导入YGOPRO补充数据,否则将不能使用效果分类搜索,并且载入YGOPRO卡组时可能出错!", "温馨提示", MessageBoxButtons.OK, MessageBoxIcon.Information); } }
private void button1_Click(object sender, EventArgs e) { if (listBox1.SelectedIndex < 0) { MessageBox.Show("请选择一个默认的禁卡表!", "提示", MessageBoxButtons.OK, MessageBoxIcon.Warning); return; } LimitedListManager llm = LimitedListManager.GetInstance(); llm.SelectedIndex = listBox1.SelectedIndex; CardLibrary.GetInstance().UpdateLimitedList(llm.SelcetedItem); this.Close(); }
private void frmLimitedList_Load(object sender, EventArgs e) { LimitedListManager llm = LimitedListManager.GetInstance(); CardLimitedList[] cll = llm.GetItems(); listBox1.Items.Clear(); for (int i = 0; i < cll.Length; i++) { listBox1.Items.Add(cll[i].Name); } listBox1.SelectedIndex = llm.SelectedIndex; if (llm.SelcetedItem != null) { richTextBox1.Text = llm.SelcetedItem.Desc; } }
public CardLibrary(CardDescription[] cards) { Cards = cards; maxcardid = cards[cards.Length - 1].ID; UpdateLimitedList(LimitedListManager.GetInstance().SelcetedItem); }