47 references to GetModules
Microsoft.CodeAnalysis (3)
Compilation\DeterministicKeyBuilder.cs (1)
299var modules = assemblyMetadata.GetModules();
DiagnosticAnalyzer\AnalyzerFileReference.cs (1)
232foreach (var module in assembly.GetModules())
MetadataReference\AssemblyMetadata.cs (1)
410var modules = GetModules();
Microsoft.CodeAnalysis.CSharp.Emit2.UnitTests (4)
Emit\EditAndContinue\AssemblyReferencesTests.cs (2)
69var baseline = CreateInitialBaseline(compilation0, md1.GetModules()[0], handle => default(EditAndContinueMethodDebugInformation)); 145var baseline = CreateInitialBaseline(compilation0, md1.GetModules()[0], handle => default(EditAndContinueMethodDebugInformation));
Emit\EditAndContinue\EditAndContinueTests.cs (2)
10034var moduleMetadata0 = ((AssemblyMetadata)metadata0.GetMetadataNoCopy()).GetModules()[0]; 11168var moduleMetadata0 = ((AssemblyMetadata)metadata0.GetMetadataNoCopy()).GetModules()[0];
Microsoft.CodeAnalysis.Scripting.Desktop.UnitTests (4)
MetadataShadowCopyProviderTests.cs (4)
145Assert.Equal(3, metadata1.GetModules().Length); 176for (int i = 0; i < metadata2.GetModules().Length; i++) 178Assert.NotSame(metadata2.GetModules()[i], modifiedMetadata3.GetModules()[i]);
Microsoft.CodeAnalysis.Test.Utilities (2)
Compilation\MetadataReferenceExtensions.cs (1)
34if (assemblyMetadata.GetModules() is { Length: > 0 } modules)
CompilationVerifier.cs (1)
941return (metadata.Kind == MetadataImageKind.Assembly) ? ((AssemblyMetadata)metadata).GetModules().AsEnumerable() : SpecializedCollections.SingletonEnumerable((ModuleMetadata)metadata);
Microsoft.CodeAnalysis.UnitTests (31)
MetadataReferences\AssemblyMetadataTests.cs (29)
50Assert.Equal(1, a.GetModules().Length); 51Assert.Equal("MultiModule.dll", a.GetModules()[0].Name); 65Assert.Equal(3, a.GetModules().Length); 66Assert.Equal("MultiModule.dll", a.GetModules()[0].Name); 67Assert.Equal("mod2.netmodule", a.GetModules()[1].Name); 68Assert.Equal("mod3.netmodule", a.GetModules()[2].Name); 104Assert.False(copy1.GetModules()[0].IsImageOwner, "Module should not own the image"); 105Assert.False(copy1.GetModules()[1].IsImageOwner, "Module should not own the image"); 106Assert.False(copy1.GetModules()[2].IsImageOwner, "Module should not own the image"); 108Assert.Equal(m1.Module, copy1.GetModules()[0].Module); 109Assert.Equal(m2.Module, copy1.GetModules()[1].Module); 110Assert.Equal(m3.Module, copy1.GetModules()[2].Module); 114Assert.False(copy2.GetModules()[0].IsImageOwner, "Module should not own the image"); 115Assert.False(copy2.GetModules()[1].IsImageOwner, "Module should not own the image"); 116Assert.False(copy2.GetModules()[2].IsImageOwner, "Module should not own the image"); 118Assert.Equal(m1.Module, copy2.GetModules()[0].Module); 119Assert.Equal(m2.Module, copy2.GetModules()[1].Module); 120Assert.Equal(m3.Module, copy2.GetModules()[2].Module); 123Assert.Throws<ObjectDisposedException>(() => copy1.GetModules()[0].Module); 124Assert.Throws<ObjectDisposedException>(() => copy1.GetModules()[1].Module); 125Assert.Throws<ObjectDisposedException>(() => copy1.GetModules()[2].Module); 127Assert.NotNull(a.GetModules()[0].Module); 128Assert.NotNull(a.GetModules()[1].Module); 129Assert.NotNull(a.GetModules()[2].Module); 133Assert.Throws<ObjectDisposedException>(() => a.GetModules()[0].Module); 134Assert.Throws<ObjectDisposedException>(() => a.GetModules()[1].Module); 135Assert.Throws<ObjectDisposedException>(() => a.GetModules()[2].Module); 143Assert.Throws<BadImageFormatException>(() => metadata.GetModules()); 150Assert.Throws<BadImageFormatException>(() => metadata.GetModules());
MetadataReferences\MetadataReferenceTests.cs (2)
112Assert.Equal("CommonLanguageRuntimeLibrary", metadata.GetModules()[0].Name); 178Assert.Equal(module ? "ModuleCS00.netmodule" : "CommonLanguageRuntimeLibrary", metadata.GetModules()[0].Name);
Microsoft.CodeAnalysis.VisualBasic (1)
CommandLine\VisualBasicCommandLineParser.vb (1)
1572If metadata.GetModules()(0).Module.IsLinkedModule AndAlso
Microsoft.CodeAnalysis.Workspaces (2)
FindSymbols\SymbolTree\SymbolTreeInfo_Metadata.cs (1)
278return assembly.GetModules();
Serialization\SerializerService_Reference.cs (1)
245modules = assemblyMetadata.GetModules();