/// <summary>
 /// Initializes a new instance of the <see cref="CellNotFoundException"/> class.
 /// </summary>
 /// <param name="message">The message that describes the error.</param>
 /// <param name="cellLocator">The cell locator.</param>
 public CellNotFoundException(
     string message,
     CellLocatorBase cellLocator)
     : base(message)
 {
     this.CellLocator = cellLocator;
 }
コード例 #2
0
 /// <summary>
 /// Initializes a new instance of the <see cref="CellValueMissingException"/> class.
 /// </summary>
 /// <param name="message">The message that describes the error.</param>
 /// <param name="cellLocator">The cell locator.</param>
 public CellValueMissingException(
     string message,
     CellLocatorBase cellLocator)
     : base(message)
 {
     this.CellLocator = cellLocator;
 }
コード例 #3
0
        private ICell GetCell(
            CellLocatorBase cellLocator)
        {
            ICell result;

            if (cellLocator is ReportCellLocator reportCellLocator)
            {
                result = this.reportCache.GetCell(reportCellLocator);
            }
            else if (cellLocator is SectionCellLocator sectionCellLocator)
            {
                var currentCell = DataStructureCellProtocols.CurrentCellStack.Peek();

                result = this.reportCache.GetCell(sectionCellLocator, currentCell);
            }
            else if (cellLocator is ThisCellLocator)
            {
                result = DataStructureCellProtocols.CurrentCellStack.Peek();
            }
            else
            {
                throw new NotSupportedException(Invariant($"This type of {nameof(CellLocatorBase)} is not supported: {cellLocator.GetType().ToStringReadable()}."));
            }

            return(result);
        }
コード例 #4
0
        /// <summary>
        /// Builds an operation that gets the value of a cell.
        /// </summary>
        /// <typeparam name="TValue">The type of value.</typeparam>
        /// <param name="cellLocator">The cell locator.</param>
        /// <returns>
        /// The operation.
        /// </returns>
        public static GetCellValueOp <TValue> GetValue <TValue>(
            this CellLocatorBase cellLocator)
        {
            var result = new GetCellValueOp <TValue>(Op.Const(cellLocator));

            return(result);
        }
コード例 #5
0
        /// <summary>
        /// Builds an operation that determines whether a cell has a value.
        /// </summary>
        /// <param name="cellLocator">The cell locator.</param>
        /// <returns>
        /// The operation.
        /// </returns>
        public static HasCellValueOp HasValue(
            this CellLocatorBase cellLocator)
        {
            var result = new HasCellValueOp(Op.Const(cellLocator));

            return(result);
        }
コード例 #6
0
        /// <summary>
        /// Builds an <see cref="GetAvailabilityOp"/>.
        /// </summary>
        /// <param name="cellLocator">The cell locator.</param>
        /// <returns>
        /// The operation.
        /// </returns>
        public static GetAvailabilityOp GetAvailability(
            this CellLocatorBase cellLocator)
        {
            var result = new GetAvailabilityOp(Op.Const(cellLocator));

            return(result);
        }
コード例 #7
0
        /// <summary>
        /// Builds an <see cref="GetCellOpExecutionOutcomeOp"/>.
        /// </summary>
        /// <param name="cellLocator">The cell locator.</param>
        /// <returns>
        /// The operation.
        /// </returns>
        public static GetCellOpExecutionOutcomeOp GetOpExecutionOutcome(
            this CellLocatorBase cellLocator)
        {
            var result = new GetCellOpExecutionOutcomeOp(Op.Const(cellLocator));

            return(result);
        }
コード例 #8
0
 /// <summary>
 /// Initializes a new instance of the <see cref="CellValueMissingException"/> class.
 /// </summary>
 /// <param name="cellLocator">The cell locator.</param>
 public CellValueMissingException(
     CellLocatorBase cellLocator)
     : base()
 {
     this.CellLocator = cellLocator;
 }
 /// <summary>
 /// Initializes a new instance of the <see cref="CellNotFoundException"/> class.
 /// </summary>
 /// <param name="cellLocator">The cell locator.</param>
 public CellNotFoundException(
     CellLocatorBase cellLocator)
 {
     this.CellLocator = cellLocator;
 }