Delen via


SemanticModel.LookupStaticMembers Method

Definition

Gets the available named static member symbols in the context of the specified location and optional container. Only members that are accessible and visible from the given location are returned.

Non-reduced extension methods are considered, since they are static methods.

public System.Collections.Immutable.ImmutableArray<Microsoft.CodeAnalysis.ISymbol> LookupStaticMembers (int position, Microsoft.CodeAnalysis.INamespaceOrTypeSymbol container = default, string name = default);
public System.Collections.Immutable.ImmutableArray<Microsoft.CodeAnalysis.ISymbol> LookupStaticMembers (int position, Microsoft.CodeAnalysis.INamespaceOrTypeSymbol? container = default, string? name = default);
member this.LookupStaticMembers : int * Microsoft.CodeAnalysis.INamespaceOrTypeSymbol * string -> System.Collections.Immutable.ImmutableArray<Microsoft.CodeAnalysis.ISymbol>
Public Function LookupStaticMembers (position As Integer, Optional container As INamespaceOrTypeSymbol = Nothing, Optional name As String = Nothing) As ImmutableArray(Of ISymbol)

Parameters

position
Int32

The character position for determining the enclosing declaration scope and accessibility.

container
INamespaceOrTypeSymbol

The container to search for symbols within. If null then the enclosing declaration scope around position is used.

name
String

The name of the symbol to find. If null is specified then symbols with any names are returned.

Returns

A list of symbols that were found. If no symbols were found, an empty list is returned.

Remarks

The "position" is used to determine what variables are visible and accessible. Even if "container" is specified, the "position" location is significant for determining which members of "containing" are accessible.

Essentially the same as filtering instance members out of the results of an analogous LookupSymbols(Int32, INamespaceOrTypeSymbol, String, Boolean) call.

Applies to