FieldBuilderとは? わかりやすく解説

FieldBuilder クラス

フィールドを定義および表現します。このクラスは継承できません。

名前空間: System.Reflection.Emit
アセンブリ: mscorlib (mscorlib.dll 内)
構文構文

<ClassInterfaceAttribute(ClassInterfaceType.None)> _
<ComVisibleAttribute(True)> _
Public NotInheritable Class
 FieldBuilder
    Inherits FieldInfo
    Implements _FieldBuilder
[ClassInterfaceAttribute(ClassInterfaceType.None)] 
[ComVisibleAttribute(true)] 
public sealed class FieldBuilder : FieldInfo,
 _FieldBuilder
[ClassInterfaceAttribute(ClassInterfaceType::None)] 
[ComVisibleAttribute(true)] 
public ref class FieldBuilder sealed : public
 FieldInfo, _FieldBuilder
/** @attribute ClassInterfaceAttribute(ClassInterfaceType.None) */ 
/** @attribute ComVisibleAttribute(true) */ 
public final class FieldBuilder extends FieldInfo
 implements _FieldBuilder
ClassInterfaceAttribute(ClassInterfaceType.None) 
ComVisibleAttribute(true) 
public final class FieldBuilder extends
 FieldInfo implements _FieldBuilder
解説解説
メモメモ

このクラスに適用される HostProtectionAttribute 属性の Resources プロパティの値は、MayLeakOnAbort です。HostProtectionAttribute は、デスクトップ アプリケーション (一般的には、アイコンをダブルクリック、コマンドを入力、またはブラウザに URL を入力して起動するアプリケーション) には影響しません。詳細については、HostProtectionAttribute クラスのトピックまたは「SQL Server プログラミングとホスト保護属性」を参照してください。

DefineField、DefineInitializedData、または DefineUninitializedData を呼び出して、FieldBuilder のインスタンスを取得します。

メモメモ

SetValue メソッドは、現在サポートされていません。代替手段としては、終了型にリフレクションして FieldInfo を取得し、SetValue を呼び出してフィールドの値を設定します。

使用例使用例

FieldBuilder の使用方法については、次のコード例を参照してください。

Imports System
Imports System.Threading
Imports System.Reflection
Imports System.Reflection.Emit
Imports System.Security.Permissions

Public Class FieldBuilder_Sample
   Private Shared Function
 CreateType(currentDomain As AppDomain) As
 Type

      ' Create an assembly.
      Dim myAssemblyName As New
 AssemblyName()
      myAssemblyName.Name = "DynamicAssembly"
      Dim myAssembly As AssemblyBuilder = currentDomain.DefineDynamicAssembly(myAssemblyName,
 _
                                                AssemblyBuilderAccess.Run)
      ' Create a dynamic module in Dynamic Assembly.
      Dim myModuleBuilder As ModuleBuilder
 = myAssembly.DefineDynamicModule("MyModule")
      ' Define a public class named "MyClass" in the assembly.
      Dim myTypeBuilder As TypeBuilder = myModuleBuilder.DefineType("MyClass",
 _
                                          TypeAttributes.Public)
      ' Define a private String field named "MyField" in the
 type.
      Dim myFieldBuilder As FieldBuilder =
 myTypeBuilder.DefineField("MyField", _
                  GetType(String), FieldAttributes.Private
 Or FieldAttributes.Static)
      ' Create the constructor.
      Dim constructorArgs As Type() = {GetType(String)}
      Dim constructor As ConstructorBuilder
 = _
                  myTypeBuilder.DefineConstructor(MethodAttributes.Public, _
                           CallingConventions.Standard, constructorArgs)
      Dim constructorIL As ILGenerator = constructor.GetILGenerator()
      constructorIL.Emit(OpCodes.Ldarg_0)
      Dim superConstructor As ConstructorInfo
 = GetType(Object).GetConstructor(New
 Type() {})
      constructorIL.Emit(OpCodes.Call, superConstructor)
      constructorIL.Emit(OpCodes.Ldarg_0)
      constructorIL.Emit(OpCodes.Ldarg_1)
      constructorIL.Emit(OpCodes.Stfld, myFieldBuilder)
      constructorIL.Emit(OpCodes.Ret)

      ' Create the MyMethod method.
      Dim myMethodBuilder As MethodBuilder
 = myTypeBuilder.DefineMethod("MyMethod",  _
                        MethodAttributes.Public, GetType(String),
 Nothing)
      Dim methodIL As ILGenerator = myMethodBuilder.GetILGenerator()
      methodIL.Emit(OpCodes.Ldarg_0)
      methodIL.Emit(OpCodes.Ldfld, myFieldBuilder)
      methodIL.Emit(OpCodes.Ret)
      Console.WriteLine("Name               :" + myFieldBuilder.Name)
      Console.WriteLine("DeclaringType      :" + myFieldBuilder.DeclaringType.ToString())
      Console.WriteLine("Type               :" + myFieldBuilder.FieldType.ToString())
      Console.WriteLine("Token              :" + myFieldBuilder.GetToken().Token.ToString())
      Return myTypeBuilder.CreateType()
   End Function 'CreateType

   <PermissionSetAttribute(SecurityAction.Demand, Name:="FullTrust")>
 _
   Public Shared Sub Main()
      Try
         Dim myType As Type = CreateType(Thread.GetDomain())
         ' Create an instance of the "HelloWorld" class.
         Dim helloWorld As Object
 = Activator.CreateInstance(myType, New Object()
 {"HelloWorld"})
         ' Invoke the "MyMethod" method of the "MyClass"
 class.
         Dim myObject As Object
 = myType.InvokeMember("MyMethod", _
                     BindingFlags.InvokeMethod, Nothing, helloWorld,
 Nothing)
         Console.WriteLine("MyClass.MyMethod returned: "
 & Microsoft.VisualBasic.Chr(34) & myObject  & Microsoft.VisualBasic.Chr(34)
 )
     Catch e as Exception
            Console.WriteLine("Exception Caught "+e.Message)
     End Try
   End Sub 'Main
