Skip to content

ContainingTypesScope

Disposable scope that appends all containing types for a symbol. Opens the types on creation and closes them on disposal.

C# Signature
internal readonly struct ContainingTypesScope : System.IDisposable

ContainingTypesScope(CodeWriter, ISymbol, bool, bool)

Section titled “ContainingTypesScope(CodeWriter, ISymbol, bool, bool)”

Creates a new containing types scope that appends all containing types for the specified symbol.

C# Signature
public ContainingTypesScope(CodeWriter writer, ISymbol symbol, bool appendNamespace = true, bool includeSelf = false);

The code writer to write to.

The symbol whose containing types to append.

If true, the namespace declaration will be appended.

If true, the provided symbol will be included in the containing types. Keep false to write your own type declaration for the provided symbol.

Closes all containing type blocks and restores indentation.

C# Signature
public void Dispose();