Module 클래스

정의

모듈에서 리플렉션을 수행합니다.

public ref class Module abstract
public ref class Module abstract : System::Reflection::ICustomAttributeProvider, System::Runtime::Serialization::ISerializable
public ref class Module abstract : System::Reflection::ICustomAttributeProvider
public ref class Module : System::Reflection::ICustomAttributeProvider, System::Runtime::InteropServices::_Module, System::Runtime::Serialization::ISerializable
public ref class Module abstract : System::Reflection::ICustomAttributeProvider, System::Runtime::InteropServices::_Module, System::Runtime::Serialization::ISerializable
public abstract class Module
public abstract class Module : System.Reflection.ICustomAttributeProvider, System.Runtime.Serialization.ISerializable
public abstract class Module : System.Reflection.ICustomAttributeProvider
[System.Runtime.InteropServices.ClassInterface(System.Runtime.InteropServices.ClassInterfaceType.None)]
[System.Serializable]
public class Module : System.Reflection.ICustomAttributeProvider, System.Runtime.InteropServices._Module, System.Runtime.Serialization.ISerializable
[System.Runtime.InteropServices.ClassInterface(System.Runtime.InteropServices.ClassInterfaceType.None)]
[System.Serializable]
[System.Runtime.InteropServices.ComVisible(true)]
public class Module : System.Reflection.ICustomAttributeProvider, System.Runtime.InteropServices._Module, System.Runtime.Serialization.ISerializable
[System.Runtime.InteropServices.ClassInterface(System.Runtime.InteropServices.ClassInterfaceType.None)]
[System.Serializable]
[System.Runtime.InteropServices.ComVisible(true)]
public abstract class Module : System.Reflection.ICustomAttributeProvider, System.Runtime.InteropServices._Module, System.Runtime.Serialization.ISerializable
type Module = class
type Module = class
    interface ICustomAttributeProvider
    interface ISerializable
type Module = class
    interface ICustomAttributeProvider
[<System.Runtime.InteropServices.ClassInterface(System.Runtime.InteropServices.ClassInterfaceType.None)>]
[<System.Serializable>]
type Module = class
    interface _Module
    interface ISerializable
    interface ICustomAttributeProvider
[<System.Runtime.InteropServices.ClassInterface(System.Runtime.InteropServices.ClassInterfaceType.None)>]
[<System.Serializable>]
[<System.Runtime.InteropServices.ComVisible(true)>]
type Module = class
    interface _Module
    interface ISerializable
    interface ICustomAttributeProvider
Public MustInherit Class Module
Public MustInherit Class Module
Implements ICustomAttributeProvider, ISerializable
Public MustInherit Class Module
Implements ICustomAttributeProvider
Public Class Module
Implements _Module, ICustomAttributeProvider, ISerializable
Public MustInherit Class Module
Implements _Module, ICustomAttributeProvider, ISerializable
상속
Module
파생
특성
구현

예제

다음 코드 예제에서는 리플렉션을 사용하여 모듈에 대한 정보를 가져오는 방법을 보여 줍니다.

using System.Reflection;
using System;
public class Program {

    public static void Main() {
        Class1 c1 = new Class1();
        //  Show the current module.
        Module m = c1.GetType().Module;
        Console.WriteLine("The current module is {0}.", m.Name);

        //  List all modules in the assembly.
        Assembly curAssembly = typeof(Program).Assembly;
        Console.WriteLine("The current executing assembly is {0}.", curAssembly);

        Module[] mods = curAssembly.GetModules();
        foreach (Module md in mods) {
            Console.WriteLine("This assembly contains the {0} module", md.Name);
        }
        Console.ReadLine();
    }
}
class Class1 {
}
Imports System.Reflection

Public Class Program
    Public Shared Sub Main()

        Dim c1 As New Class1

        ' Show the current module.

        ' Note the brackets around "[Module]" to differentiate 
        ' it from the Visual Basic "Module" keyword.
        Dim m As [Module] = c1.GetType().Module
        Console.WriteLine("The current module is {0}.", m.Name)

        ' List all modules in the assembly.
        Dim curAssembly As Assembly = GetType(Program).Assembly
        Console.WriteLine("The executing assembly is {0}.", curAssembly)

        Dim mods() As [Module] = curAssembly.GetModules()

        For Each md As [Module] In mods
            Console.WriteLine("This assembly contains the {0} module", md.Name)
        Next
        Console.ReadLine()
    End Sub


End Class
Class Class1

End Class

설명

모듈은 하나 이상의 클래스와 인터페이스로 구성된 type.dll 또는 application.exe같은 이식 가능한 실행 파일입니다. 단일 모듈에 여러 네임스페이스가 포함될 수 있으며 네임스페이스는 여러 모듈에 걸쳐 있을 수 있습니다.

하나의 단위로 배포된 하나 이상의 모듈이 어셈블리를 구성합니다. 둘 이상의 모듈을 사용하여 어셈블리를 만드는 방법에 대한 자세한 내용은 다중 파일 어셈블리를 참조하세요.

