Kommentar
Åtkomst till den här sidan kräver auktorisering. Du kan prova att logga in eller ändra kataloger.
Åtkomst till den här sidan kräver auktorisering. Du kan prova att ändra kataloger.
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
'Declaration
Public Function Add ( _
name As String, _
propertyType As Type, _
readOnly As Boolean, _
attributes As Attribute(), _
methodAttributes As MethodAttributes _
) As Integer
public int Add(
string name,
Type propertyType,
bool readOnly,
Attribute[] attributes,
MethodAttributes methodAttributes
)
public:
int Add(
String^ name,
Type^ propertyType,
bool readOnly,
array<Attribute^>^ attributes,
MethodAttributes methodAttributes
)
member Add :
name:string *
propertyType:Type *
readOnly:bool *
attributes:Attribute[] *
methodAttributes:MethodAttributes -> int
public function Add(
name : String,
propertyType : Type,
readOnly : boolean,
attributes : Attribute[],
methodAttributes : MethodAttributes
) : int
Parameters
name
Type: System.StringThe name of the property to add.
propertyType
Type: System.TypeThe type of the property.
readOnly
Type: System.BooleanDetermines if this property is read only or read write.
attributes
Type: array<System.Attribute[]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.
methodAttributes
Type: System.Reflection.MethodAttributesSpecifies additional event attributes for this member. The default method attribute is Public. The only method attributes supported today are Public and Static .
Return Value
Type: System.Int32
The index at which the value has been added.
Exceptions
| Exception | Condition |
|---|---|
| ArgumentNullException | name is nulla null reference (Nothing in Visual Basic). -or- propertyType is nulla null reference (Nothing in Visual Basic) -or- An element in attributes is nulla null reference (Nothing in Visual Basic). attributes may be nulla null reference (Nothing in Visual Basic). |
| ArgumentException | propertyType is not a runtime 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.