End Class 'FieldBuilder_Sample
using System;
using System.Threading;
using System.Reflection;
using System.Reflection.Emit;
using System.Security.Permissions;

public class FieldBuilder_Sample
{
   private static Type CreateType(AppDomain
 currentDomain)
   {

      // Create an assembly.
      AssemblyName myAssemblyName = new AssemblyName();
      myAssemblyName.Name = "DynamicAssembly";
      AssemblyBuilder myAssembly =
                     currentDomain.DefineDynamicAssembly(myAssemblyName,AssemblyBuilderAccess.Run);
      // Create a dynamic module in Dynamic Assembly.
      ModuleBuilder myModuleBuilder=myAssembly.DefineDynamicModule("MyModule");
      // Define a public class named "MyClass" in the assembly.
      TypeBuilder myTypeBuilder= myModuleBuilder.DefineType("MyClass",TypeAttributes.Public);

      // Define a private String field named "MyField" in
 the type.
      FieldBuilder myFieldBuilder= myTypeBuilder.DefineField("MyField"
,
          typeof(string),FieldAttributes.Private|FieldAttributes.Static);
      // Create the constructor.
      Type[] constructorArgs = { typeof(String) };
      ConstructorBuilder constructor = myTypeBuilder.DefineConstructor(
         MethodAttributes.Public, CallingConventions.Standard, constructorArgs);
      ILGenerator constructorIL = constructor.GetILGenerator();
      constructorIL.Emit(OpCodes.Ldarg_0);
      ConstructorInfo superConstructor = typeof(Object).GetConstructor(new
 Type[0]);
      constructorIL.Emit(OpCodes.Call, superConstructor);
      constructorIL.Emit(OpCodes.Ldarg_0);
      constructorIL.Emit(OpCodes.Ldarg_1);
      constructorIL.Emit(OpCodes.Stfld, myFieldBuilder);
      constructorIL.Emit(OpCodes.Ret);

      // Create the MyMethod method.
      MethodBuilder myMethodBuilder= myTypeBuilder.DefineMethod("MyMethod"
,
                           MethodAttributes.Public,typeof(String),null);
      ILGenerator methodIL = myMethodBuilder.GetILGenerator();
      methodIL.Emit(OpCodes.Ldarg_0);
      methodIL.Emit(OpCodes.Ldfld, myFieldBuilder);
      methodIL.Emit(OpCodes.Ret);
      Console.WriteLine("Name               :"+myFieldBuilder.Name);
      Console.WriteLine("DeclaringType      :"+myFieldBuilder.DeclaringType);
      Console.WriteLine("Type               :"+myFieldBuilder.FieldType);
      Console.WriteLine("Token              :"+myFieldBuilder.GetToken().Token);
      return myTypeBuilder.CreateType();
   }

