将跟踪范围映射到其文本缓冲区中的指定快照并获取它指定的文本。
命名空间: Microsoft.VisualStudio.Text
程序集: Microsoft.VisualStudio.Text.Data(在 Microsoft.VisualStudio.Text.Data.dll 中)
语法
声明
Function GetText ( _
snapshot As ITextSnapshot _
) As String
string GetText(
ITextSnapshot snapshot
)
String^ GetText(
ITextSnapshot^ snapshot
)
abstract GetText :
snapshot:ITextSnapshot -> string
function GetText(
snapshot : ITextSnapshot
) : String
参数
snapshot
类型:Microsoft.VisualStudio.Text.ITextSnapshot跟踪范围要映射到的快照。
返回值
类型:String
指定文本快照中的跟踪范围的内容。
异常
异常 | 条件 |
---|---|
ArgumentNullException | snapshot 为 nullnull 引用(在 Visual Basic 中为 Nothing)。 |
ArgumentException | snapshot 不是 TextBuffer快照。 |
.NET Framework 安全性
- 对直接调用方的完全信任。此成员不能由部分信任的代码使用。有关详细信息,请参阅通过部分受信任的代码使用库。