ITextDocumentFactoryService Interface

Represents a service that creates, loads, and disposes text documents.

Namespace:  Microsoft.VisualStudio.Text
Assembly:  Microsoft.VisualStudio.Text.Data (in Microsoft.VisualStudio.Text.Data.dll)

public interface ITextDocumentFactoryService

The ITextDocumentFactoryService type exposes the following members.

  NameDescription
Public methodCreateAndLoadTextDocument(String, IContentType)Creates an ITextDocument that opens and loads the contents of the file into a new ITextBuffer.
Public methodCreateAndLoadTextDocument(String, IContentType, Boolean, Boolean)Creates an ITextDocument that opens and loads the contents of the file into a new ITextBuffer.
Public methodCreateAndLoadTextDocument(String, IContentType, Encoding, Boolean)Creates an ITextDocument that opens and loads the contents of the file into a new ITextBuffer.
Public methodCreateTextDocumentCreates an ITextDocument with textBuffer, which is to be saved to the file.
Public methodTryGetTextDocumentRetrieve an ITextDocument for the given buffer, if one exists.
Top

  NameDescription
Public eventTextDocumentCreatedOccurs when an ITextDocument is created.
Public eventTextDocumentDisposedOccurs when an ITextDocument is disposed.
Top

This is a MEF component part, and should be imported as follows:

[Import]
ITextDocumentFactoryService factory = null;
Was this page helpful?
(1500 characters remaining)
Thank you for your feedback
Show:
© 2014 Microsoft