.NET Framework 모듈은 프로그래머가 애플리케이션에서 함수 및 서브루틴을 구성하는 데 사용하는 Visual Basic 모듈과 동일하지 않습니다.

생성자

Name Description
Module()

Module 클래스의 새 인스턴스를 초기화합니다.

필드

Name Description
FilterTypeName

TypeFilter 이름에 따라 이 모듈에 정의된 형식 목록을 필터링하는 개체입니다. 이 필드는 대/소문자를 구분하며 읽기 전용입니다.

FilterTypeNameIgnoreCase

TypeFilter 이름에 따라 이 모듈에 정의된 형식 목록을 필터링하는 개체입니다. 이 필드는 대/소문자를 구분하지 않으며 읽기 전용입니다.

속성

Name Description
Assembly

의 이 인스턴스Assembly에 적합한 Module 값을 가져옵니다.

CustomAttributes

이 모듈의 사용자 지정 특성을 포함하는 컬렉션을 가져옵니다.

FullyQualifiedName

이 모듈의 정규화된 이름과 경로를 나타내는 문자열을 가져옵니다.

MDStreamVersion

메타데이터 스트림 버전을 가져옵니다.

MetadataToken

메타데이터에서 모듈을 식별하는 토큰을 가져옵니다.

ModuleHandle

모듈에 대한 핸들을 가져옵니다.

ModuleVersionId

두 버전의 모듈을 구분하는 데 사용할 수 있는 UUID(범용 고유 식별자)를 가져옵니다.

Name

경로가 String 제거된 모듈의 이름을 나타내는 값을 가져옵니다.

ScopeName

모듈의 이름을 나타내는 문자열을 가져옵니다.

메서드

Name Description
Equals(Object)

이 모듈과 지정된 개체가 같은지 여부를 확인합니다.

Equals(Object)

지정된 개체가 현재 개체와 같은지 여부를 확인합니다.

(다음에서 상속됨 Object)
FindTypes(TypeFilter, Object)

지정된 필터 및 필터 조건에 허용되는 클래스의 배열을 반환합니다.

GetCustomAttributes(Boolean)

모든 사용자 지정 특성을 반환합니다.

GetCustomAttributes(Type, Boolean)

지정된 형식의 사용자 지정 특성을 가져옵니다.

GetCustomAttributesData()

리플렉션 전용 컨텍스트에서 사용할 수 있는 현재 모듈의 개체 목록을 CustomAttributeData 반환합니다.

GetField(String, BindingFlags)

지정된 이름 및 바인딩 특성이 있는 필드를 반환합니다.

GetField(String)

지정된 이름을 가진 필드를 반환합니다.

GetFields()

모듈에 정의된 전역 필드를 반환합니다.

GetFields(BindingFlags)

지정된 바인딩 플래그와 일치하는 모듈에 정의된 전역 필드를 반환합니다.

GetHashCode()

이 인스턴스의 해시 코드를 반환합니다.

GetHashCode()

기본 해시 함수로 사용됩니다.

(다음에서 상속됨 Object)
GetMethod(String, BindingFlags, Binder, CallingConventions, Type[], ParameterModifier[])

지정된 이름, 바인딩 정보, 호출 규칙, 매개 변수 형식 및 한정자가 있는 메서드를 반환합니다.

GetMethod(String, Type[])

지정된 이름 및 매개 변수 형식이 있는 메서드를 반환합니다.

GetMethod(String)

지정된 이름을 가진 메서드를 반환합니다.

GetMethodImpl(String, BindingFlags, Binder, CallingConventions, Type[], ParameterModifier[])

지정된 조건에 따라 메서드 구현을 반환합니다.

GetMethods()

모듈에 정의된 전역 메서드를 반환합니다.

GetMethods(BindingFlags)

지정된 바인딩 플래그와 일치하는 모듈에 정의된 전역 메서드를 반환합니다.

GetObjectData(SerializationInfo, StreamingContext)
사용되지 않음.

ISerializable 직렬화된 개체에 대한 구현을 제공합니다.

GetPEKind(PortableExecutableKinds, ImageFileMachine)

모듈의 코드 특성과 모듈이 대상으로 하는 플랫폼을 나타내는 값 쌍을 가져옵니다.

GetSignerCertificate()

X509Certificate 이 모듈이 속한 어셈블리의 Authenticode 서명에 포함된 인증서에 해당하는 개체를 반환합니다. 어셈블리가 Authenticode에 서명 null 되지 않은 경우 반환됩니다.

GetType()

현재 인스턴스의 Type 가져옵니다.

(다음에서 상속됨 Object)
GetType(String, Boolean, Boolean)

지정된 형식을 반환하여 모듈을 대/소문자를 구분하여 검색할지 여부와 형식을 찾을 수 없는 경우 예외를 throw할지 여부를 지정합니다.

GetType(String, Boolean)

지정된 대/소문자를 구분하여 모듈을 검색하여 지정된 형식을 반환합니다.

GetType(String)

