public IOperation Build() { Debug.Assert(_canBuild, ErrorMessages.InvalidOperation); var operation = new MergeableOperation <T>(_function, _new, _prev, _mergeJudge) { Message = _name }; return(_eventEventBinder.BindEvents(operation)); }
/// <summary> /// 2つのオペレーションをマージしたオペレーションを作成 /// 失敗した場合はOperation.Emptyが返却される /// </summary> public static IOperation MakeMerged(MergeableOperation prevOperation, MergeableOperation postOperation, bool checkKey = true) { if (checkKey) { if (postOperation.MergeJudge.CanMerge(prevOperation.MergeJudge)) { return(new MergeableOperation(postOperation._rollForward, prevOperation._rollBack, postOperation.MergeJudge)); } return(Extensions.Operation.Empty); } return(new MergeableOperation(postOperation._rollForward, prevOperation._rollBack, postOperation.MergeJudge)); }
public MergeableBuilder(MergeableOperation operation) : base(operation) { _mergeableOperation = operation; }