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


LayoutMask は、クラスのレイアウト属性を選択するために使用します。クラス レイアウト属性 (AutoLayout、SequentialLayout、および ExplicitLayout) は、クラス インスタンスのフィールドのメモリ上でのレイアウトを定義します。
AutoLayout 属性を使用すると、クラスのオブジェクトに最適なレイアウト方法をランタイム エンジンで決定できるようになります。AutoLayout 属性でクラスをマークすると、そのクラスにとって適切なレイアウトがローダーによって選択され、指定されているその他のレイアウト情報は無視されます。
現在の Type が構築ジェネリック型を表している場合、このプロパティは型が構築される元になったジェネリック型定義に適用されます。たとえば、現在の Type が MyGenericType<int> (Visual Basic の場合は MyGenericType(Of Integer)) を表す場合、このプロパティの値は MyGenericType<T>. によって決まります。
現在の Type がジェネリック型またはジェネリック メソッドの定義の型パラメータを表している場合、このプロパティは常に false を返します。

型のインスタンスを作成し、IsAutoLayout プロパティを表示する例を次に示します。
Imports System Imports System.Runtime.InteropServices Imports Microsoft.VisualBasic ' The Demo class is has the AutoLayout attribute. <StructLayoutAttribute(LayoutKind.Auto)> _ Public Class Demo End Class Public Class Example Public Shared Sub Main() ' Get the Type object for the Demo class. Dim myType As Type = GetType(Demo) ' Get and display the IsAutoLayout property of the ' Demo class. Console.WriteLine("The AutoLayout property for the Demo class is '{0}'.", _ myType.IsAutoLayout.ToString()) End Sub End Class
using System; using System.Runtime.InteropServices; // The Demo class is attributed as AutoLayout. [StructLayoutAttribute(LayoutKind.Auto)] public class Demo { } public class Example { public static void Main() { // Create an instance of the Type class using the GetType method. Type myType=typeof(Demo); // Get and display the IsAutoLayout property of the // Demoinstance. Console.WriteLine("\nThe AutoLayout property for the Demo class is {0}.", myType.IsAutoLayout); } }
#using <System.dll> using namespace System; using namespace System::Reflection; using namespace System::ComponentModel; using namespace System::Runtime::InteropServices; // The MyDemoAttribute class is selected as AutoLayout. [StructLayoutAttribute(LayoutKind::Auto)] public ref class MyDemoAttribute{}; void MyAutoLayoutMethod( String^ typeName ) { try { // Create an instance of the Type class using the GetType method. Type^ myType = Type::GetType( typeName ); // Get and display the IsAutoLayout property of the // MyDemoAttribute instance. Console::WriteLine( "\nThe AutoLayout property for the MyDemoAttribute is {0}.", myType->IsAutoLayout ); } catch ( Exception^ e ) { Console::WriteLine( "\nAn exception occurred: {0}.", e->Message ); } } int main() { MyAutoLayoutMethod( "MyDemoAttribute" ); }
import System.*; import System.Reflection.*; import System.ComponentModel.*; import System.Runtime.InteropServices.*; // The MyDemoAttribute class is selected as AutoLayout. /** @attribute StructLayoutAttribute(LayoutKind.Auto) */ public class MyDemoAttribute { } //MyDemoAttribute public class MyTypeClass { public static void main(String[] args) { MyAutoLayoutMethod("MyDemoAttribute"); } //main public static void MyAutoLayoutMethod(String typeName) { try { // Create an instance of the Type class using the GetType method. Type myType = Type.GetType(typeName); // Get and display the IsAutoLayout property of the // MyDemoAttribute instance. Console.WriteLine("\nThe AutoLayout property for the" + " MyDemoAttribute is {0}.", System.Convert.ToString(myType. get_IsAutoLayout())); } catch (System.Exception e) { Console.WriteLine("\nAn exception occurred: {0}.", e.get_Message()); } } //MyAutoLayoutMethod } //MyTypeClass

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

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

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

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.IsAutoLayoutを検索する場合は、下記のリンクをクリックしてください。

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