共用方式為


ITextBufferFactoryService.CreateTextBuffer 方法

定義

多載

CreateTextBuffer()

使用 「text」 建立空 ITextBufferIContentType

CreateTextBuffer(IContentType)

使用指定的 IContentType建立空ITextBuffer的 。

CreateTextBuffer(TextReader, IContentType)

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

CreateTextBuffer(String, IContentType)

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

CreateTextBuffer()

使用 「text」 建立空 ITextBufferIContentType

public:
 Microsoft::VisualStudio::Text::ITextBuffer ^ CreateTextBuffer();
public:
 Microsoft::VisualStudio::Text::ITextBuffer ^ CreateTextBuffer();
Microsoft::VisualStudio::Text::ITextBuffer CreateTextBuffer();
public Microsoft.VisualStudio.Text.ITextBuffer CreateTextBuffer ();
abstract member CreateTextBuffer : unit -> Microsoft.VisualStudio.Text.ITextBuffer
Public Function CreateTextBuffer () As ITextBuffer

傳回

空的 ITextBuffer 物件。

適用於

CreateTextBuffer(IContentType)

使用指定的 IContentType建立空ITextBuffer的 。

public:
 Microsoft::VisualStudio::Text::ITextBuffer ^ CreateTextBuffer(Microsoft::VisualStudio::Utilities::IContentType ^ contentType);
public:
 Microsoft::VisualStudio::Text::ITextBuffer ^ CreateTextBuffer(Microsoft::VisualStudio::Utilities::IContentType ^ contentType);
Microsoft::VisualStudio::Text::ITextBuffer CreateTextBuffer(Microsoft::VisualStudio::Utilities::IContentType const & contentType);
public Microsoft.VisualStudio.Text.ITextBuffer CreateTextBuffer (Microsoft.VisualStudio.Utilities.IContentType contentType);
abstract member CreateTextBuffer : Microsoft.VisualStudio.Utilities.IContentType -> Microsoft.VisualStudio.Text.ITextBuffer
Public Function CreateTextBuffer (contentType As IContentType) As ITextBuffer

參數

contentType
IContentType

IContentTypeITextBuffer

傳回

具有指定 ContentType 的空白 ITextBuffer

例外狀況

contentType 為 null。

備註

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

適用於

CreateTextBuffer(TextReader, IContentType)

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

public:
 Microsoft::VisualStudio::Text::ITextBuffer ^ CreateTextBuffer(System::IO::TextReader ^ reader, Microsoft::VisualStudio::Utilities::IContentType ^ contentType);
public Microsoft.VisualStudio.Text.ITextBuffer CreateTextBuffer (System.IO.TextReader reader, Microsoft.VisualStudio.Utilities.IContentType contentType);
abstract member CreateTextBuffer : System.IO.TextReader * Microsoft.VisualStudio.Utilities.IContentType -> Microsoft.VisualStudio.Text.ITextBuffer
Public Function CreateTextBuffer (reader As TextReader, contentType As IContentType) As ITextBuffer

參數

reader
TextReader

要從中讀取的 TextReader。

contentType
IContentType

新中包含的文字的 。contentTypeITextBuffer

傳回

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

例外狀況

contentType 為 null。

備註

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

適用於

CreateTextBuffer(String, IContentType)

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

public:
 Microsoft::VisualStudio::Text::ITextBuffer ^ CreateTextBuffer(System::String ^ text, Microsoft::VisualStudio::Utilities::IContentType ^ contentType);
public:
 Microsoft::VisualStudio::Text::ITextBuffer ^ CreateTextBuffer(Platform::String ^ text, Microsoft::VisualStudio::Utilities::IContentType ^ contentType);
Microsoft::VisualStudio::Text::ITextBuffer CreateTextBuffer(std::wstring const & text, Microsoft::VisualStudio::Utilities::IContentType const & contentType);
public Microsoft.VisualStudio.Text.ITextBuffer CreateTextBuffer (string text, Microsoft.VisualStudio.Utilities.IContentType contentType);
abstract member CreateTextBuffer : string * Microsoft.VisualStudio.Utilities.IContentType -> Microsoft.VisualStudio.Text.ITextBuffer
Public Function CreateTextBuffer (text As String, contentType As IContentType) As ITextBuffer

參數

text
String

要加入的初始文字。

contentType
IContentType

IContentTypeITextBuffer

傳回

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

例外狀況

textcontentType 為 null。

備註

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

適用於