IStructureTag2.PrimaryHeaderSpan Property

Definition

Gets the optional Span of the primary header of the code block represented by this tag.

public Microsoft.VisualStudio.Text.Span? PrimaryHeaderSpan { get; }
member this.PrimaryHeaderSpan : Nullable<Microsoft.VisualStudio.Text.Span>
Public ReadOnly Property PrimaryHeaderSpan As Nullable(Of Span)

Property Value

Remarks

For example, in the following snippet of code,

if (condition1)
{
    //something;
}
else
{
    // something else;
}

PrimaryHeaderSpan of the IStructureTag2 representing "else" statement block would be the same as the HeaderSpan of the IStructureTag representing "if" statement block. This allows structure visualizing features to provide more useful context when visualizing "else" structure blocks.

Applies to