Ejemplo n.º 1
0
 private static TextResource GetBase(string resName)
 {
     lock (cache) {
         resName = "res";
         TextResource tr;
         if (!cache.TryGetValue(resName, out tr))
         {
             tr = new TextResource(resName);
             cache.Add(resName, tr);
         }
         return(tr);
     }
 }
Ejemplo n.º 2
0
 private TextResource(TextResource parent, string keyFilter)
 {
     this.filename = parent.filename;
     this.language = parent.language;
     this.filter   = (parent.filter == null ? "" : (parent.filter + ".")) + keyFilter;
     texts         = new Dictionary <string, string>();
     keyFilter     = keyFilter + ".";
     foreach (var key in parent.texts.Keys)
     {
         if (key.StartsWith(keyFilter))
         {
             texts.Add(key.Substring(keyFilter.Length), parent.texts[key]);
         }
     }
 }