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


LayoutMask は、クラスのレイアウト属性を選択するために使用します。クラス レイアウト属性 (AutoLayout、SequentialLayout、および ExplicitLayout) は、クラス インスタンスのフィールドのメモリ上でのレイアウトを定義します。
詳細については、共通言語基盤 (CLI: Common Language Infrastructure) のドキュメント「Partition II: Metadata Definition and Semantics」のセクション 9.1.2 の仕様を参照してください。このドキュメントは、http://msdn.microsoft.com/net/ecma/ および http://www.ecma-international.org/publications/standards/Ecma-335.htm で入手できます。
現在の Type が構築ジェネリック型を表している場合、このプロパティは型が構築される元になったジェネリック型定義に適用されます。たとえば、現在の Type が MyGenericType<int> (Visual Basic では MyGenericType(Of Integer)) を表す場合、このプロパティの値は MyGenericType<T> によって決まります。
現在の Type がジェネリック型またはジェネリック メソッドの定義の型パラメータを表している場合、このプロパティは常に false を返します。

StructLayoutAttribute クラスの LayoutKind 列挙体の Sequential メンバが設定されたクラスのインスタンスを作成し、プロパティ IsLayoutSequential のチェックを行って、結果を返す例を次に示します。
Imports System Imports System.Reflection Imports System.ComponentModel Imports System.Runtime.InteropServices Imports Microsoft.VisualBasic Class MyTypeSequential1 End Class 'MyTypeSequential1 <StructLayoutAttribute(LayoutKind.Sequential)> Class MyTypeSequential2 Public Shared Sub Main() Try ' Create an instance of MyTypeSequential1. Dim myObj1 As New MyTypeSequential1() Dim myTypeObj1 As Type = myObj1.GetType() ' Check for and display the SequentialLayout attribute. Console.WriteLine(ControlChars.Cr + "The object myObj1 has IsLayoutSequential: {0}.", myObj1.GetType().IsLayoutSequential.ToString()) ' Create an instance of MyTypeSequential2. Dim myObj2 As New MyTypeSequential2() Dim myTypeObj2 As Type = myObj2.GetType() ' Check for and display the SequentialLayout attribute. Console.WriteLine(ControlChars.Cr + "The object myObj2 has IsLayoutSequential: {0}.", myObj2.GetType().IsLayoutSequential.ToString()) Catch e As Exception Console.WriteLine(ControlChars.Cr + "An exception occurred: {0}", e.Message.ToString()) End Try End Sub 'Main End Class 'MyTypeSeq2
using System; using System.Reflection; using System.ComponentModel; using System.Runtime.InteropServices; class MyTypeSequential1 { } [StructLayoutAttribute(LayoutKind.Sequential)] class MyTypeSequential2 { public static void Main(string []args) { try { // Create an instance of myTypeSeq1. MyTypeSequential1 myObj1 = new MyTypeSequential1(); Type myTypeObj1 = myObj1.GetType(); // Check for and display the SequentialLayout attribute. Console.WriteLine("\nThe object myObj1 has IsLayoutSequential: {0}." , myObj1.GetType().IsLayoutSequential); // Create an instance of 'myTypeSeq2' class. MyTypeSequential2 myObj2 = new MyTypeSequential2(); Type myTypeObj2 = myObj2.GetType(); // Check for and display the SequentialLayout attribute. Console.WriteLine("\nThe object myObj2 has IsLayoutSequential: {0}." , myObj2.GetType().IsLayoutSequential); } catch(Exception e) { Console.WriteLine("\nAn exception occurred: {0}", e.Message); } } }
#using <System.dll> using namespace System; using namespace System::Reflection; using namespace System::ComponentModel; using namespace System::Runtime::InteropServices; ref class MyTypeSequential1{}; [StructLayoutAttribute(LayoutKind::Sequential)] ref class MyTypeSequential2{}; int main() { try { // Create an instance of myTypeSeq1. MyTypeSequential1^ myObj1 = gcnew MyTypeSequential1; // Check for and display the SequentialLayout attribute. Console::WriteLine( "\nThe object myObj1 has IsLayoutSequential: {0}.", myObj1->GetType()->IsLayoutSequential ); // Create an instance of 'myTypeSeq2' class. MyTypeSequential2^ myObj2 = gcnew MyTypeSequential2; // Check for and display the SequentialLayout attribute. Console::WriteLine( "\nThe object myObj2 has IsLayoutSequential: {0}.", myObj2->GetType()->IsLayoutSequential ); } catch ( Exception^ e ) { Console::WriteLine( "\nAn exception occurred: {0}", e->Message ); } }
import System.*; import System.Reflection.*; import System.ComponentModel.*; import System.Runtime.InteropServices.*; class MyTypeSequential1 { } //MyTypeSequential1 /** @attribute StructLayoutAttribute(LayoutKind.Sequential) */ class MyTypeSequential2 { public static void main(String[] args) { try { // Create an instance of myTypeSeq1. MyTypeSequential1 myObj1 = new MyTypeSequential1(); Type myTypeObj1 = myObj1.GetType(); // Check for and display the SequentialLayout attribute. Console.WriteLine("\nThe object myObj1 has IsLayoutSequential: {0}." , System.Convert.ToString(myObj1.GetType(). get_IsLayoutSequential())); // Create an instance of 'myTypeSeq2' class. MyTypeSequential2 myObj2 = new MyTypeSequential2(); Type myTypeObj2 = myObj2.GetType(); // Check for and display the SequentialLayout attribute. Console.WriteLine("\nThe object myObj2 has IsLayoutSequential: {0}." , System.Convert.ToString(myObj2.GetType(). get_IsLayoutSequential())); } catch (System.Exception e) { Console.WriteLine("\nAn exception occurred: {0}", e.get_Message()); } } //main } //MyTypeSequential2

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.IsLayoutSequential プロパティ
アセンブリ: mscorlib (mscorlib.dll 内)

Type に、クラスのレイアウト属性として SequentialLayout が選択されている場合は true。それ以外の場合は false。

このプロパティは、アンマネージ コードからマネージ クラスにアクセスするためのプロパティであるため、マネージ コードからは呼び出さないでください。
Type.IsLayoutSequential プロパティは、Type に、クラスのレイアウト属性として SequentialLayout が選択されているかどうかを示す値を取得します。

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 によってサポートされていないバージョンがあります。サポートされているバージョンについては、「システム要件」を参照してください。


Weblioに収録されているすべての辞書からType.IsLayoutSequentialを検索する場合は、下記のリンクをクリックしてください。

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