Skip to content

Latest commit

 

History

History
84 lines (65 loc) · 7.65 KB

File metadata and controls

84 lines (65 loc) · 7.65 KB

StatementListInfo Struct

HomeIndexersPropertiesMethodsExplicit Interface Implementations

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

ObjectValueType → StatementListInfo

Implements

Indexers

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

Properties

Property Summary
Count The number of statement in the list.
IsParentBlock Determines whether the statements are contained in a BlockSyntax.
IsParentSwitchSection Determines whether the statements are contained in a SwitchSectionSyntax.
Parent The node that contains the statements. It can be either a BlockSyntax or a SwitchSectionSyntax.
ParentAsBlock Gets a block that contains the statements. Returns null if the statements are not contained in a block.
ParentAsSwitchSection Gets a switch section that contains the statements. Returns null if the statements are not contained in a switch section.
Statements The list of statements.
Success Determines whether this struct was initialized with an actual syntax.

Methods

Method Summary
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

Member Summary
IEnumerable.GetEnumerator()
IEnumerable<StatementSyntax>.GetEnumerator()