VirtualTypeBuilder.PropertyInfoCollection.Add Method (String, Type, Boolean, [], [], MethodAttributes)

Adds a PropertyInfo 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, _
    propertyType As Type, _
    readOnly As Boolean, _
    paramTypes As Type(), _
    attributes As Attribute(), _
    methodAttributes As MethodAttributes _
) As Integer
'使用
Dim instance As VirtualTypeBuilder..::.PropertyInfoCollection
Dim name As String
Dim propertyType As Type
Dim readOnly As Boolean
Dim paramTypes As Type()
Dim attributes As Attribute()
Dim methodAttributes As MethodAttributes
Dim returnValue As Integer

returnValue = instance.Add(name, propertyType, _
    readOnly, paramTypes, attributes, _
    methodAttributes)
public int Add(
    string name,
    Type propertyType,
    bool readOnly,
    Type[] paramTypes,
    Attribute[] attributes,
    MethodAttributes methodAttributes
)
public:
int Add(
    String^ name, 
    Type^ propertyType, 
    bool readOnly, 
    array<Type^>^ paramTypes, 
    array<Attribute^>^ attributes, 
    MethodAttributes methodAttributes
)
public function Add(
    name : String, 
    propertyType : Type, 
    readOnly : boolean, 
    paramTypes : Type[], 
    attributes : Attribute[], 
    methodAttributes : MethodAttributes
) : int

Parameters

  • propertyType
    Type: System.Type

    The type of the property.

  • readOnly
    Type: System.Boolean

    Determines if this property is read only or read write.

  • paramTypes
    Type: []

    The types of parameters in a parameterized property.

  • attributes
    Type: []

    This parameter is used to configure the class member appropriately. Add only accepts the values of MemberAttributes that fit into the AccessMask or ScopeMask categories.

Return Value

Type: System.Int32

The index at which the value has been added.

Exceptions

Exception Condition
ArgumentNullException

name is a null reference (Nothing in Visual Basic).

-or-

propertyType is a null reference (Nothing in Visual Basic)

-or-

An element in attributes is a null reference (Nothing in Visual Basic).

-or-

An element in paramTypes is a null reference (Nothing in Visual Basic).

attributes and paramTypes may be a null reference (Nothing in Visual Basic).

ArgumentException

propertyType is not a runtime type.

Permissions

See Also

Reference

VirtualTypeBuilder.PropertyInfoCollection Class

VirtualTypeBuilder.PropertyInfoCollection Members

Add Overload

Microsoft.VisualStudio.Shell.Design Namespace