Ejemplo n.º 1
0
        public CheckAvailabilityOp DeepCloneWithAvailabilityCheckChain(AvailabilityCheckChain availabilityCheckChain)
        {
            var result = new CheckAvailabilityOp(
                availabilityCheckChain);

            return(result);
        }
Ejemplo n.º 2
0
        /// <summary>
        /// Initializes a new instance of the <see cref="CheckAvailabilityOp"/> class.
        /// </summary>
        /// <param name="availabilityCheckChain">A series of steps that determine the availability of the subject.</param>
        public CheckAvailabilityOp(
            AvailabilityCheckChain availabilityCheckChain)
        {
            if (availabilityCheckChain == null)
            {
                throw new ArgumentNullException(nameof(availabilityCheckChain));
            }

            this.AvailabilityCheckChain = availabilityCheckChain;
        }
Ejemplo n.º 3
0
        /// <summary>
        /// Builds a <see cref="CheckAvailabilityOp"/>.
        /// </summary>
        /// <param name="steps">The individual availability check steps.</param>
        /// <param name="endMessageOp">OPTIONAL operation to execute to get the message that should be emitted when all <paramref name="steps"/> have been evaluated and none have stopped the availability check (we've reached the end of the chain).  DEFAULT is to omit this message.</param>
        /// <param name="endAvailability">OPTIONAL value that specifies the availability of the subject when all <paramref name="steps"/> have been evaluated and none have stopped the availability check (we've reached the end of the chain).  DEFAULT is to determine that the subject is enabled.</param>
        /// <returns>
        /// The operation.
        /// </returns>
        public static CheckAvailabilityOp CheckAvailability(
            this IReadOnlyList <AvailabilityCheckStep> steps,
            IReturningOperation <string> endMessageOp = null,
            Availability endAvailability = Availability.Enabled)
        {
            var availabilityCheckChain = new AvailabilityCheckChain(steps, endMessageOp, endAvailability);

            var result = new CheckAvailabilityOp(availabilityCheckChain);

            return(result);
        }