Exemplo n.º 1
0
        public override async Task Invoke(object parameter)
        {
            ActionStack?.BeginTransaction();
            object index;
            var    modelNode = NodePath.GetSourceNode(out index);

            if (modelNode == null)
            {
                throw new InvalidOperationException("Unable to retrieve the node on which to apply the redo operation.");
            }

            NodeCommand.Execute(modelNode.Content, index, parameter);
            ActionStack?.EndTransaction($"Execute {Name}");
        }
Exemplo n.º 2
0
        public override void Invoke(object parameter)
        {
            using (var transaction = ActionService.CreateTransaction())
            {
                Index index;
                var   modelNode = NodePath.GetSourceNode(out index);
                if (modelNode == null)
                {
                    throw new InvalidOperationException("Unable to retrieve the node on which to apply the redo operation.");
                }

                NodeCommand.Execute(modelNode.Content, index, parameter);
                ActionService.SetName(transaction, ActionName);
            }
        }