public static bool PerformEdit(GameObject o) { using (EditGameObject f = new EditGameObject(o)) { return(f.ShowDialog() == DialogResult.OK); } }
private void gameObjectsDataGridView_CellDoubleClick(object sender, DataGridViewCellEventArgs e) { GameObject o = (GameObject)gameObjectsBindingSource.Current; if (o == null) { return; } EditGameObject.PerformEdit(o); }
private void gameObjectsBindingSource_AddingNew(object sender, AddingNewEventArgs e) { GameObject obj = new GameObject(); obj.Id = World.GetNextObjectId(); if (EditGameObject.PerformEdit(obj)) { e.NewObject = obj; } }