コード例 #1
0
        public ComposablePartCatalogAssemblyCache(Type stubType, ComposablePartCatalogCacheReader reader)
        {
            Assumes.NotNull(stubType);
            Assumes.NotNull(reader);

            this._stubType = stubType;
            this._reader = reader;

            // Get catalog metadata
            MethodInfo getCatalogMetadataMethod = ComposablePartCatalogAssemblyCacheReader.GetCacheTypeMethod(this._stubType, CacheStructureConstants.CachingStubGetCatalogMetadata, BindingFlags.Public | BindingFlags.Static);
            Func<IDictionary<string, object>> getCatalogMetadata = (Func<IDictionary<string, object>>)Delegate.CreateDelegate(typeof(Func<IDictionary<string, object>>), getCatalogMetadataMethod);
            this._metadata = getCatalogMetadata.Invoke();
        }
コード例 #2
0
        public ComposablePartCatalogAssemblyCache(Type stubType, ComposablePartCatalogCacheReader reader)
        {
            Assumes.NotNull(stubType);
            Assumes.NotNull(reader);

            this._stubType = stubType;
            this._reader   = reader;

            // Get catalog metadata
            MethodInfo getCatalogMetadataMethod = ComposablePartCatalogAssemblyCacheReader.GetCacheTypeMethod(this._stubType, CacheStructureConstants.CachingStubGetCatalogMetadata, BindingFlags.Public | BindingFlags.Static);
            Func <IDictionary <string, object> > getCatalogMetadata = (Func <IDictionary <string, object> >)Delegate.CreateDelegate(typeof(Func <IDictionary <string, object> >), getCatalogMetadataMethod);

            this._metadata = getCatalogMetadata.Invoke();
        }