   [PermissionSetAttribute(SecurityAction.Demand, Name="FullTrust")]
   public static void Main()
   {
      try
      {
         Type myType = CreateType(Thread.GetDomain());
         // Create an instance of the "HelloWorld" class.
         Object helloWorld = Activator.CreateInstance(myType, new
 Object[] { "HelloWorld" });
         // Invoke the "MyMethod" method of the "MyClass"
 class.
         Object myObject  = myType.InvokeMember("MyMethod",
                        BindingFlags.InvokeMethod, null, helloWorld,
 null);
         Console.WriteLine("MyClass.MyMethod returned: \"" + myObject
 + "\"");
      }
      catch( Exception e)
      {
         Console.WriteLine("Exception Caught "+e.Message);
      }
  }
}
using namespace System;
using namespace System::Threading;
using namespace System::Reflection;
using namespace System::Reflection::Emit;
Type^ CreateType( AppDomain^ currentDomain )
{
   // Create an assembly.
   AssemblyName^ myAssemblyName = gcnew AssemblyName;
   myAssemblyName->Name = "DynamicAssembly";
   AssemblyBuilder^ myAssembly = currentDomain->DefineDynamicAssembly( myAssemblyName,
 AssemblyBuilderAccess::Run );

   // Create a dynamic module in Dynamic Assembly.
   ModuleBuilder^ myModuleBuilder = myAssembly->DefineDynamicModule( "MyModule"
 );

   // Define a public class named S"MyClass" in the assembly.
   TypeBuilder^ myTypeBuilder = myModuleBuilder->DefineType( "MyClass",
 TypeAttributes::Public );

   // Define a private String field named S"MyField" in the
 type.
   FieldBuilder^ myFieldBuilder = myTypeBuilder->DefineField( "MyField",
 String::typeid, static_cast<FieldAttributes>(FieldAttributes::Private | FieldAttributes::Static)
 );

   // Create the constructor.
   array<Type^>^constructorArgs = {String::typeid};
   ConstructorBuilder^ constructor = myTypeBuilder->DefineConstructor( MethodAttributes::Public,
 CallingConventions::Standard, constructorArgs );
   ILGenerator^ constructorIL = constructor->GetILGenerator();
   constructorIL->Emit( OpCodes::Ldarg_0 );
   ConstructorInfo^ superConstructor = Object::typeid->GetConstructor( gcnew array<Type^>(0)
 );
   constructorIL->Emit( OpCodes::Call, superConstructor );
   constructorIL->Emit( OpCodes::Ldarg_0 );
   constructorIL->Emit( OpCodes::Ldarg_1 );
   constructorIL->Emit( OpCodes::Stfld, myFieldBuilder );
   constructorIL->Emit( OpCodes::Ret );

   // Create the MyMethod method.
   MethodBuilder^ myMethodBuilder = myTypeBuilder->DefineMethod( "MyMethod",
 MethodAttributes::Public, String::typeid, nullptr );
   ILGenerator^ methodIL = myMethodBuilder->GetILGenerator();
   methodIL->Emit( OpCodes::Ldarg_0 );
   methodIL->Emit( OpCodes::Ldfld, myFieldBuilder );
   methodIL->Emit( OpCodes::Ret );
   Console::WriteLine( "Name               : {0}", myFieldBuilder->Name
 );
   Console::WriteLine( "DeclaringType      : {0}", myFieldBuilder->DeclaringType
 );
   Console::WriteLine( "Type               : {0}", myFieldBuilder->FieldType
 );
   Console::WriteLine( "Token              : {0}", myFieldBuilder->GetToken().Token
 );
   return myTypeBuilder->CreateType();
}

int main()
{
   try
   {
      Type^ myType = CreateType( Thread::GetDomain() );

      // Create an instance of the S"HelloWorld" class.
      array<Object^>^type = {"HelloWorld"};
      Object^ helloWorld = Activator::CreateInstance( myType, type );

      // Invoke the S"MyMethod" method of the S"MyClass"
 class.
      Object^ myObject = myType->InvokeMember( "MyMethod", BindingFlags::InvokeMethod,
 nullptr, helloWorld, nullptr );
      Console::WriteLine( "MyClass::MyMethod returned: \"{0}\"",
 myObject );
   }
   catch ( Exception^ e ) 
   {
      Console::WriteLine( "Exception Caught {0}", e->Message );
   }
}
継承階層継承階層
System.Object
   System.Reflection.MemberInfo
     System.Reflection.FieldInfo
      System.Reflection.Emit.FieldBuilder
