ITextBufferFactoryService3.CreateTextBuffer 方法
定義
重要
部分資訊涉及發行前產品,在發行之前可能會有大幅修改。 Microsoft 對此處提供的資訊,不做任何明確或隱含的瑕疵擔保。
多載
CreateTextBuffer(ITextImage, IContentType) |
使用指定的 IContentType 建立 ,ITextBuffer並以 中包含的 |
CreateTextBuffer(SnapshotSpan, IContentType) |
使用指定的 IContentType 建立 ,ITextBuffer並以 中包含的指定文字填入 |
CreateTextBuffer(TextReader, IContentType, Int64, String) |
使用指定的 |
CreateTextBuffer(ITextImage, IContentType)
使用指定的 IContentType 建立 ,ITextBuffer並以 中包含的image
文字填入它。
public:
Microsoft::VisualStudio::Text::ITextBuffer ^ CreateTextBuffer(Microsoft::VisualStudio::Text::ITextImage ^ image, Microsoft::VisualStudio::Utilities::IContentType ^ contentType);
public Microsoft.VisualStudio.Text.ITextBuffer CreateTextBuffer (Microsoft.VisualStudio.Text.ITextImage image, Microsoft.VisualStudio.Utilities.IContentType contentType);
abstract member CreateTextBuffer : Microsoft.VisualStudio.Text.ITextImage * Microsoft.VisualStudio.Utilities.IContentType -> Microsoft.VisualStudio.Text.ITextBuffer
Public Function CreateTextBuffer (image As ITextImage, contentType As IContentType) As ITextBuffer
參數
- image
- ITextImage
緩衝區的初始文字。
- contentType
- IContentType
新 IContentType 的 ITextBuffer。
傳回
ITextBuffer具有指定文字和IContentType的物件。
例外狀況
image
或 contentType
為 null。
備註
這個方法可以在任何線程上呼叫。 這個方法會在呼叫的線程上引發 TextBufferCreated 和 ContentTypeChanged(ITextBuffer, IContentType, IContentType) 。
適用於
CreateTextBuffer(SnapshotSpan, IContentType)
使用指定的 IContentType 建立 ,ITextBuffer並以 中包含的指定文字填入span
它。
public:
Microsoft::VisualStudio::Text::ITextBuffer ^ CreateTextBuffer(Microsoft::VisualStudio::Text::SnapshotSpan span, Microsoft::VisualStudio::Utilities::IContentType ^ contentType);
public Microsoft.VisualStudio.Text.ITextBuffer CreateTextBuffer (Microsoft.VisualStudio.Text.SnapshotSpan span, Microsoft.VisualStudio.Utilities.IContentType contentType);
abstract member CreateTextBuffer : Microsoft.VisualStudio.Text.SnapshotSpan * Microsoft.VisualStudio.Utilities.IContentType -> Microsoft.VisualStudio.Text.ITextBuffer
Public Function CreateTextBuffer (span As SnapshotSpan, contentType As IContentType) As ITextBuffer
參數
- span
- SnapshotSpan
要加入的初始文字。
- contentType
- IContentType
新 IContentType 的 ITextBuffer。
傳回
ITextBuffer具有指定文字和IContentType的物件。
例外狀況
span
或 contentType
為 null。
備註
這個方法可以在任何線程上呼叫。 這個方法會在呼叫的線程上引發 TextBufferCreated 和 ContentTypeChanged(ITextBuffer, IContentType, IContentType) 。
適用於
CreateTextBuffer(TextReader, IContentType, Int64, String)
使用指定的 contentType
建立 ,ITextBuffer並從指定的 TextReader 讀取數據來填入它。
public Microsoft.VisualStudio.Text.ITextBuffer CreateTextBuffer (System.IO.TextReader reader, Microsoft.VisualStudio.Utilities.IContentType contentType, long length = -1, string traceId = "");
abstract member CreateTextBuffer : System.IO.TextReader * Microsoft.VisualStudio.Utilities.IContentType * int64 * string -> Microsoft.VisualStudio.Text.ITextBuffer
Public Function CreateTextBuffer (reader As TextReader, contentType As IContentType, Optional length As Long = -1, Optional traceId As String = "") As ITextBuffer
參數
- reader
- TextReader
要從中讀取的 TextReader。
- contentType
- IContentType
新中包含的文字的 。contentType
ITextBuffer
- length
- Int64
如果已知,則為備份文字讀取器之檔案的長度;否則為 -1。
- traceId
- String
偵錯追蹤中使用的選擇性標識碼。
傳回
ITextBuffer具有指定 TextReader 和 contentType
的物件。
例外狀況
contentType
為 null。
備註
這個方法可以在任何線程上呼叫。 這個方法會在呼叫的線程上引發 TextBufferCreated 和 ContentTypeChanged(ITextBuffer, IContentType, IContentType) 。