Exemplo n.º 1
0
        public DictionaryValueProvider(IDictionary <string, TValue> dictionary, CultureInfo culture)
        {
            if (dictionary == null)
            {
                throw new ArgumentNullException("dictionary");
            }

            _prefixes = new PrefixContainer(dictionary.Keys);
            AddValues(dictionary, culture);
        }
Exemplo n.º 2
0
        internal CookieValueProvider(HttpCookieCollection collection, HttpCookieCollection unvalidatedCollection, CultureInfo culture)
        {
            if (collection == null)
            {
                throw new ArgumentNullException("collection");
            }

            _culture               = culture;
            _prefixes              = new PrefixContainer(collection.Keys.Cast <string>());
            _validatedCollection   = collection;
            _unvalidatedCollection = unvalidatedCollection ?? collection;

            foreach (string key in collection)
            {
                if (key != null)
                {
                    _values[key] = new ValueProviderResultPlaceholder(key, this);
                }
            }
        }
 public bool ContainsPrefix(string prefix)
 {
     return(PrefixContainer.IsPrefixMatch(Name, prefix));
 }