다음을 통해 공유


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)

Syntax

‘선언
Public Interface ITextDocumentFactoryService
public interface ITextDocumentFactoryService
public interface class ITextDocumentFactoryService
type ITextDocumentFactoryService =  interface end
public interface ITextDocumentFactoryService

The ITextDocumentFactoryService type exposes the following members.

Methods

  Name Description
Public method CreateAndLoadTextDocument(String, IContentType) Creates an ITextDocument that opens and loads the contents of the file into a new ITextBuffer.
Public method CreateAndLoadTextDocument(String, IContentType, Boolean, Boolean%) Creates an ITextDocument that opens and loads the contents of the file into a new ITextBuffer.
Public method CreateAndLoadTextDocument(String, IContentType, Encoding, Boolean%) Creates an ITextDocument that opens and loads the contents of the file into a new ITextBuffer.
Public method CreateTextDocument Creates an ITextDocument with textBuffer, which is to be saved to the file.
Public method TryGetTextDocument Retrieve an ITextDocument for the given buffer, if one exists.

Top

Events

  Name Description
Public event TextDocumentCreated Occurs when an ITextDocument is created.
Public event TextDocumentDisposed Occurs when an ITextDocument is disposed.

Top

Remarks

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

[Import]
ITextDocumentFactoryService factory = null;

See Also

Reference

Microsoft.VisualStudio.Text Namespace