Пример #1
0
 public Content(ContentManifest manifest, string currentLanguage = "en_US")
 {
     setManifest(manifest);
     assetIndex            = new WeakIndex <object>();
     activeRequests        = new Dictionary <string, CoroutineReturn>();
     activeRequestHandlers = new Dictionary <string, List <object> >();
     bundleManager         = new BundleManager(this.manifest);
     deviceManager         = new DeviceManager();
     this.currentLanguage  = currentLanguage;
     mountStandardDevices(manifest.BaseUri);
     Service.Get <EventDispatcher>().DispatchEvent(new ContentManifestUpdated(manifest));
 }
Пример #2
0
 public IEnumerable <T> Search(Func <string, bool> predicate)
 {
     foreach (KeyValuePair <string, WeakReference> kvp in index)
     {
         KeyValuePair <string, WeakReference> keyValuePair = kvp;
         if (predicate(keyValuePair.Key))
         {
             WeakIndex <T> weakIndex = this;
             keyValuePair = kvp;
             T obj = weakIndex.CheckIsAlive(keyValuePair.Key);
             if (obj != null)
             {
                 yield return(obj);
             }
         }
     }
 }