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}"); }
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)); } }
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); }
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)); } }
internal void EndCombinedAction(string displayName, string observableNodePath, object value) { ActionStack.EndTransaction(displayName, x => new CombinedValueChangedActionItem(displayName, ObservableViewModelService, observableNodePath, Identifier, x)); }