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)); }
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); } } } }