CodeAttributeDeclarationCollection.Add(CodeAttributeDeclaration) Metod
Definition
Viktigt
En del information gäller för förhandsversionen av en produkt och kan komma att ändras avsevärt innan produkten blir allmänt tillgänglig. Microsoft lämnar inga garantier, uttryckliga eller underförstådda, avseende informationen som visas här.
Lägger till ett CodeAttributeDeclaration objekt med det angivna värdet i samlingen.
public:
int Add(System::CodeDom::CodeAttributeDeclaration ^ value);
public int Add(System.CodeDom.CodeAttributeDeclaration value);
member this.Add : System.CodeDom.CodeAttributeDeclaration -> int
Public Function Add (value As CodeAttributeDeclaration) As Integer
Parametrar
- value
- CodeAttributeDeclaration
Objektet som CodeAttributeDeclaration ska läggas till.
Returer
Indexet där det nya elementet infogades.
Exempel
I följande exempel visas hur du lägger till ett CodeAttributeDeclaration objekt i en CodeAttributeDeclarationCollection instans.
// Adds a CodeAttributeDeclaration to the collection.
collection.Add( new CodeAttributeDeclaration("DescriptionAttribute", new CodeAttributeArgument(new CodePrimitiveExpression("Test Description"))) );
' Adds a CodeAttributeDeclaration to the collection.
collection.Add(New CodeAttributeDeclaration("DescriptionAttribute", New CodeAttributeArgument(New CodePrimitiveExpression("Test Description"))))