Module クラス
定義
モジュールにリフレクションを実行します。Performs reflection on a 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
[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.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
[<System.Runtime.InteropServices.ClassInterface(System.Runtime.InteropServices.ClassInterfaceType.None)>]
[<System.Serializable>]
[<System.Runtime.InteropServices.ComVisible(true)>]
type Module = class
interface ISerializable
interface ICustomAttributeProvider
[<System.Runtime.InteropServices.ClassInterface(System.Runtime.InteropServices.ClassInterfaceType.None)>]
[<System.Serializable>]
[<System.Runtime.InteropServices.ComVisible(true)>]
type Module = class
interface ISerializable
interface ICustomAttributeProvider
interface _Module
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
- 派生
- 属性
- 実装
例
次のコード例は、リフレクションを使用してモジュールに関する情報を取得する方法を示しています。The following code examples show how to use reflection to get information about modules:
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
注釈
モジュールは、1つまたは複数のクラスとインターフェイスで構成される、type.dll や application.exe などの移植可能な実行可能ファイルです。A module is a portable executable file, such as type.dll or application.exe, consisting of one or more classes and interfaces. 複数の名前空間が、単一モジュールに含まれることがあります。また、1 つの名前空間が複数のモジュールにまたがることもあります。There may be multiple namespaces contained in a single module, and a namespace may span multiple modules.
1 つの単位として配置される 1 つ以上のモジュールによってアセンブリが構成されます。One or more modules deployed as a unit compose an assembly. 複数のモジュールを含むアセンブリを作成する方法については、「 マルチファイルアセンブリ」を参照してください。For information about creating an assembly with more than one module, see Multifile Assemblies.
.NET Framework モジュールは Visual Basic のモジュールと同じではありません。これは、プログラマがアプリケーションで関数とサブルーチンを整理するために使用します。Note that a .NET Framework module is not the same as a module in Visual Basic, which is used by a programmers to organize functions and subroutines in an application.
コンストラクター
Module() |
Module クラスの新しいインスタンスを初期化します。Initializes a new instance of the Module class. |
フィールド
FilterTypeName |
名前に基づいて、このモジュールで定義された型の一覧をフィルター処理する |
FilterTypeNameIgnoreCase |
名前に基づいて、このモジュールで定義された型の一覧をフィルター処理する |
プロパティ
Assembly |
Module のこのインスタンスの適切な Assembly を取得します。Gets the appropriate Assembly for this instance of Module. |
CustomAttributes |
このモジュールのカスタム属性を含むコレクションを取得します。Gets a collection that contains this module's custom attributes. |
FullyQualifiedName |
このモジュールの完全修飾名とパスを表す文字列を取得します。Gets a string representing the fully qualified name and path to this module. |
MDStreamVersion |
メタデータ ストリーム バージョンを取得します。Gets the metadata stream version. |
MetadataToken |
メタデータ内のモジュールを識別するトークンを取得します。Gets a token that identifies the module in metadata. |
ModuleHandle |
モジュールのハンドルを取得します。Gets a handle for the module. |
ModuleVersionId |
モジュールの 2 つのバージョンを区別するために使用できる汎用一意識別子 (UUID) を取得します。Gets a universally unique identifier (UUID) that can be used to distinguish between two versions of a module. |
Name |
モジュールの名前をパスを削除した状態で表す |
ScopeName |
モジュールの名前を表す文字列を取得します。Gets a string representing the name of the module. |
メソッド
Equals(Object) |
このモジュールと指定したオブジェクトが等しいかどうかを判断します。Determines whether this module and the specified object are equal. |
Equals(Object) |
指定されたオブジェクトが現在のオブジェクトと等しいかどうかを判断します。Determines whether the specified object is equal to the current object. (継承元 Object) |
FindTypes(TypeFilter, Object) |
指定したフィルターとフィルター条件で受け入れられたクラスの配列を返します。Returns an array of classes accepted by the given filter and filter criteria. |
GetCustomAttributes(Boolean) |
すべてのカスタム属性を返します。Returns all custom attributes. |
GetCustomAttributes(Type, Boolean) |
指定された型のカスタム属性を取得します。Gets custom attributes of the specified type. |
GetCustomAttributesData() |
リフレクションのみのコンテキストで使用できる、現在のモジュールの CustomAttributeData オブジェクトのリストを返します。Returns a list of CustomAttributeData objects for the current module, which can be used in the reflection-only context. |
GetField(String) |
指定された名前のフィールドを返します。Returns a field having the specified name. |
GetField(String, BindingFlags) |
指定された名前とバインド属性を持つフィールドを返します。Returns a field having the specified name and binding attributes. |
GetFields() |
モジュールで定義されたグローバル フィールドを返します。Returns the global fields defined on the module. |
GetFields(BindingFlags) |
指定したバインディング フラグと一致するモジュールで定義されているグローバル フィールドを返します。Returns the global fields defined on the module that match the specified binding flags. |
GetHashCode() |
このインスタンスのハッシュ コードを返します。Returns the hash code for this instance. |
GetHashCode() |
既定のハッシュ関数として機能します。Serves as the default hash function. (継承元 Object) |
GetMethod(String) |
指定された名前のメソッドを返します。Returns a method having the specified name. |
GetMethod(String, BindingFlags, Binder, CallingConventions, Type[], ParameterModifier[]) |
指定された名前、バインド情報、呼び出し規則、パラメーターの型と修飾子を持つメソッドを返します。Returns a method having the specified name, binding information, calling convention, and parameter types and modifiers. |
GetMethod(String, Type[]) |
指定した名前とパラメーター型のメソッドを返します。Returns a method having the specified name and parameter types. |
GetMethodImpl(String, BindingFlags, Binder, CallingConventions, Type[], ParameterModifier[]) |
指定した基準に一致するメソッド実装を返します。Returns the method implementation in accordance with the specified criteria. |
GetMethods() |
モジュールで定義されたグローバル メソッドを返します。Returns the global methods defined on the module. |
GetMethods(BindingFlags) |
指定したバインディング フラグと一致するモジュールで定義されているグローバル メソッドを返します。Returns the global methods defined on the module that match the specified binding flags. |
GetObjectData(SerializationInfo, StreamingContext) |
シリアル化されたオブジェクトに対して、ISerializable 実装を提供します。Provides an ISerializable implementation for serialized objects. |
GetPEKind(PortableExecutableKinds, ImageFileMachine) |
モジュール内のコードの性質およびモジュールの対象プラットフォームを示す値のペアを取得します。Gets a pair of values indicating the nature of the code in a module and the platform targeted by the module. |
GetSignerCertificate() |
このモジュールが属すアセンブリの Authenticode 署名に含まれた、証明書に対応する |
GetType() |
現在のインスタンスの Type を取得します。Gets the Type of the current instance. (継承元 Object) |
GetType(String) |
大文字小文字を区別する検索を実行して、指定された型を返します。Returns the specified type, performing a case-sensitive search. |
GetType(String, Boolean) |
指定された大文字と小文字の区別でモジュールを検索し、指定された型を返します。Returns the specified type, searching the module with the specified case sensitivity. |
GetType(String, Boolean, Boolean) |
大文字小文字を区別したモジュール検索を実行するかどうか、および型が見つからない場合に例外をスローするかどうかを指定して、指定された型を返します。Returns the specified type, specifying whether to make a case-sensitive search of the module and whether to throw an exception if the type cannot be found. |
GetTypes() |
このモジュール内で定義されたすべての型を返します。Returns all the types defined within this module. |
IsDefined(Type, Boolean) |
指定された属性型がこのモジュールに適用されているかどうかを示す値を返します。Returns a value that indicates whether the specified attribute type has been applied to this module. |
IsResource() |
オブジェクトがリソースかどうかを示す値を取得します。Gets a value indicating whether the object is a resource. |
MemberwiseClone() |
現在の Object の簡易コピーを作成します。Creates a shallow copy of the current Object. (継承元 Object) |
ResolveField(Int32) |
指定したメタデータ トークンで識別されるフィールドを返します。Returns the field identified by the specified metadata token. |
ResolveField(Int32, Type[], Type[]) |
指定したジェネリック型パラメーターで定義されたコンテキストの、指定したメタデータ トークンで識別されるフィールドを返します。Returns the field identified by the specified metadata token, in the context defined by the specified generic type parameters. |
ResolveMember(Int32) |
指定したメタデータ トークンで識別される型またはメンバーを返します。Returns the type or member identified by the specified metadata token. |
ResolveMember(Int32, Type[], Type[]) |
指定したジェネリック型パラメーターで定義されたコンテキストの、指定したメタデータ トークンで識別される型またはメンバーを返します。Returns the type or member identified by the specified metadata token, in the context defined by the specified generic type parameters. |
ResolveMethod(Int32) |
メソッドまたは指定したメタデータ トークンによって識別されるコンス トラクターを返します。Returns the method or constructor identified by the specified metadata token. |
ResolveMethod(Int32, Type[], Type[]) |
指定したジェネリック型パラメーターで定義されたコンテキストの、指定したメタデータ トークンで識別されるメソッドまたはコンストラクターを返します。Returns the method or constructor identified by the specified metadata token, in the context defined by the specified generic type parameters. |
ResolveSignature(Int32) |
メタデータ トークンで識別されるシグネチャ BLOB を返します。Returns the signature blob identified by a metadata token. |
ResolveString(Int32) |
指定したメタデータ トークンで識別される文字列を返します。Returns the string identified by the specified metadata token. |
ResolveType(Int32) |
指定したメタデータ トークンで識別される型を返します。Returns the type identified by the specified metadata token. |
ResolveType(Int32, Type[], Type[]) |
指定したジェネリック型パラメーターで定義されたコンテキストの、指定したメタデータ トークンで識別される型を返します。Returns the type identified by the specified metadata token, in the context defined by the specified generic type parameters. |
ToString() |
モジュールの名前を返します。Returns the name of the module. |
演算子
Equality(Module, Module) |
2 つの Module オブジェクトが等しいかどうかを示します。Indicates whether two Module objects are equal. |
Inequality(Module, Module) |
2 つの Module オブジェクトが等しくないかどうかを示します。Indicates whether two Module objects are not equal. |
明示的なインターフェイスの実装
_Module.GetIDsOfNames(Guid, IntPtr, UInt32, UInt32, IntPtr) |
一連の名前を対応する一連のディスパッチ識別子に割り当てます。Maps a set of names to a corresponding set of dispatch identifiers. |
_Module.GetTypeInfo(UInt32, UInt32, IntPtr) |
オブジェクトの型情報を取得します。この型情報を使用して、インターフェイスの型情報を取得できます。Retrieves the type information for an object, which can then be used to get the type information for an interface. |
_Module.GetTypeInfoCount(UInt32) |
オブジェクトが提供する型情報インターフェイスの数 (0 または 1) を取得します。Retrieves the number of type information interfaces that an object provides (either 0 or 1). |
_Module.Invoke(UInt32, Guid, UInt32, Int16, IntPtr, IntPtr, IntPtr, IntPtr) |
オブジェクトによって公開されたプロパティおよびメソッドへのアクセスを提供します。Provides access to properties and methods exposed by an object. |
ICustomAttributeProvider.GetCustomAttributes(Boolean) |
名前付きの属性を除く、このメンバーに定義されているすべてのカスタム属性の配列、またはカスタム属性がない場合は空の配列を返します。Returns an array of all of the custom attributes defined on this member, excluding named attributes, or an empty array if there are no custom attributes. |
ICustomAttributeProvider.GetCustomAttributes(Type, Boolean) |
型で識別された、このメンバーに定義されているカスタム属性の配列、または、この型のカスタム属性がない場合は空の配列を返します。Returns an array of custom attributes defined on this member, identified by type, or an empty array if there are no custom attributes of that type. |
ICustomAttributeProvider.IsDefined(Type, Boolean) |
|
拡張メソッド
GetCustomAttribute(Module, Type) |
指定されたモジュールに適用される指定された型のカスタム属性を取得します。Retrieves a custom attribute of a specified type that is applied to a specified module. |
GetCustomAttribute<T>(Module) |
指定されたモジュールに適用される指定された型のカスタム属性を取得します。Retrieves a custom attribute of a specified type that is applied to a specified module. |
GetCustomAttributes(Module) |
指定されたモジュールに適用されるカスタム属性のコレクションを取得します。Retrieves a collection of custom attributes that are applied to a specified module. |
GetCustomAttributes(Module, Type) |
指定されたモジュールに適用される指定された型のカスタム属性のコレクションを取得します。Retrieves a collection of custom attributes of a specified type that are applied to a specified module. |
GetCustomAttributes<T>(Module) |
指定されたモジュールに適用される指定された型のカスタム属性のコレクションを取得します。Retrieves a collection of custom attributes of a specified type that are applied to a specified module. |
IsDefined(Module, Type) |
指定された型のカスタム属性が指定されたモジュールに適用されているかどうかを示します。Indicates whether custom attributes of a specified type are applied to a specified module. |
GetModuleVersionId(Module) | |
HasModuleVersionId(Module) |