Пример #1
0
        public QuoteFinder(StringComparison stringComparison, Dispatcher dispatcher, int cacheThreshold)
        {
            // checking preconditions
            if (stringComparison == StringComparison.Ordinal ||
                stringComparison == StringComparison.OrdinalIgnoreCase)
            {
                throw new NotSupportedException();
            }
            else if (cacheThreshold < 0)
            {
                throw new ArgumentOutOfRangeException();
            }

            _cacheThreshold   = cacheThreshold;
            _stringComparison = stringComparison;
            _stringComparer   = stringComparison.GetStringComparer();
            _searchCacheKeyEqualityComparer = new SearchCacheKeyEqualityComparer(stringComparison, _stringComparer);
            _dispatcher = dispatcher;
        }
Пример #2
0
 public ConfigFile(IDictionary <string, ConfigSection> sections = null, StringComparison comparisonType = DefaultStringComparison)
 {
     _sections      = sections ?? new Dictionary <string, ConfigSection>(comparisonType.GetStringComparer());
     ComparisonType = comparisonType;
 }
Пример #3
0
 public ConfigSection(IDictionary <string, ConfigProperty> properties = null, StringComparison comparisonType = ConfigFile.DefaultStringComparison)
 {
     _properties    = properties ?? new Dictionary <string, ConfigProperty>(comparisonType.GetStringComparer());
     ComparisonType = comparisonType;
 }