スレッド セーフスレッド セーフ
この型の public static (Visual Basic では Shared) メンバはすべて、スレッド セーフです。インスタンス メンバの場合は、スレッド セーフであるとは限りません。
プラットフォームプラットフォーム
バージョン情報バージョン情報
参照参照
関連項目
FieldBuilder メンバ
System.Reflection.Emit 名前空間

FieldBuilder プロパティ


パブリック プロパティパブリック プロパティ

  名前 説明
パブリック プロパティ Attributes オーバーライドされます。 このフィールドの属性を示します。このプロパティは読み取り専用です。
パブリック プロパティ DeclaringType オーバーライドされます。 このフィールドを宣言する型の Type オブジェクトへの参照を示します。このプロパティは読み取り専用です。
パブリック プロパティ FieldHandle オーバーライドされます。 このフィールドの内部メタデータ ハンドルを示します。このプロパティは読み取り専用です。
パブリック プロパティ FieldType オーバーライドされます。 このフィールドの型を表す Type オブジェクトを示します。このプロパティは読み取り専用です。
パブリック プロパティ IsAssembly  このフィールドに、アセンブリ レベルの参照可能範囲が設定されているかどうかを示す値を取得します。 ( FieldInfo から継承されます。)
パブリック プロパティ IsFamily  このフィールドに、ファミリ レベルの参照可能範囲が設定されているかどうかを示す値を取得します。 ( FieldInfo から継承されます。)
パブリック プロパティ IsFamilyAndAssembly  このフィールドに、FamilyAndAssembly レベルの参照可能範囲が設定されているかどうかを示す値を取得します。 ( FieldInfo から継承されます。)
パブリック プロパティ IsFamilyOrAssembly  このフィールドに、FamilyOrAssembly レベルの参照可能範囲が設定されているかどうかを示す値を取得します。 ( FieldInfo から継承されます。)
パブリック プロパティ IsInitOnly  フィールドをコンストラクタの本体だけでしか設定できないのかどうかを示す値を取得します。 ( FieldInfo から継承されます。)
パブリック プロパティ IsLiteral  値がコンパイル時に書き込まれ、変更できないかどうかを示す値を取得します。 ( FieldInfo から継承されます。)
パブリック プロパティ IsNotSerialized  このフィールドに、NotSerialized 属性が設定されているかどうかを示す値を取得します。 ( FieldInfo から継承されます。)
パブリック プロパティ IsPinvokeImpl  対応する PinvokeImpl 属性が FieldAttributes に設定されているかどうかを示す値を取得します。 ( FieldInfo から継承されます。)
パブリック プロパティ IsPrivate  フィールドがプライベートかどうかを示す値を取得します。 ( FieldInfo から継承されます。)
パブリック プロパティ IsPublic  フィールドがパブリックかどうかを示す値を取得します。 ( FieldInfo から継承されます。)
パブリック プロパティ IsSpecialName  対応する SpecialName 属性が FieldAttributes 列挙子に設定されているかどうかを示す値を取得します。 ( FieldInfo から継承されます。)
パブリック プロパティ IsStatic  フィールドが静的かどうかを示す値を取得します。 ( FieldInfo から継承されます。)
パブリック プロパティ MemberType  このメンバがフィールドであることを示す MemberTypes 値を取得します。 ( FieldInfo から継承されます。)
パブリック プロパティ MetadataToken  メタデータ要素を識別する値を取得します。 ( MemberInfo から継承されます。)
パブリック プロパティ Module オーバーライドされます。 このフィールドを含む型が定義されるモジュールを取得します。
パブリック プロパティ Name オーバーライドされます。 このフィールドの名前を示します。このプロパティは読み取り専用です。
パブリック プロパティ ReflectedType オーバーライドされます。 このオブジェクトの取得元である Type オブジェクトへの参照を示します。このプロパティは読み取り専用です。
参照参照

関連項目

FieldBuilder クラス
System.Reflection.Emit 名前空間

FieldBuilder メソッド


パブリック メソッドパブリック メソッド

  名前 説明
