private void spellList_CellDoubleClick(object sender, DataGridViewCellEventArgs e) { if (e.RowIndex == -1) { return; } DataGridView dgv = (DataGridView)sender; DataTable dataSource = dgv.DataSource as DataTable; if (dataSource.Rows.Count == 0) { return; } object oval = dataSource.Rows[e.RowIndex][e.ColumnIndex]; object cellVal = dgv.Rows[e.RowIndex].Cells[e.ColumnIndex].Value; if (oval != null && cellVal is int) { Type type = BitMaskFlagHelper.Get(SCHEME_NAME, e.ColumnIndex); if (type == null) { return; } if (type.IsEnum) { mBitMaskForm.InitalizePanle(type, dgv, dataSource, e.RowIndex, e.ColumnIndex); mBitMaskForm.ShowDialog(); //mBitMaskForm.Show(); } } }
private void SpellEditorForm_Load(object sender, EventArgs e) { string patch = "../Server/Scp/"; patch += VocationFileName; patch += ".csv"; DataTableSerializer.LoadVocationCSV(patch); Config.InitConfig(); ExportPatchTextBox.Text = Config.GetExportPatch(); ImportPatchTextBox.Text = Config.GetImportPatch(); LogArearInstance = LogArear; BitMaskFlagHelper.PostSpell(); BulidSpellDatable(ref gSpell_All_DataList, Config.Vocation_Filter_ALL); // Build所有职业 for (VOCATION v = VOCATION.VOCATION_INVALID; v < VOCATION.VOCATION_MAX; v++) { BulidSpellDatable(ref gSpell_Vocation_DataList[(int)v], Config.GetVocationName(v)); } // 绑定所有职业 for (VOCATION v = VOCATION.VOCATION_INVALID; v < VOCATION.VOCATION_MAX; v++) { VocationTableSet.Add(v, gSpell_Vocation_DataList[(int)v]); } VocationTableSet = VocationTableSet.OrderBy(o => (int)o.Key).ToDictionary(p => p.Key, o => o.Value); //按VOCATION排一次序 DataTableSerializer.BuildDataGridViewFromDataTable(ref spellList, gSpell_All_DataList, typeof(SPELL.SPELL_DATA)); DataTableSerializer.FillDataGridViewFromDataTable(ref spellList, gSpell_All_DataList); DataTableSerializer.AddButtonToDataGridView(ref spellList, EditButtonHaderText, EditButtonHaderText, EditButtonCallBack); DataTableSerializer.AddButtonToDataGridView(ref spellList, AddButtonHaderText, AddButtonHaderText, AddButtonCallBack); spellList.SelectionChanged += spellList_SelectionChanged; CsvFilecheckBox.Checked = true; VocationFilterList.DataSource = Config.VocationFilterList; Trace.Normal("请点击加载按钮加载配置文件..."); }