Udostępnij za pośrednictwem


ITextBufferFactoryService2.CreateTextBuffer Metoda

Definicja

Przeciążenia

CreateTextBuffer(SnapshotSpan, IContentType)

Tworzy obiekt ITextBuffer z określonym IContentType elementem i wypełnia go danym tekstem zawartym w pliku span.

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

Tworzy obiekt ITextBuffer z danym contentType elementem i wypełnia go, odczytując dane z określonego elementu TextReader.

CreateTextBuffer(SnapshotSpan, IContentType)

Tworzy obiekt ITextBuffer z określonym IContentType elementem i wypełnia go danym tekstem zawartym w pliku 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

Parametry

span
SnapshotSpan

Początkowy tekst do dodania.

contentType
IContentType

Element IContentType dla nowego ITextBufferelementu .

Zwraca

ITextBuffer Obiekt z podanym tekstem i IContentType.

Wyjątki

Wartość span lub contentType ma wartość null.

Uwagi

Tę metodę można wywołać w dowolnym wątku. Ta metoda zostanie wywołana TextBufferCreated i ContentTypeChanged(ITextBuffer, IContentType, IContentType) w wątku, który został wywołany.

Dotyczy

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

Tworzy obiekt ITextBuffer z danym contentType elementem i wypełnia go, odczytując dane z określonego elementu TextReader.

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

Parametry

reader
TextReader

Element TextReader, z którego ma być odczytywany.

contentType
IContentType

Element contentType dla tekstu zawartego w nowym ITextBuffer

length
Int64

Długość pliku kopii zapasowej czytnika tekstu, jeśli jest znana; w przeciwnym razie -1.

traceId
String

Opcjonalny identyfikator używany w śledzeniu debugowania.

throwOnInvalidCharacters
Boolean

Zgłoś wyjątek FileFormat, jeśli napotkano niedozwolone znaki.

Zwraca

Obiekt ITextBuffer z danym elementem TextReader i contentType.

Wyjątki

contentType ma wartość null.

Uwagi

Tę metodę można wywołać w dowolnym wątku. Ta metoda zostanie wywołana TextBufferCreated i ContentTypeChanged(ITextBuffer, IContentType, IContentType) w wątku, który został wywołany.

Dotyczy