public void Load_Windows_Winmd_Test() { var metadataReader = new MetadataReader(@"C:\Program Files (x86)\Windows Kits\8.0\References\CommonConfiguration\Neutral\Windows.winmd"); foreach (var typeDef in metadataReader.EnumerateTypeDefinitions()) { Assert.IsNotNull(typeDef); } foreach (var typeRef in metadataReader.EnumerateTypeReferences()) { Assert.IsNotNull(typeRef); } foreach (var moduleRef in metadataReader.EnumerateModuleReferences()) { Assert.IsNotNull(moduleRef); } Assert.IsTrue( metadataReader.EnumerateTypeDefinitions().Any(x => x.FullName.Equals("Windows.Foundation.Collections.IMap`2"))); Assert.IsTrue( metadataReader.EnumerateTypeDefinitions().Any(x => x.FullName.Equals("Windows.Foundation.Collections.IObservableMap`2"))); }
public void Load_Platform_Winmd_Test() { var metadataReader = new MetadataReader(@"C:\Program Files (x86)\Microsoft SDKs\Windows\v8.0\ExtensionSDKs\Microsoft.VCLibs\11.0\References\CommonConfiguration\neutral\Platform.winmd"); foreach (var typeDef in metadataReader.EnumerateTypeDefinitions()) { Assert.IsNotNull(typeDef); } foreach (var typeRef in metadataReader.EnumerateTypeReferences()) { Assert.IsNotNull(typeRef); } foreach (var moduleRef in metadataReader.EnumerateModuleReferences()) { Assert.IsNotNull(moduleRef); } }
public void LoadNamesFrom(string winmdFilePath) { var metadataReader = new MetadataReader(winmdFilePath); foreach (var typeDefinition in metadataReader.EnumerateTypeDefinitions()) { this.Add(new TypeDefinitionMetadataICodeElementAdapter(typeDefinition, null, metadataReader)); } }