Exemple #1
0
        public override async Task Invoke(object parameter)
        {
            ActionStack?.BeginTransaction();
            commands.First().NodeCommand.StartCombinedInvoke();
            await Task.WhenAll(commands.Select(x => x.Invoke(parameter)));

            commands.First().NodeCommand.EndCombinedInvoke();
            ActionStack?.EndTransaction($"Executed {Name}");
        }
Exemple #2
0
        internal void EndCombinedAction(string displayName, string observableNodePath, object value)
        {
            var actions = ActionStack.GetCurrentTransactions();

            if (actions.Count == 0)
            {
                ActionStack.DiscardTransaction();
            }
            else
            {
                ActionStack.EndTransaction(displayName, x => new CombinedValueChangedActionItem(displayName, observableViewModelService, observableNodePath, Identifier, x));
            }
        }
Exemple #3
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}");
        }
        internal void EndCombinedAction(string displayName, string observableNodePath, object value)
        {
            var handler = NodeValueChanged;

            if (handler != null)
            {
                foreach (var nodeChange in combinedNodeChanges)
                {
                    handler(this, new ObservableViewModelNodeValueChangedArgs(this, nodeChange));
                }
            }
            combinedNodeChanges.Clear();
            ActionStack.EndTransaction(displayName);
        }
Exemple #5
0
        internal void EndCombinedAction(string displayName, string observableNodePath, object value)
        {
            bool shouldDiscard = true;

            foreach (var singleNode in dirtiableViewModels.Keys)
            {
                if (singleNode.Owner.singleNodeActionRegistered)
                {
                    shouldDiscard = false;
                }

                singleNode.Owner.singleNodeActionRegistered = false;
            }

            if (shouldDiscard)
            {
                ActionStack.DiscardTransaction();
            }
            else
            {
                ActionStack.EndTransaction(displayName, x => new CombinedValueChangedActionItem(displayName, observableViewModelService, observableNodePath, Identifier, x));
            }
        }
Exemple #6
0
 internal void EndCombinedAction(string displayName, string observableNodePath, object value)
 {
     ActionStack.EndTransaction(displayName, x => new CombinedValueChangedActionItem(displayName, ObservableViewModelService, observableNodePath, Identifier, x));
 }