Was this page helpful?
Your feedback about this content is important. Let us know what you think.
Additional feedback?
1500 characters remaining
Export (0) Print
Expand All

CodeDirectiveCollection.Add Method

Adds the specified CodeDirective object to the collection.

Namespace:  System.CodeDom
Assembly:  System (in System.dll)

public int Add(
	CodeDirective value
)

Parameters

value
Type: System.CodeDom.CodeDirective

The CodeDirective object to add.

Return Value

Type: System.Int32
The index position at which the new element was inserted.

The following code example shows the use of the Add method to add a CodeDirective object to the collection. This example is part of a larger example provided for the CodeDirectiveCollection class.

// Adds a CodeDirective to the collection.
collection.Add(new CodeRegionDirective(CodeRegionMode.Start, "Region1"));

.NET Framework

Supported in: 4.6, 4.5, 4, 3.5, 3.0, 2.0

.NET Framework Client Profile

Supported in: 4, 3.5 SP1
Show:
© 2015 Microsoft