private UndoableDelegateCommand CreateRemoveConnectionCommand(IContainerChild connection, IObservableGraphSource observableGraphSource) { var link = this.ContainerGenerator.ItemFromContainer(connection) as ILink; var currentLink = link; return new UndoableDelegateCommand(CommandNames.RemoveConnection, s => observableGraphSource.RemoveLink(link), s => observableGraphSource.AddLink(currentLink)); }
private UndoableDelegateCommand CreateRemoveShapeCommand(IShape shape, IObservableGraphSource observableGraphSource) { var node = this.ContainerGenerator.ItemFromContainer(shape); return new UndoableDelegateCommand(CommandNames.RemoveShape, s => observableGraphSource.RemoveNode(node), s => observableGraphSource.AddNode(node)); }