private void tsBtnModify_Click(object sender, EventArgs e) { Anime a = this.folvAnime.SelectedObject as Anime; if (a == null) { return; } //long ls = a.Size; ModForm mf = new ModForm(a); mf.FormClosed += new FormClosedEventHandler(this.ModForm_FormClosed); mf.Show(); //if (mf.ShowDialog(this) == DialogResult.OK) //{ // _ai.Space -= ls; // //a.EditCopy(mf.GetAnime()); // _ai.Space += a.Size; // _ai.IsSaved = false; // this.folvAnime_SelectionChanged(null, null); // this.folvAnime.RefreshItem(this.folvAnime.SelectedItem); // // TODO: 需修正工具栏 // //this.folvAnime.Focus(); // this.tsslSpace.Text = String.Format("Total Size: {0:#,##0.#0} GB", _ai.Space / 1073741824D); // this.tsBtnSave.Enabled = true; //} }
private void ModForm_FormClosed(object sender, FormClosedEventArgs e) { ModForm mf = sender as ModForm; if (mf != null && mf.DialogResult == DialogResult.OK) { _ai.Space += mf.GetDiffSize(); _ai.IsSaved = false; this.folvAnime_SelectionChanged(null, null); this.folvAnime.RefreshItem(this.folvAnime.ModelToItem(mf.GetAnime())); this.tsslSpace.Text = String.Format("Total Size: {0:#,##0.#0} GB", _ai.Space / 1073741824D); } }