Compartilhar via


ITextBufferFactoryService2.CreateTextBuffer Método

Definição

Sobrecargas

CreateTextBuffer(SnapshotSpan, IContentType)

Cria um ITextBuffer com o especificado IContentType e o preenche com o texto fornecido contido em span.

CreateTextBuffer(TextReader, IContentType, Int64, String, Boolean)

Cria um ITextBuffer com o fornecido contentType e o preenche lendo dados do TextReader especificado.

CreateTextBuffer(SnapshotSpan, IContentType)

Cria um ITextBuffer com o especificado IContentType e o preenche com o texto fornecido contido em 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

Parâmetros

span
SnapshotSpan

O texto inicial a ser adicionado.

contentType
IContentType

O IContentType para o novo ITextBuffer.

Retornos

Um ITextBuffer objeto com o texto fornecido e IContentType.

Exceções

Se span ou contentType é nulo.

Comentários

Esse método pode ser chamado em qualquer thread. Esse método gerará TextBufferCreated e ContentTypeChanged(ITextBuffer, IContentType, IContentType) no thread que ele foi chamado.

Aplica-se a

CreateTextBuffer(TextReader, IContentType, Int64, String, Boolean)

Cria um ITextBuffer com o fornecido contentType e o preenche lendo dados do TextReader especificado.

public Microsoft.VisualStudio.Text.ITextBuffer CreateTextBuffer (System.IO.TextReader reader, Microsoft.VisualStudio.Utilities.IContentType contentType, long length = -1, string traceId = "", bool throwOnInvalidCharacters = false);
abstract member CreateTextBuffer : System.IO.TextReader * Microsoft.VisualStudio.Utilities.IContentType * int64 * string * bool -> Microsoft.VisualStudio.Text.ITextBuffer
Public Function CreateTextBuffer (reader As TextReader, contentType As IContentType, Optional length As Long = -1, Optional traceId As String = "", Optional throwOnInvalidCharacters As Boolean = false) As ITextBuffer

Parâmetros

reader
TextReader

O TextReader do qual ler.

contentType
IContentType

O contentType para o texto contido no novo ITextBuffer

length
Int64

O comprimento do arquivo que dá suporte ao leitor de texto, se conhecido; caso contrário, -1.

traceId
String

Um identificador opcional usado no rastreamento de depuração.

throwOnInvalidCharacters
Boolean

Gere uma exceção FileFormat se forem encontrados caracteres ilegais.

Retornos

Um ITextBuffer objeto com o TextReader e contentTypedeterminados.

Exceções

contentType é nulo.

Comentários

Esse método pode ser chamado em qualquer thread. Esse método gerará TextBufferCreated e ContentTypeChanged(ITextBuffer, IContentType, IContentType) no thread que ele foi chamado.

Aplica-se a