Type.Module プロパティ
アセンブリ: mscorlib (mscorlib.dll 内)


現在の Type が構築ジェネリック型を表している場合、このプロパティは型が定義されたモジュールを返します。たとえば、MyGenericStack<int> のインスタンスを作成した場合、構築型の Module プロパティは、MyGenericStack<T> が定義されているモジュールを返します。
同様に、現在の Type がジェネリック パラメータ T を表す場合、このプロパティは T を定義するジェネリック型を含むアセンブリを返します。

Type の Namespace プロパティと Module プロパティ、および ToString メソッドを使用する例を次に示します。
Imports System Imports Microsoft.VisualBasic Namespace MyNamespace Class [MyClass] End Class '[MyClass] End Namespace 'MyNamespace Public Class Type_ToString_3 Public Shared Sub Main() Try Dim myType As Type = GetType(MyNamespace.MyClass) Console.WriteLine(ControlChars.NewLine + "Printing the details of {0}." + ControlChars.NewLine, myType) ' Get the namespace of the class Type_ToString_3. Console.WriteLine("Namespace: {0}.", myType.Namespace) ' Get the name of the module. Console.WriteLine("Module: {0}.", myType.Module) ' Get the fully qualified common language runtime namespace. Console.WriteLine("Fully qualified type: {0}.", myType.ToString()) Catch e As Exception Console.WriteLine("Exception: " + e.Message.ToString()) End Try End Sub 'Main End Class 'Type_ToString_3
using System; namespace MyNamespace { class MyClass { } } public class Type_ToString_3 { public static void Main() { try { Type myType = typeof(MyNamespace.MyClass); Console.WriteLine("\nPrinting the details of {0}.\n", myType); // Get the namespace of the class Type_ToString_3. Console.WriteLine("Namespace: {0}.", myType.Namespace); // Get the name of the module. Console.WriteLine("Module: {0}.", myType.Module); // Get the fully qualified common language runtime namespace. Console.WriteLine("Fully qualified type: {0}.", myType.ToString()); } catch(Exception e) { Console.WriteLine("Exception: " + e.Message ); } } }
using namespace System; namespace MyNamespace { ref class MyClass{}; } int main() { try { Type^ myType = MyNamespace::MyClass::typeid; Console::WriteLine( "\nPrinting the details of {0}.\n", myType ); // Get the namespace of the class MyClass. Console::WriteLine( "Namespace: {0}.", myType->Namespace ); // Get the name of the module. Console::WriteLine( "Module: {0}.", myType->Module ); // Get the fully qualified common language runtime namespace. Console::WriteLine( "Fully qualified type: {0}.", myType ); } catch ( Exception^ e ) { Console::WriteLine( "Exception: {0}", e->Message ); } }
package MyNamespace; import System.*; class MyClass { } //MyClass public class Type_ToString_3 { public static void main(String[] args) { try { Type myType = MyNamespace.MyClass.class.ToType(); Console.WriteLine("\nPrinting the details of {0}.\n", myType); // Get the namespace of the class Type_ToString_3. Console.WriteLine("Namespace: {0}.", myType.get_Namespace()); // Get the name of the module. Console.WriteLine("Module: {0}.", myType.get_Module()); // Get the fully qualified common language runtime namespace. Console.WriteLine("Fully qualified type: {0}.", myType.ToString()); } catch (System.Exception e) { Console.WriteLine("Exception: " + e.get_Message()); } } //main } //Type_ToString_3

Windows 98, Windows 2000 SP4, Windows CE, Windows Millennium Edition, Windows Mobile for Pocket PC, Windows Mobile for Smartphone, Windows Server 2003, Windows XP Media Center Edition, Windows XP Professional x64 Edition, Windows XP SP2, Windows XP Starter Edition
開発プラットフォームの中には、.NET Framework によってサポートされていないバージョンがあります。サポートされているバージョンについては、「システム要件」を参照してください。


_Type.Module プロパティ
アセンブリ: mscorlib (mscorlib.dll 内)



Windows 98, Windows 2000 SP4, Windows Millennium Edition, Windows Server 2003, Windows XP Media Center Edition, Windows XP Professional x64 Edition, Windows XP SP2, Windows XP Starter Edition
開発プラットフォームの中には、.NET Framework によってサポートされていないバージョンがあります。サポートされているバージョンについては、「システム要件」を参照してください。


- Type.Moduleのページへのリンク