Exemple #1
0
        public WellKnownStringComparerCodec()
        {
            _ordinalComparer           = StringComparer.Ordinal;
            _ordinalIgnoreCaseComparer = StringComparer.OrdinalIgnoreCase;
            _defaultEqualityComparer   = EqualityComparer <string> .Default;

            _ordinalType           = _ordinalComparer.GetType();
            _ordinalIgnoreCaseType = _ordinalIgnoreCaseComparer.GetType();
            _defaultEqualityType   = _defaultEqualityComparer.GetType();
        }
        /// <summary>
        /// Initializes a new instance of the <see cref="WellKnownStringComparerCodec"/> class.
        /// </summary>
        public WellKnownStringComparerCodec()
        {
            _ordinalComparer           = StringComparer.Ordinal;
            _ordinalIgnoreCaseComparer = StringComparer.OrdinalIgnoreCase;
            _defaultEqualityComparer   = EqualityComparer <string> .Default;

            _ordinalType           = _ordinalComparer.GetType();
            _ordinalIgnoreCaseType = _ordinalIgnoreCaseComparer.GetType();
            _defaultEqualityType   = _defaultEqualityComparer.GetType();
#if !NET6_0_OR_GREATER
            _streamingContext   = new StreamingContext(StreamingContextStates.All);
            _formatterConverter = new FormatterConverter();
#endif
        }