IImportScope Interface
Definition
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 the set of symbols that are imported to a particular position in a source file. Each import has a reference to the location the import directive was declared at. For the IAliasSymbol import, the location can be found using either Locations or DeclaringSyntaxReferences on the IAliasSymbol itself. For Imports or XmlNamespaces the location is found through DeclaringSyntaxReference or DeclaringSyntaxReference respectively.
public interface IImportScope
type IImportScope = interface
Public Interface IImportScope
Remarks
- Scopes returned will always have at least one non-empty property value in them.
- Symbols may be imported, but may not necessarily be available at that location (for example, an alias symbol hidden by another symbol).
- In C# there will be an IImportScope for every containing namespace-declarations that include any import directives. There will also be an IImportScope for the containing compilation-unit if it includes any import directives or if there are global import directives pulled in from other files.
- In Visual Basic there will commonly be one or two IImportScopes returned for any position. This will commonly be a scope for the containing compilation unit if it includes any import directives. As well as a scope representing any imports specified at the project level.
- Elements of any property have no defined order. Even if they represent items from a single document, they are not guaranteed to be returned in any specific file-oriented order.
- There is no guarantee that the same scope instances will be returned from successive calls to GetImportScopes(Int32, CancellationToken).
Properties
| Name | Description |
|---|---|
| Aliases |
Aliases defined at this level of the chain. This corresponds to |
| ExternAliases |
Extern aliases defined at this level of the chain. This corresponds to |
| Imports |
Types or namespaces imported at this level of the chain. This corresponds to |
| XmlNamespaces |
Xml namespaces imported at this level of the chain. This corresponds to |