共用方式為


ITextBufferFactoryService3.CreateTextBuffer 方法

定義

多載

CreateTextBuffer(ITextImage, IContentType)

使用指定的 IContentType 建立 ,ITextBuffer並以 中包含的image文字填入它。

CreateTextBuffer(SnapshotSpan, IContentType)

使用指定的 IContentType 建立 ,ITextBuffer並以 中包含的指定文字填入span它。

CreateTextBuffer(TextReader, IContentType, Int64, String)

使用指定的 contentType 建立 ,ITextBuffer並從指定的 TextReader 讀取數據來填入它。

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

IContentTypeITextBuffer

傳回

ITextBuffer具有指定文字和IContentType的物件。

例外狀況

imagecontentType 為 null。

備註

這個方法可以在任何線程上呼叫。 這個方法會在呼叫的線程上引發 TextBufferCreatedContentTypeChanged(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

IContentTypeITextBuffer

傳回

ITextBuffer具有指定文字和IContentType的物件。

例外狀況

spancontentType 為 null。

備註

這個方法可以在任何線程上呼叫。 這個方法會在呼叫的線程上引發 TextBufferCreatedContentTypeChanged(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

新中包含的文字的 。contentTypeITextBuffer

length
Int64

如果已知,則為備份文字讀取器之檔案的長度;否則為 -1。

traceId
String

偵錯追蹤中使用的選擇性標識碼。

傳回

ITextBuffer具有指定 TextReader 和 contentType的物件。

例外狀況

contentType 為 null。

備註

這個方法可以在任何線程上呼叫。 這個方法會在呼叫的線程上引發 TextBufferCreatedContentTypeChanged(ITextBuffer, IContentType, IContentType)

適用於