Ejemplo n.º 1
0
        public CategoricalCellValueFormat <TValue> DeepCloneWithValueToTextMap(IReadOnlyDictionary <TValue, string> valueToTextMap)
        {
            var result = new CategoricalCellValueFormat <TValue>(
                valueToTextMap,
                this.MissingValueText?.DeepClone());

            return(result);
        }
Ejemplo n.º 2
0
        protected override CellValueFormatBase <TValue> DeepCloneInternal()
        {
            var result = new CategoricalCellValueFormat <TValue>(
                this.ValueToTextMap?.DeepClone(),
                this.MissingValueText?.DeepClone());

            return(result);
        }
Ejemplo n.º 3
0
        public override StandardCellValueFormatBase <TValue> DeepCloneWithMissingValueText(string missingValueText)
        {
            var result = new CategoricalCellValueFormat <TValue>(
                this.ValueToTextMap?.DeepClone(),
                missingValueText);

            return(result);
        }
Ejemplo n.º 4
0
        public bool Equals(CategoricalCellValueFormat <TValue> other)
        {
            if (ReferenceEquals(this, other))
            {
                return(true);
            }

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

            var genericArgumentsUsedAsKeyInDictionary = new[] { typeof(TValue) };

            if (genericArgumentsUsedAsKeyInDictionary.Any(_ => (_ == typeof(DateTime)) || (_ == typeof(DateTime?))))
            {
                throw new NotSupportedException("This model contains one or more properties that are OR have within their generic argument tree or array element type a System Dictionary that is keyed on DateTime or DateTime?; IsEqualTo may do the wrong thing when comparing the keys of two such dictionaries (because it uses dictionary's embedded equality comparer, which is most likely the default comparer, which determines two DateTime objects to be equal if they have the same Ticks, regardless of whether they have the same Kind).");
            }

            var result = this.MissingValueText.IsEqualTo(other.MissingValueText, StringComparer.Ordinal) &&
                         this.ValueToTextMap.IsEqualTo(other.ValueToTextMap);

            return(result);
        }