IMemberCreationService.CreateField Method
Definition
Important
Some information relates to prerelease product that may be substantially modified before it’s released. Microsoft makes no warranties, express or implied, with respect to the information provided here.
Creates a field on the specified class by using the specified field name, field type, parameter types, attributes and literal initialization expression.
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)
Parameters
- className
- String
A string that defines the name of the class to add the field.
- fieldName
- String
A string that defines the name of the field.
- attributes
- MemberAttributes
A MemberAttributes that defines the member attribute identifier for the field.
- initializationExpression
- CodeSnippetExpression
A CodeSnippetExpression that contains the literal expression of the field.
- overwriteExisting
- Boolean
true
to delete any existing fields on className
when creating the new field; otherwise, false
.