Example #1
0
        private IDictionary CreateCaseInsensitiveWrapper(IDictionary dict)
        {
            if (dict == null)
            {
                return(dict);
            }
            Hashtable             hashtable  = SystemInfo.CreateCaseInsensitiveHashtable();
            IDictionaryEnumerator enumerator = dict.GetEnumerator();

            try
            {
                while (enumerator.MoveNext())
                {
                    DictionaryEntry current = (DictionaryEntry)enumerator.Current;
                    hashtable[current.Key] = current.Value;
                }
            }
            finally
            {
                IDisposable disposable = enumerator as IDisposable;
                if (disposable != null)
                {
                    disposable.Dispose();
                }
            }
            return(hashtable);
        }
        private IDictionary CreateCaseInsensitiveWrapper(IDictionary dict)
        {
            if (dict == null)
            {
                return(dict);
            }
            Hashtable hash = SystemInfo.CreateCaseInsensitiveHashtable();

            foreach (DictionaryEntry entry in dict)
            {
                hash[entry.Key] = entry.Value;
            }
            return(hash);
        }