Open sandboxFocus

Method ContainedDescendantsAndSelf

ContainedDescendantsAndSelf(IDeclaration)

Gets the declarations (namespaces, types, methods, properties, fields, constructors, events, indexers) in the given declaration and in any child of the declaration, plus the given declaration.

Declaration
public static IEnumerable<IDeclaration> ContainedDescendantsAndSelf(this IDeclaration declaration)
Parameters
Type Name Description
IDeclaration declaration

The declaration whose descendants (and itself) to retrieve.

Returns
Type Description
IEnumerable<IDeclaration>

An enumerable starting with the declaration itself, followed by all descendant declarations, recursively.

Remarks

The method does not descent into accessors, custom attributes, parameters, or type parameters.