Share via


FileContext 类

定义

描述文件可能所属的上下文,例如源文件的编译单元、.js 文件的使用 HTML 页面等。

public ref class FileContext : Microsoft::VisualStudio::Workspace::INotifyFileContextChanged
[Windows::Foundation::Metadata::WebHostHidden]
class FileContext : Microsoft::VisualStudio::Workspace::INotifyFileContextChanged
public class FileContext : Microsoft.VisualStudio.Workspace.INotifyFileContextChanged
type FileContext = class
    interface INotifyFileContextChanged
Public Class FileContext
Implements INotifyFileContextChanged
继承
FileContext
实现

注解

此类型的实例可以跨多个文件或上下文成员共享。

构造函数

FileContext(Guid, Guid, Object, IReadOnlyCollection<String>, String, INotifyFileContextChanged)

初始化 FileContext 类的新实例。

字段

EmptyFileContexts

空文件上下文

属性

Context

获取语言服务需要为此上下文的成员完全初始化的信息。

ContextType

获取 对象类型和 中 Context表示的数据的标识符。 这可用于与兼容的语言服务提供商匹配。

DisplayName

获取此上下文的名称 ((如果任何) 可能显示给用户以在多个可用上下文之间进行选择)。

InputFiles

获取用作计算此上下文的输入的文件的工作区相对路径集。 这不是将进入编译单元的源文件集,而是用于确定如何汇编上下文的读取文件集。

NotifyFileContextChanged

返回或设置已更改的当前文件上下文

OnFileContextChanged

文件上下文更改时

ProviderType

此上下文的提供程序源

方法

CreateFileContexts(FileContext[])

返回文件上下文集合

GetContext<T>()

获取假定预期类型的上下文

IsContextTypeOf<T>()

如果包含的上下文属于特定类型

适用于