Skip to main content

StatementListInfo Struct

Namespace: Roslynator.CSharp.Syntax

Assembly: Roslynator.CSharp.dll

Provides information about a list of statements.

public readonly struct StatementListInfo : System.Collections.Generic.IReadOnlyList<Microsoft.CodeAnalysis.CSharp.Syntax.StatementSyntax>

Inheritance

Object ValueType StatementListInfo

Implements

Indexers

IndexerSummary
Item[Int32]Gets the statement at the specified index in the list. (Implements IReadOnlyList<StatementSyntax>.Item)

Properties

PropertySummary
CountThe number of statement in the list.
IsParentBlockDetermines whether the statements are contained in a BlockSyntax.
IsParentSwitchSectionDetermines whether the statements are contained in a SwitchSectionSyntax.
ParentThe node that contains the statements. It can be either a BlockSyntax or a SwitchSectionSyntax.
ParentAsBlockGets a block that contains the statements. Returns null if the statements are not contained in a block.
ParentAsSwitchSectionGets a switch section that contains the statements. Returns null if the statements are not contained in a switch section.
StatementsThe list of statements.
SuccessDetermines whether this struct was initialized with an actual syntax.

Methods

MethodSummary
Add(StatementSyntax)Creates a new StatementListInfo with the specified statement added at the end.
AddRange(IEnumerable<StatementSyntax>)Creates a new StatementListInfo with the specified statements added at the end.
Any()True if the list has at least one statement.
Equals(Object)(Inherited from ValueType)
First()The first statement in the list.
FirstOrDefault()The first statement in the list or null if the list is empty.
GetEnumerator()Gets the enumerator the list of statements.
GetHashCode()(Inherited from ValueType)
GetType()(Inherited from Object)
IndexOf(Func<StatementSyntax, Boolean>)Searches for a statement that matches the predicate and returns zero-based index of the first occurrence in the list.
IndexOf(StatementSyntax)The index of the statement in the list.
Insert(Int32, StatementSyntax)Creates a new StatementListInfo with the specified statement inserted at the index.
InsertRange(Int32, IEnumerable<StatementSyntax>)Creates a new StatementListInfo with the specified statements inserted at the index.
Last()The last statement in the list.
LastIndexOf(Func<StatementSyntax, Boolean>)Searches for a statement that matches the predicate and returns zero-based index of the last occurrence in the list.
LastIndexOf(StatementSyntax)Searches for a statement and returns zero-based index of the last occurrence in the list.
LastOrDefault()The last statement in the list or null if the list is empty.
MemberwiseClone()(Inherited from Object)
Remove(StatementSyntax)Creates a new StatementListInfo with the specified statement removed.
RemoveAt(Int32)Creates a new StatementListInfo with the statement at the specified index removed.
RemoveNode(SyntaxNode, SyntaxRemoveOptions)Creates a new StatementListInfo with the specified node removed.
Replace(StatementSyntax, StatementSyntax)Creates a new StatementListInfo with the specified statement replaced with the new statement.
ReplaceAt(Int32, StatementSyntax)Creates a new StatementListInfo with the statement at the specified index replaced with a new statement.
ReplaceNode(SyntaxNode, SyntaxNode)Creates a new StatementListInfo with the specified old node replaced with a new node.
ReplaceRange(StatementSyntax, IEnumerable<StatementSyntax>)Creates a new StatementListInfo with the specified statement replaced with new statements.
ToString()(Inherited from ValueType)
WithStatements(IEnumerable<StatementSyntax>)Creates a new StatementListInfo with the statements updated.
WithStatements(SyntaxList<StatementSyntax>)Creates a new StatementListInfo with the statements updated.

Explicit Interface Implementations

MemberSummary
IEnumerable.GetEnumerator()
IEnumerable<StatementSyntax>.GetEnumerator()