ISymbol Interface
Important
Some information relates to prerelease product that may be substantially modified before it’s released. Microsoft makes no warranties, express or implied, with respect to the information provided here.
Represents a symbol (namespace, class, method, parameter, etc.) exposed by the compiler.
public interface class ISymbol : IEquatable<Microsoft::CodeAnalysis::ISymbol ^>
public interface ISymbol : IEquatable<Microsoft.CodeAnalysis.ISymbol>
type ISymbol = interface
interface IEquatable<ISymbol>
Public Interface ISymbol
Implements IEquatable(Of ISymbol)
- Derived
- Implements
This interface is reserved for implementation by its associated APIs. We reserve the right to change it in the future.
Can |
Returns true if this symbol can be referenced by its name in code. |
Containing |
Gets the IAssemblySymbol for the containing assembly. Returns null if the symbol is shared across multiple assemblies. |
Containing |
Gets the IModuleSymbol for the containing module. Returns null if the symbol is shared across multiple modules. |
Containing |
Gets the INamespaceSymbol for the nearest enclosing namespace. Returns null if the symbol isn't contained in a namespace. |
Containing |
Gets the ISymbol for the immediately containing symbol. |
Containing |
Gets the INamedTypeSymbol for the containing type. Returns null if the symbol is not contained within a type. |
Declared |
Gets a Accessibility indicating the declared accessibility for the symbol. Returns NotApplicable if no accessibility is declared. |
Declaring |
Get the syntax node(s) where this symbol was declared in source. Some symbols (for example, partial classes) may be defined in more than one location. This property should return one or more syntax nodes only if the symbol was declared in source code and also was not implicitly declared (see the IsImplicitlyDeclared property). Note that for namespace symbol, the declaring syntax might be declaring a nested namespace. For example, the declaring syntax node for N1 in "namespace N1.N2 {...}" is the entire NamespaceDeclarationSyntax for N1.N2. For the global namespace, the declaring syntax will be the CompilationUnitSyntax. |
Has |
Indicates that this symbol uses metadata that cannot be supported by the language. Examples include:
This is distinguished from, for example, references to metadata symbols defined in assemblies that weren't referenced. Symbols where this returns true can never be used successfully, and thus should never appear in any IDE feature. This is set for metadata symbols, as follows:
|
Is |
Gets a value indicating whether the symbol is abstract. |
Is |
Gets a value indicating whether the symbol is the original definition. Returns false if the symbol is derived from another symbol, by type substitution for instance. |
Is |
Gets a value indicating whether the symbol is defined externally. |
Is |
Returns true if this symbol was automatically created by the compiler, and does not have an explicit corresponding source code declaration. |
Is |
Gets a value indicating whether the symbol is an override of a base class symbol. |
Is |
Gets a value indicating whether the symbol is sealed. |
Is |
Gets a value indicating whether the symbol is static. |
Is |
Gets a value indicating whether the symbol is virtual. |
Kind |
Gets the SymbolKind indicating what kind of symbol it is. |
Language |
Gets the source language ("C#" or "Visual Basic"). |
Locations |
Gets the locations where the symbol was originally defined, either in source or metadata. Some symbols (for example, partial classes) may be defined in more than one location. |
Metadata |
Gets the name of a symbol as it appears in metadata. Most of the time, this is the same as the Name property, with the following exceptions:
|
Metadata |
Gets the metadata token associated with this symbol, or 0 if the symbol is not loaded from metadata. |
Name |
Gets the symbol name. Returns the empty string if unnamed. |
Original |
Gets the ISymbol for the original definition of the symbol. If this symbol is derived from another symbol, by type substitution for instance, this gets the original symbol, as it was defined in source or metadata. |
Accept(Symbol |
|
Accept<TArgument,TResult>(Symbol |
|
Accept<TResult>(Symbol |
|
Equals(ISymbol, Symbol |
Determines if this symbol is equal to another, according to the rules of the provided SymbolEqualityComparer |
Get |
Gets the attributes for the symbol. Returns an empty ImmutableArray<T> if there are no attributes. |
Get |
Returns the Documentation Comment ID for the symbol, or null if the symbol doesn't support documentation comments. |
Get |
Gets the XML (as text) for the comment associated with the symbol. |
To |
Convert a symbol to an array of string parts, each of which has a kind. Useful for colorizing the display string. |
To |
Converts the symbol to a string representation. |
To |
Convert a symbol to an array of string parts, each of which has a kind. May be tailored to a specific location in the source code. Useful for colorizing the display string. |
To |
Convert a symbol to a string that can be displayed to the user. May be tailored to a specific location in the source code. |
Is |
|
Is |
|
Is |
|
Is |
|
Is |
Determines if symbol is Shared. |
.NET feedback
.NET is an open source project. Select a link to provide feedback: