IMemberCreationService.CreateField メソッド

定義

指定したフィールド名、フィールド型、パラメーター型、属性、リテラル初期化式を使用して、指定したクラスにフィールドを作成します。

public:
 void CreateField(System::String ^ className, System::String ^ fieldName, Type ^ fieldType, cli::array <Type ^> ^ genericParameterTypes, System::CodeDom::MemberAttributes attributes, System::CodeDom::CodeSnippetExpression ^ initializationExpression, bool overwriteExisting);
public void CreateField(string className, string fieldName, Type fieldType, Type[] genericParameterTypes, System.CodeDom.MemberAttributes attributes, System.CodeDom.CodeSnippetExpression initializationExpression, bool overwriteExisting);
abstract member CreateField : string * string * Type * Type[] * System.CodeDom.MemberAttributes * System.CodeDom.CodeSnippetExpression * bool -> unit
Public Sub CreateField (className As String, fieldName As String, fieldType As Type, genericParameterTypes As Type(), attributes As MemberAttributes, initializationExpression As CodeSnippetExpression, overwriteExisting As Boolean)

パラメーター

className
String

フィールドを追加するクラスの名前を定義する文字列。

fieldName
String

フィールドの名前を定義する文字列。

fieldType
Type

新しいフィールドの Type

genericParameterTypes
Type[]

フィールドに関連付けられているパラメーターの Type 配列。

attributes
MemberAttributes

フィールドのメンバー属性識別子を定義する MemberAttributes

initializationExpression
CodeSnippetExpression

フィールドのリテラル式を含む CodeSnippetExpression

overwriteExisting
Boolean

true 新しいフィールドを作成するときに className の既存のフィールドを削除する場合は >。それ以外の場合は false

適用対象