CodeAttribute2::Children Property

 

Gets a collection of objects contained within this code construct.

Namespace:   EnvDTE80
Assembly:  EnvDTE80 (in EnvDTE80.dll)

property CodeElements^ Children {
	CodeElements^ get();
}

Property Value

Type: EnvDTE::CodeElements^

Returns a CodeElements collection.

If an object has no children, then Nothing or null is returned.

This property is used primarily by Visual C++. The Children property returns every object returnable from a code element. A class, for example, returns members, bases, implemented interfaces, attributes, comments, and so forth.

To iterate through the members of a namespace or type (class, struct, interface, and so forth), you must query interface (QI) or cast the CodeElement object to a CodeNamespace object and then use the Members property.

The Children property returns the collection of all related CodeElement2 objects that can be referenced via this code element. For example, for a CodeClass2 object, this might include the metadata code elements for the class and perhaps the Visual C++ declspecs, along with contributed code based on the Attributed Programming feature in Visual C++, template parameters, and so forth. A CodeFunction2 object might include all of its parameters, contributed parameters based on the Attributed Programming feature, and so forth.

The Children property may return Nothing or null depending on the object and the language. There is no requirement to support this in Visual Studio.

The following example creates a new namespace and attribute in the current class and lists some of the attribute's properties.

No code example is currently available or this language may not be supported.
Return to top
Show: