public void Execute(object parameter = default) { Parameters = parameter.Cast <TParameter>(); Result = this._execute(Parameters, Result).Cast <TResult>(); ICommandWithUndoRedo.AddInUndo(this.Clone() as ICommandWithUndoRedo); ICommandWithUndoRedo.StackRedo.Clear(); Result = default(TResult); Parameters = default(TParameter); OnExecute?.Invoke(); }
void ICommandWithUndoRedo.ExecuteWithSubscribe() { this.Result = this._execute(this.Parameters, this.Result); ICommandWithUndoRedo.AddInUndo(this.Clone() as ICommandWithUndoRedo); }