/// <inheritdoc />
        public bool Equals(OperationCell <TValue> other)
        {
            if (ReferenceEquals(this, other))
            {
                return(true);
            }

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

            var result = this.Id.IsEqualTo(other.Id, StringComparer.Ordinal) &&
                         this.ColumnsSpanned.IsEqualTo(other.ColumnsSpanned) &&
                         this.Details.IsEqualTo(other.Details, StringComparer.Ordinal) &&
                         this.Validation.IsEqualTo(other.Validation) &&
                         this.ValidationEvents.IsEqualTo(other.ValidationEvents) &&
                         this.DefaultAvailability.IsEqualTo(other.DefaultAvailability) &&
                         this.AvailabilityCheckEvents.IsEqualTo(other.AvailabilityCheckEvents) &&
                         this.AvailabilityCheck.IsEqualTo(other.AvailabilityCheck) &&
                         this.Operation.IsEqualTo(other.Operation) &&
                         this.OperationExecutionEvents.IsEqualTo(other.OperationExecutionEvents) &&
                         this.ValueFormat.IsEqualTo(other.ValueFormat) &&
                         this.Format.IsEqualTo(other.Format) &&
                         this.HoverOver.IsEqualTo(other.HoverOver) &&
                         this.Link.IsEqualTo(other.Link);

            return(result);
        }
Exemple #2
0
        /// <summary>
        /// Builds an <see cref="IOperationOutputCell{TValue}"/>.
        /// </summary>
        /// <typeparam name="TValue">The type of value.</typeparam>
        /// <param name="operation">The operation.</param>
        /// <param name="id">OPTIONAL unique identifier of the cell.  DEFAULT is a cell with no unique identifier.</param>
        /// <param name="columnsSpanned">OPTIONAL number of columns spanned or null if none (cell occupies a single column).  DEFAULT is none.</param>
        /// <param name="details">OPTIONAL details about the cell.  DEFAULT is to omit any details.</param>
        /// <param name="validation">OPTIONAL validation to perform.  DEFAULT is no validation.</param>
        /// <param name="valueFormat">OPTIONAL format to apply to the cell value.  DEFAULT is to leave the format unchanged.</param>
        /// <param name="format">OPTIONAL format to apply to the cell.  DEFAULT is to leave the format unchanged.</param>
        /// <param name="hoverOver">OPTIONAL hover-over for the cell.  DEFAULT is no hover-over.</param>
        /// <param name="link">OPTIONAL link to some resource.  DEFAULT is no link.</param>
        /// <returns>
        /// The cell.
        /// </returns>
        public static OperationCell <TValue> CreateOp <TValue>(
            IReturningOperation <TValue> operation,
            string id             = null,
            int?columnsSpanned    = null,
            string details        = null,
            Validation validation = null,
            ICellValueFormat <TValue> valueFormat = null,
            CellFormat format    = null,
            IHoverOver hoverOver = null,
            ILink link           = null)
        {
            var result = new OperationCell <TValue>(operation, id, columnsSpanned, details, validation, null, Availability.Enabled, null, null, null, valueFormat, format, hoverOver, link);

            return(result);
        }
        protected override CellBase DeepCloneInternal()
        {
            var result = new OperationCell <TValue>(
                this.Operation?.DeepClone(),
                this.Id?.DeepClone(),
                this.ColumnsSpanned?.DeepClone(),
                this.Details?.DeepClone(),
                this.Validation?.DeepClone(),
                this.ValidationEvents?.DeepClone(),
                this.DefaultAvailability.DeepClone(),
                this.AvailabilityCheck?.DeepClone(),
                this.AvailabilityCheckEvents?.DeepClone(),
                this.OperationExecutionEvents?.DeepClone(),
                this.ValueFormat?.DeepClone(),
                this.Format?.DeepClone(),
                this.HoverOver?.DeepClone(),
                this.Link?.DeepClone());

            return(result);
        }
        public OperationCell <TValue> DeepCloneWithLink(ILink link)
        {
            var result = new OperationCell <TValue>(
                this.Operation?.DeepClone(),
                this.Id?.DeepClone(),
                this.ColumnsSpanned?.DeepClone(),
                this.Details?.DeepClone(),
                this.Validation?.DeepClone(),
                this.ValidationEvents?.DeepClone(),
                this.DefaultAvailability.DeepClone(),
                this.AvailabilityCheck?.DeepClone(),
                this.AvailabilityCheckEvents?.DeepClone(),
                this.OperationExecutionEvents?.DeepClone(),
                this.ValueFormat?.DeepClone(),
                this.Format?.DeepClone(),
                this.HoverOver?.DeepClone(),
                link);

            return(result);
        }
        public override OperationOutputCellBase <TValue> DeepCloneWithOperationExecutionEvents(IReadOnlyList <CellOpExecutionEventBase> operationExecutionEvents)
        {
            var result = new OperationCell <TValue>(
                this.Operation?.DeepClone(),
                this.Id?.DeepClone(),
                this.ColumnsSpanned?.DeepClone(),
                this.Details?.DeepClone(),
                this.Validation?.DeepClone(),
                this.ValidationEvents?.DeepClone(),
                this.DefaultAvailability.DeepClone(),
                this.AvailabilityCheck?.DeepClone(),
                this.AvailabilityCheckEvents?.DeepClone(),
                operationExecutionEvents,
                this.ValueFormat?.DeepClone(),
                this.Format?.DeepClone(),
                this.HoverOver?.DeepClone(),
                this.Link?.DeepClone());

            return(result);
        }
        public override NotSlottedCellBase DeepCloneWithAvailabilityCheck(AvailabilityCheck availabilityCheck)
        {
            var result = new OperationCell <TValue>(
                this.Operation?.DeepClone(),
                this.Id?.DeepClone(),
                this.ColumnsSpanned?.DeepClone(),
                this.Details?.DeepClone(),
                this.Validation?.DeepClone(),
                this.ValidationEvents?.DeepClone(),
                this.DefaultAvailability.DeepClone(),
                availabilityCheck,
                this.AvailabilityCheckEvents?.DeepClone(),
                this.OperationExecutionEvents?.DeepClone(),
                this.ValueFormat?.DeepClone(),
                this.Format?.DeepClone(),
                this.HoverOver?.DeepClone(),
                this.Link?.DeepClone());

            return(result);
        }
        public override CellBase DeepCloneWithDetails(string details)
        {
            var result = new OperationCell <TValue>(
                this.Operation?.DeepClone(),
                this.Id?.DeepClone(),
                this.ColumnsSpanned?.DeepClone(),
                details,
                this.Validation?.DeepClone(),
                this.ValidationEvents?.DeepClone(),
                this.DefaultAvailability.DeepClone(),
                this.AvailabilityCheck?.DeepClone(),
                this.AvailabilityCheckEvents?.DeepClone(),
                this.OperationExecutionEvents?.DeepClone(),
                this.ValueFormat?.DeepClone(),
                this.Format?.DeepClone(),
                this.HoverOver?.DeepClone(),
                this.Link?.DeepClone());

            return(result);
        }