コード例 #1
0
        private void Provider_NeedsUpdateChanged(object sender, EventArgs e)
        {
            AssetAggregator assetAggregator = this;
            int             num             = assetAggregator.NeedsUpdate | ((AssetProvider)sender).NeedsUpdate ? true : false;

            assetAggregator.NeedsUpdate = num != 0;
        }
コード例 #2
0
        public IEnumerable <T> FindAssetProviders <T>() where T : class
        {
            if (!this.initialized)
            {
                this.Initialize();
            }
            Queue <AssetProvider> queue = new Queue <AssetProvider>((IEnumerable <AssetProvider>) this.AssetProviders.Values);

            while (queue.Count > 0)
            {
                AssetProvider   provider   = queue.Dequeue();
                AssetAggregator aggregator = provider as AssetAggregator;
                if (aggregator != null)
                {
                    EnumerableExtensions.ForEach <AssetProvider>((IEnumerable <AssetProvider>)aggregator.AssetProviders, (Action <AssetProvider>)(item => queue.Enqueue(item)));
                }
                T result = provider as T;
                if ((object)result != null)
                {
                    if (provider.NeedsUpdate)
                    {
                        provider.Update();
                    }
                    yield return(result);
                }
            }
        }