/// <inheritdoc />
        public bool Equals(ConstCell <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.Value.IsEqualTo(other.Value) &&
                         this.ValueFormat.IsEqualTo(other.ValueFormat) &&
                         this.Format.IsEqualTo(other.Format) &&
                         this.HoverOver.IsEqualTo(other.HoverOver) &&
                         this.Link.IsEqualTo(other.Link);

            return(result);
        }
Exemplo n.º 2
0
        /// <summary>
        /// Builds an <see cref="IConstOutputCell{TValue}"/>.
        /// </summary>
        /// <typeparam name="TValue">The type of value.</typeparam>
        /// <param name="value">The cell's value.</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="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 ConstCell <TValue> CreateConst <TValue>(
            TValue value,
            string id          = null,
            int?columnsSpanned = null,
            string details     = null,
            ICellValueFormat <TValue> valueFormat = null,
            CellFormat format    = null,
            IHoverOver hoverOver = null,
            ILink link           = null)
        {
            var result = new ConstCell <TValue>(value, id, columnsSpanned, details, null, null, Availability.Enabled, null, null, valueFormat, format, hoverOver, link);

            return(result);
        }
        public override ConstOutputCellBase <TValue> DeepCloneWithValue(TValue value)
        {
            var result = new ConstCell <TValue>(
                value,
                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.ValueFormat?.DeepClone(),
                this.Format?.DeepClone(),
                this.HoverOver?.DeepClone(),
                this.Link?.DeepClone());

            return(result);
        }