パブリック メソッド Equals  オーバーロードされます。 2 つの Object インスタンスが等しいかどうかを判断します。 ( Object から継承されます。)
パブリック メソッド GetCustomAttributes オーバーロードされます。 オーバーライドされます。 このフィールドに対して定義されているカスタム属性を返します。
パブリック メソッド GetFieldFromHandle  オーバーロードされます。 ハンドルが表すフィールドの FieldInfo を取得します。 ( FieldInfo から継承されます。)
パブリック メソッド GetHashCode  特定の型のハッシュ関数として機能します。GetHashCode は、ハッシュ アルゴリズムや、ハッシュ テーブルのようなデータ構造での使用に適しています。 ( Object から継承されます。)
パブリック メソッド GetOptionalCustomModifiers  フィールドのオプションのカスタム修飾子を識別する型の配列を取得します。 ( FieldInfo から継承されます。)
パブリック メソッド GetRawConstantValue  コンパイラによってフィールドに関連付けられているリテラル値を返します。 ( FieldInfo から継承されます。)
パブリック メソッド GetRequiredCustomModifiers  プロパティの必須のカスタム修飾子を識別する型の配列を取得します。 ( FieldInfo から継承されます。)
パブリック メソッド GetToken このフィールドを表すトークンを返します。
パブリック メソッド GetType  現在のインスタンスの Type を取得します。 ( Object から継承されます。)
パブリック メソッド GetValue オーバーライドされます。 指定したオブジェクトでサポートされているフィールドの値を取得します。
パブリック メソッド GetValueDirect  指定したオブジェクトでサポートされているフィールドの値を返します。 ( FieldInfo から継承されます。)
パブリック メソッド IsDefined オーバーライドされます。 指定した型の属性がフィールドで定義されているかどうかを示します。
パブリック メソッド ReferenceEquals  指定した複数の Object インスタンスが同一かどうかを判断します。 ( Object から継承されます。)
パブリック メソッド SetConstant このフィールドの既定値を設定します。
パブリック メソッド SetCustomAttribute オーバーロードされます。 カスタム属性を設定します。
パブリック メソッド SetMarshal フィールドのネイティブ マーシャリングを記述します。
パブリック メソッド SetOffset フィールド レイアウトを指定します。
パブリック メソッド SetValue オーバーロードされます。 フィールドの値を設定します。
パブリック メソッド SetValueDirect  指定したオブジェクトでサポートされているフィールドの値を設定します。 ( FieldInfo から継承されます。)
パブリック メソッド ToString  現在の Object を表す String を返します。 ( Object から継承されます。)
明示的インターフェイスの実装明示的インターフェイスの実装
  名前 説明
インターフェイスの明示的な実装 System.Runtime.InteropServices._FieldBuilder.GetIDsOfNames 名前のセットを対応するディスパッチ識別子のセットに割り当てます。
インターフェイスの明示的な実装 System.Runtime.InteropServices._FieldBuilder.GetTypeInfo オブジェクトの型情報を取得します。この型情報は、インターフェイスの型情報を取得するために使用できます。
インターフェイスの明示的な実装 System.Runtime.InteropServices._FieldBuilder.GetTypeInfoCount オブジェクトが提供する型情報インターフェイスの数を取得します (0 または 1)。
インターフェイスの明示的な実装 System.Runtime.InteropServices._FieldBuilder.Invoke オブジェクトによって公開されているプロパティおよびメソッドにアクセスできるようにします。
参照参照

関連項目

FieldBuilder クラス
System.Reflection.Emit 名前空間

FieldBuilder メンバ

フィールドを定義および表現します。このクラスは継承できません。

FieldBuilder データ型で公開されるメンバを以下の表に示します。


パブリック プロパティパブリック プロパティ
  名前 説明
