コード例 #1
0
        internal IDictionary GetDictionary(string dictionary)
        {
            // Speed optimization for the well-known dictionaries in case the same constant was used.
            // Make sure the string is interned usidng DictionaryFields.InternDictionaryName()
            if (ReferenceEquals(dictionary, DictionaryFields.Global))
            {
                return(_globalDictionary);
            }
            if (ReferenceEquals(dictionary, DictionaryFields.Template))
            {
                return(_templateDictionary);
            }
            if (ReferenceEquals(dictionary, DictionaryFields.Type))
            {
                return(_applicationTypeDictionary);
            }

            IDictionary value;

            if (!_dictionaries.TryGetValue(dictionary, out value))
            {
                _dictionaries[dictionary] = value = new GlobalDictionary();
            }
            return(value);
        }
コード例 #2
0
ファイル: Context.cs プロジェクト: radtek/Gradual
 private Dictionary GetDictionary(string dictionary)
 {
     if (!dictionaries.ContainsKey(dictionary))
     {
         dictionaries[dictionary] = new GlobalDictionary();
     }
     return(dictionaries[dictionary]);
 }
コード例 #3
0
ファイル: Context.cs プロジェクト: radtek/Gradual
 public Context()
 {
     dictionaries["global"]   = new GlobalDictionary();
     dictionaries["template"] = new TemplateDictionary();
     dictionaries["type"]     = new ApplicationTypeDictionary();
 }
コード例 #4
0
 public Context()
 {
     dictionaries["global"] = new GlobalDictionary();
     dictionaries["template"] = new TemplateDictionary();
     dictionaries["type"] = new ApplicationTypeDictionary();
 }
コード例 #5
0
 private Dictionary GetDictionary(string dictionary)
 {
     if (!dictionaries.ContainsKey(dictionary))
         dictionaries[dictionary] = new GlobalDictionary();
     return dictionaries[dictionary];
 }
コード例 #6
0
ファイル: Context.cs プロジェクト: shariqkudcs/openfastdotnet
        internal IDictionary GetDictionary(string dictionary)
        {
            // Speed optimization for the well-known dictionaries in case the same constant was used.
            // Make sure the string is interned usidng DictionaryFields.InternDictionaryName()
            if (ReferenceEquals(dictionary, DictionaryFields.Global)) return _globalDictionary;
            if (ReferenceEquals(dictionary, DictionaryFields.Template)) return _templateDictionary;
            if (ReferenceEquals(dictionary, DictionaryFields.Type)) return _applicationTypeDictionary;

            IDictionary value;
            if (!_dictionaries.TryGetValue(dictionary, out value))
                _dictionaries[dictionary] = value = new GlobalDictionary();
            return value;
        }