SemanticModel.IsAccessible(Int32, ISymbol) Method

Definition

Determines if the symbol is accessible from the specified location.

public:
 bool IsAccessible(int position, Microsoft::CodeAnalysis::ISymbol ^ symbol);
public bool IsAccessible (int position, Microsoft.CodeAnalysis.ISymbol symbol);
member this.IsAccessible : int * Microsoft.CodeAnalysis.ISymbol -> bool
Public Function IsAccessible (position As Integer, symbol As ISymbol) As Boolean

Parameters

position
Int32

A character position used to identify a declaration scope and accessibility. This character position must be within the FullSpan of the Root syntax node in this SemanticModel.

symbol
ISymbol

The symbol that we are checking to see if it accessible.

Returns

True if "symbol is accessible, false otherwise.

Remarks

This method only checks accessibility from the point of view of the accessibility modifiers on symbol and its containing types. Even if true is returned, the given symbol may not be able to be referenced for other reasons, such as name hiding.

Applies to