パブリック プロパティ Attributes オーバーライドされます。 このフィールドの属性を示します。このプロパティは読み取り専用です。
パブリック プロパティ DeclaringType オーバーライドされます。 このフィールドを宣言する型の Type オブジェクトへの参照を示します。このプロパティは読み取り専用です。
パブリック プロパティ FieldHandle オーバーライドされます。 このフィールドの内部メタデータ ハンドルを示します。このプロパティは読み取り専用です。
パブリック プロパティ FieldType オーバーライドされます。 このフィールドの型を表す Type オブジェクトを示します。このプロパティは読み取り専用です。
パブリック プロパティ IsAssembly  このフィールドに、アセンブリ レベルの参照可能範囲が設定されているかどうかを示す値を取得します。(FieldInfo から継承されます。)
パブリック プロパティ IsFamily  このフィールドに、ファミリ レベルの参照可能範囲が設定されているかどうかを示す値を取得します。(FieldInfo から継承されます。)
パブリック プロパティ IsFamilyAndAssembly  このフィールドに、FamilyAndAssembly レベルの参照可能範囲が設定されているかどうかを示す値を取得します。(FieldInfo から継承されます。)
パブリック プロパティ IsFamilyOrAssembly  このフィールドに、FamilyOrAssembly レベルの参照可能範囲が設定されているかどうかを示す値を取得します。(FieldInfo から継承されます。)
パブリック プロパティ IsInitOnly  フィールドをコンストラクタの本体だけでしか設定できないのかどうかを示す値を取得します。(FieldInfo から継承されます。)
パブリック プロパティ IsLiteral  値がコンパイル時に書き込まれ、変更できないかどうかを示す値を取得します。(FieldInfo から継承されます。)
パブリック プロパティ IsNotSerialized  このフィールドに、NotSerialized 属性が設定されているかどうかを示す値を取得します。(FieldInfo から継承されます。)
パブリック プロパティ IsPinvokeImpl  対応する PinvokeImpl 属性が FieldAttributes に設定されているかどうかを示す値を取得します。(FieldInfo から継承されます。)
パブリック プロパティ IsPrivate  フィールドがプライベートかどうかを示す値を取得します。(FieldInfo から継承されます。)
パブリック プロパティ IsPublic  フィールドがパブリックかどうかを示す値を取得します。(FieldInfo から継承されます。)
パブリック プロパティ IsSpecialName  対応する SpecialName 属性が FieldAttributes 列挙子に設定されているかどうかを示す値を取得します。(FieldInfo から継承されます。)
パブリック プロパティ IsStatic  フィールドが静的かどうかを示す値を取得します。(FieldInfo から継承されます。)
パブリック プロパティ MemberType  このメンバがフィールドであることを示す MemberTypes 値を取得します。(FieldInfo から継承されます。)
パブリック プロパティ MetadataToken  メタデータ要素を識別する値を取得します。(MemberInfo から継承されます。)
パブリック プロパティ Module オーバーライドされます。 このフィールドを含む型が定義されるモジュールを取得します。
パブリック プロパティ Name オーバーライドされます。 このフィールドの名前を示します。このプロパティは読み取り専用です。
パブリック プロパティ ReflectedType オーバーライドされます。 このオブジェクトの取得元である Type オブジェクトへの参照を示します。このプロパティは読み取り専用です。
パブリック メソッドパブリック メソッド
  名前 説明
パブリック メソッド Equals  オーバーロードされます。 2 つの Object インスタンスが等しいかどうかを判断します。 (Object から継承されます。)
パブリック メソッド GetCustomAttributes オーバーロードされます。 オーバーライドされます。 このフィールドに対して定義されているカスタム属性を返します。
パブリック メソッド GetFieldFromHandle  オーバーロードされます。 ハンドルが表すフィールドの FieldInfo を取得します。 (FieldInfo から継承されます。)
パブリック メソッド GetHashCode  特定の型のハッシュ関数として機能します。GetHashCode は、ハッシュ アルゴリズムや、ハッシュ テーブルのようなデータ構造での使用に適しています。 (Object から継承されます。)
パブリック メソッド GetOptionalCustomModifiers  フィールドのオプションのカスタム修飾子を識別する型の配列を取得します。 (FieldInfo から継承されます。)
パブリック メソッド GetRawConstantValue  コンパイラによってフィールドに関連付けられているリテラル値を返します。 (FieldInfo から継承されます。)
パブリック メソッド GetRequiredCustomModifiers  プロパティの必須のカスタム修飾子を識別する型の配列を取得します。 (FieldInfo から継承されます。)
パブリック メソッド GetToken このフィールドを表すトークンを返します。
パブリック メソッド GetType  現在のインスタンスの Type を取得します。 (Object から継承されます。)
パブリック メソッド GetValue オーバーライドされます。 指定したオブジェクトでサポートされているフィールドの値を取得します。
パブリック メソッド GetValueDirect  指定したオブジェクトでサポートされているフィールドの値を返します。 (FieldInfo から継承されます。)
パブリック メソッド IsDefined オーバーライドされます。 指定した型の属性がフィールドで定義されているかどうかを示します。
パブリック メソッド ReferenceEquals  指定した複数の Object インスタンスが同一かどうかを判断します。 (Object から継承されます。)
パブリック メソッド SetConstant このフィールドの既定値を設定します。
パブリック メソッド SetCustomAttribute オーバーロードされます。 カスタム属性を設定します。
パブリック メソッド SetMarshal フィールドのネイティブ マーシャリングを記述します。
パブリック メソッド SetOffset フィールド レイアウトを指定します。
パブリック メソッド SetValue オーバーロードされます。 フィールドの値を設定します。
パブリック メソッド SetValueDirect  指定したオブジェクトでサポートされているフィールドの値を設定します。 (FieldInfo から継承されます。)
パブリック メソッド ToString  現在の Object を表す String を返します。 (Object から継承されます。)
明示的インターフェイスの実装明示的インターフェイスの実装
  名前 説明
