예제 #1
0
        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));
        }
예제 #2
0
        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));
        }
예제 #3
0
        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));
        }
예제 #4
0
        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));
        }