IVsCustomClosedFileDocDataProvider.GetCustomDocDataForFilePathAsync 方法
定义
重要
一些信息与预发行产品相关,相应产品在发行之前可能会进行重大修改。 对于此处提供的信息,Microsoft 不作任何明示或暗示的担保。
在“查找”方案中调用,以允许自定义编辑器为关闭的文件提供 IVsPersistDocData 实现。 IVsPersistDocData自定义编辑器提供的 应与在 Visual Studio 中打开文件时提供给运行文档表的相同。 IVsPersistDocData自定义编辑器的实现还必须实现 IVsTextLines 和 并IVsUserData公开当前ITextSnapshot
public System.Threading.Tasks.Task<Microsoft.VisualStudio.Shell.Interop.IVsPersistDocData?> GetCustomDocDataForFilePathAsync(string filePath, System.Threading.CancellationToken cancellationToken);
abstract member GetCustomDocDataForFilePathAsync : string * System.Threading.CancellationToken -> System.Threading.Tasks.Task<Microsoft.VisualStudio.Shell.Interop.IVsPersistDocData>
Public Function GetCustomDocDataForFilePathAsync (filePath As String, cancellationToken As CancellationToken) As Task(Of IVsPersistDocData)
参数
- filePath
- String
- cancellationToken
- CancellationToken
返回
示例
[Export (typeof (IVsCustomClosedFileDocDataProvider) ) public class CustomClosedFileDocDataProvider: IVsCustomClosedFileDocDataProvider { public async Task<>IVsPersistDocDataGetCustomDocDataForFilePathAsync(String, CancellationToken) { // Logic 返回请求的文件路径的自定义。IVsPersistDocData } }
注解
从后台线程调用。