インターフェイスの明示的な実装 System.Runtime.InteropServices._FieldBuilder.GetIDsOfNames 名前のセットを対応するディスパッチ識別子のセットに割り当てます。
インターフェイスの明示的な実装 System.Runtime.InteropServices._FieldBuilder.GetTypeInfo オブジェクトの型情報を取得します。この型情報は、インターフェイスの型情報を取得するために使用できます。
インターフェイスの明示的な実装 System.Runtime.InteropServices._FieldBuilder.GetTypeInfoCount オブジェクトが提供する型情報インターフェイスの数を取得します (0 または 1)。
インターフェイスの明示的な実装 System.Runtime.InteropServices._FieldBuilder.Invoke オブジェクトによって公開されているプロパティおよびメソッドにアクセスできるようにします。
参照参照

関連項目

FieldBuilder クラス
System.Reflection.Emit 名前空間

_FieldBuilder インターフェイス

メモ : このインターフェイスは、.NET Framework version 2.0 で新しく追加されたものです。

System.Reflection.Emit.FieldBuilder クラスをアンマネージ コードに公開します。

 

名前空間: System.Runtime.InteropServices
アセンブリ: mscorlib (mscorlib.dll 内)
構文構文

<ComVisibleAttribute(True)> _
<GuidAttribute("CE1A3BF5-975E-30CC-97C9-1EF70F8F3993")>
 _
<InterfaceTypeAttribute(ComInterfaceType.InterfaceIsIUnknown)> _
<CLSCompliantAttribute(False)> _
Public Interface _FieldBuilder
Dim instance As _FieldBuilder
[ComVisibleAttribute(true)] 
[GuidAttribute("CE1A3BF5-975E-30CC-97C9-1EF70F8F3993")] 
[InterfaceTypeAttribute(ComInterfaceType.InterfaceIsIUnknown)] 
[CLSCompliantAttribute(false)] 
public interface _FieldBuilder
[ComVisibleAttribute(true)] 
[GuidAttribute(L"CE1A3BF5-975E-30CC-97C9-1EF70F8F3993")] 
[InterfaceTypeAttribute(ComInterfaceType::InterfaceIsIUnknown)] 
[CLSCompliantAttribute(false)] 
public interface class _FieldBuilder
/** @attribute ComVisibleAttribute(true) */ 
/** @attribute GuidAttribute("CE1A3BF5-975E-30CC-97C9-1EF70F8F3993") */
 
/** @attribute InterfaceTypeAttribute(ComInterfaceType.InterfaceIsIUnknown) */ 
/** @attribute CLSCompliantAttribute(false) */ 
public interface _FieldBuilder
ComVisibleAttribute(true) 
GuidAttribute("CE1A3BF5-975E-30CC-97C9-1EF70F8F3993") 
InterfaceTypeAttribute(ComInterfaceType.InterfaceIsIUnknown) 
CLSCompliantAttribute(false) 
public interface _FieldBuilder
解説解説
プラットフォームプラットフォーム
バージョン情報バージョン情報
参照参照
関連項目
_FieldBuilder メンバ
System.Runtime.InteropServices 名前空間

_FieldBuilder メソッド


_FieldBuilder メンバ




英和和英テキスト翻訳

英語⇒日本語日本語⇒英語

辞書ショートカット

すべての辞書の索引

「FieldBuilder」の関連用語

FieldBuilderのお隣キーワード

   

英語⇒日本語
日本語⇒英語
   



FieldBuilderのページの著作権

   
日本マイクロソフト株式会社日本マイクロソフト株式会社
© 2026 Microsoft.All rights reserved.

©2026 GRAS Group, Inc.RSS