대/소문자를 구분하는 검색을 수행하여 지정된 형식을 반환합니다.

GetTypes()

이 모듈 내에 정의된 모든 형식을 반환합니다.

IsDefined(Type, Boolean)

지정된 특성 형식이 이 모듈에 적용되었는지 여부를 나타내는 값을 반환합니다.

IsResource()

개체가 리소스인지 여부를 나타내는 값을 가져옵니다.

MemberwiseClone()

현재 Object단순 복사본을 만듭니다.

(다음에서 상속됨 Object)
ResolveField(Int32, Type[], Type[])

지정된 제네릭 형식 매개 변수로 정의된 컨텍스트에서 지정된 메타데이터 토큰으로 식별되는 필드를 반환합니다.

ResolveField(Int32)

지정된 메타데이터 토큰으로 식별되는 필드를 반환합니다.

ResolveMember(Int32, Type[], Type[])

지정된 제네릭 형식 매개 변수로 정의된 컨텍스트에서 지정된 메타데이터 토큰으로 식별되는 형식 또는 멤버를 반환합니다.

ResolveMember(Int32)

지정된 메타데이터 토큰으로 식별되는 형식 또는 멤버를 반환합니다.

ResolveMethod(Int32, Type[], Type[])

지정된 제네릭 형식 매개 변수로 정의된 컨텍스트에서 지정된 메타데이터 토큰으로 식별되는 메서드 또는 생성자를 반환합니다.

ResolveMethod(Int32)

지정된 메타데이터 토큰으로 식별되는 메서드 또는 생성자를 반환합니다.

ResolveSignature(Int32)

메타데이터 토큰으로 식별되는 서명 Blob을 반환합니다.

ResolveString(Int32)

지정된 메타데이터 토큰으로 식별되는 문자열을 반환합니다.

ResolveType(Int32, Type[], Type[])

지정된 제네릭 형식 매개 변수로 정의된 컨텍스트에서 지정된 메타데이터 토큰으로 식별되는 형식을 반환합니다.

ResolveType(Int32)

지정된 메타데이터 토큰으로 식별되는 형식을 반환합니다.

ToString()

모듈의 이름을 반환합니다.

연산자

Name Description
Equality(Module, Module)

Module 개체가 같은지 여부를 나타냅니다.

Inequality(Module, Module)

Module 개체가 같지 않은지 여부를 나타냅니다.

명시적 인터페이스 구현

Name Description
_Module.GetIDsOfNames(Guid, IntPtr, UInt32, UInt32, IntPtr)

이름 집합을 해당 디스패치 식별자 집합에 매핑합니다.

_Module.GetTypeInfo(UInt32, UInt32, IntPtr)

인터페이스의 형식 정보를 가져오는 데 사용할 수 있는 개체의 형식 정보를 검색합니다.

_Module.GetTypeInfoCount(UInt32)

개체가 제공하는 형식 정보 인터페이스의 수를 검색합니다(0 또는 1).

_Module.Invoke(UInt32, Guid, UInt32, Int16, IntPtr, IntPtr, IntPtr, IntPtr)

개체에 의해 노출되는 속성 및 메서드에 대한 액세스를 제공합니다.

ICustomAttributeProvider.GetCustomAttributes(Boolean)

명명된 특성을 제외하고 이 멤버에 정의된 모든 사용자 지정 특성의 배열을 반환하거나 사용자 지정 특성이 없는 경우 빈 배열을 반환합니다.

ICustomAttributeProvider.GetCustomAttributes(Type, Boolean)

형식으로 식별되는 이 멤버에 정의된 사용자 지정 특성의 배열을 반환하거나, 해당 형식의 사용자 지정 특성이 없는 경우 빈 배열을 반환합니다.

ICustomAttributeProvider.IsDefined(Type, Boolean)

하나 이상의 인스턴스 attributeType 가 이 멤버에 정의되어 있는지 여부를 나타냅니다.

확장명 메서드

Name Description
GetCustomAttribute(Module, Type)

지정된 모듈에 적용되는 지정된 형식의 사용자 지정 특성을 검색합니다.

GetCustomAttribute<T>(Module)

지정된 모듈에 적용되는 지정된 형식의 사용자 지정 특성을 검색합니다.

GetCustomAttributes(Module, Type)

지정된 모듈에 적용되는 지정된 형식의 사용자 지정 특성 컬렉션을 검색합니다.

GetCustomAttributes(Module)

지정된 모듈에 적용되는 사용자 지정 특성의 컬렉션을 검색합니다.

GetCustomAttributes<T>(Module)

지정된 모듈에 적용되는 지정된 형식의 사용자 지정 특성 컬렉션을 검색합니다.

GetModuleVersionId(Module)

모듈에서 리플렉션을 수행합니다.

HasModuleVersionId(Module)

모듈에서 리플렉션을 수행합니다.

IsDefined(Module, Type)

지정된 형식의 사용자 지정 특성이 지정된 모듈에 적용되는지 여부를 나타냅니다.

적용 대상