CodeAttributeDeclarationCollection.Add(CodeAttributeDeclaration) Метод
Определение
Важно!
Некоторые сведения относятся к предварительной версии продукта, в которую до выпуска могут быть внесены существенные изменения. Майкрософт не предоставляет никаких гарантий, явных или подразумеваемых, относительно приведенных здесь сведений.
CodeAttributeDeclaration Добавляет объект с указанным значением в коллекцию.
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
Параметры
- value
- CodeAttributeDeclaration
Добавляемый CodeAttributeDeclaration объект.
Возвращаемое значение
Индекс, по которому был вставлен новый элемент.
Примеры
В следующем примере показано, как добавить CodeAttributeDeclaration объект в CodeAttributeDeclarationCollection экземпляр.
// 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"))))