Пример #1
0
 protected LocalizedDataHolder GetRootHolder(string language, bool createIfNotExisting)
 {
     if (!LanguageHash.ContainsKey(language))
     {
         if (!createIfNotExisting)
         {
             return(null);
         }
         LanguageHash[language] = new LocalizedDataHolder(language);
     }
     return(LanguageHash[language]);
 }
Пример #2
0
 /**
  * get a nested data holder by name
  *
  * @param key the name of the nested holder to get
  * @param createIfNotExisting if this is set to true a LocalizedDataHolder will be created if not already existing for the given key
  *
  * @return an instance of LocalizedDataHolder or null if nothing was found inside the nestedHash
  */
 private LocalizedDataHolder GetNested(string key, bool createIfNotExisting)
 {
     if (!NestedHash.ContainsKey(key))
     {
         // if we have not found it and we dont want to automatically create it we return null
         if (!createIfNotExisting)
         {
             return(null);
         }
         NestedHash[key] = new LocalizedDataHolder(key);
     }
     return(NestedHash[key]);
 }