private void RemoveItem(MeshType type, uint steps) { itemsController.ChangeSelection(0); items.RemoveAt((int)items.Count - 1); OnEachViewDo(view => view.Invalidate()); // simple test for undo/redo undo.PrepareUndo(string.Format("Add {0}", type.ToDisplayString()), Invocation.Create(type, steps, AddItem)); }
private void AddItem(MeshType type, uint steps) { Item item = new Item(); item.GetMesh().MakeMesh(type, steps); itemsController.ChangeSelection(0); item.Selected = 1; items.AddItem(item); itemsController.UpdateSelection(); OnEachViewDo(view => view.Invalidate()); undo.PrepareUndo(string.Format("Add {0}", type.ToDisplayString()), Invocation.Create(type, steps, RemoveItem)); }
private void RemoveItem(MeshType type, uint steps) { itemsController.ChangeSelection(0); items.RemoveAt((int)items.Count - 1); OnEachViewDo(view => view.Invalidate()); // simple test for undo/redo undo.PrepareUndo(string.Format("Add {0}", type.ToDisplayString()), Invocation.Create(type, steps, AddItem)); }
private void AddItem(MeshType type, uint steps) { Item item = new Item(); item.GetMesh().MakeMesh(type, steps); itemsController.ChangeSelection(0); item.Selected = 1; items.AddItem(item); itemsController.UpdateSelection(); OnEachViewDo(view => view.Invalidate()); undo.PrepareUndo(string.Format("Add {0}", type.ToDisplayString()), Invocation.Create(type, steps, RemoveItem)); }