VirtualTypeBuilder.FieldInfoCollection.Add Method (String, Type, [])

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
'使用
Dim instance As VirtualTypeBuilder..::.FieldInfoCollection
Dim name As String
Dim fieldType As Type
Dim attributes As Attribute()
Dim returnValue As Integer

returnValue = instance.Add(name, fieldType, _
    attributes)
public int Add(
    string name,
    Type fieldType,
    Attribute[] attributes
)
public:
int Add(
    String^ name, 
    Type^ fieldType, 
    array<Attribute^>^ attributes
)
public function Add(
    name : String, 
    fieldType : Type, 
    attributes : Attribute[]
) : int

Parameters

  • attributes
    Type: []

    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 a null reference (Nothing in Visual Basic). attributes itself may be a null reference (Nothing in Visual Basic).

ArgumentException

fieldType is not a run-time type.

Permissions

See Also

Reference

VirtualTypeBuilder.FieldInfoCollection Class

VirtualTypeBuilder.FieldInfoCollection Members

Add Overload

Microsoft.VisualStudio.Shell.Design Namespace