VirtualTypeBuilder.FieldInfoCollection.Add Method (String, Type, array<Attribute[])
Adds a FieldInfo to the end of the collection.
Namespace: Microsoft.VisualStudio.Shell.Design
Assembly: Microsoft.VisualStudio.Shell.Design (in Microsoft.VisualStudio.Shell.Design.dll)
Syntax
'宣告
Public Function Add ( _
name As String, _
fieldType As Type, _
attributes As Attribute() _
) As Integer
public int Add(
string name,
Type fieldType,
Attribute[] attributes
)
Parameters
- name
Type: System.String
The name of the field to add.
- fieldType
Type: System.Type
The type of field.
- attributes
Type: array<System.Attribute[]
An array of attributes that must be Public and/or Static.
Return Value
Type: System.Int32
The index at which the value has been added.
Exceptions
Exception | Condition |
---|---|
ArgumentNullException | name or fieldType or an element in attributes is nulla null reference (Nothing in Visual Basic). attributes itself may be nulla null reference (Nothing in Visual Basic). |
ArgumentException | fieldType is not a run-time type. |
.NET Framework Security
- Full trust for the immediate caller. This member cannot be used by partially trusted code. For more information, see Using Libraries from Partially Trusted Code.