Exemplo n.º 1
0
        protected override OperationBase DeepCloneInternal()
        {
            var result = new ExecuteOperationCellIfNecessaryOp <TValue>(
                this.Cell?.DeepClone());

            return(result);
        }
Exemplo n.º 2
0
        public ExecuteOperationCellIfNecessaryOp <TValue> DeepCloneWithCell(IOperationOutputCell <TValue> cell)
        {
            var result = new ExecuteOperationCellIfNecessaryOp <TValue>(
                cell);

            return(result);
        }
Exemplo n.º 3
0
        /// <inheritdoc />
        public bool Equals(ExecuteOperationCellIfNecessaryOp <TValue> other)
        {
            if (ReferenceEquals(this, other))
            {
                return(true);
            }

            if (ReferenceEquals(other, null))
            {
                return(false);
            }

            var result = this.Cell.IsEqualTo(other.Cell);

            return(result);
        }
Exemplo n.º 4
0
        /// <inheritdoc />
        public async Task ExecuteAsync(
            ExecuteOperationCellIfNecessaryOp <TValue> operation)
        {
            // NOTE: THIS CODE IS A NEAR DUPLICATE OF THE SYNC METHOD ABOVE; NO GOOD WAY TO D.R.Y. IT OUT
            if (operation == null)
            {
                throw new ArgumentNullException(nameof(operation));
            }

            var cell = operation.Cell;

            try
            {
                DataStructureCellProtocols.CurrentCellStack.Push(cell);

                await this.ExecuteOperationCellIfNecessaryAsync(cell);
            }
            finally
            {
                var poppedCell = DataStructureCellProtocols.CurrentCellStack.Pop();

                DataStructureCellProtocols.ThrowIfUnexpectedCellPoppedOffCurrentCellStack(cell, poppedCell);
            }
        }