Export (0) Print
Expand All

ITextDocument Interface

Represents a document in the file system that persists an ITextBuffer.

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

public interface ITextDocument : IDisposable

The ITextDocument type exposes the following members.

  NameDescription
Public propertyEncodingGets or sets the encoding of the document when saved to disk.
Public propertyFilePathThe name and path of the file.
Public propertyIsDirtyDetermines whether the ITextBuffer is dirty.
Public propertyIsReloadingDetermines whether the Reload method is executing.
Public propertyLastContentModifiedTimeGets the last DateTime a change was made to the contents of the ITextBuffer.
Public propertyLastSavedTimeGets the last DateTime the file was saved. This time exactly matches the last file written time on the file system.
Public propertyTextBufferGets the ITextBuffer containing the document. This value is always non-null.
Top

  NameDescription
Public methodDisposePerforms application-defined tasks associated with freeing, releasing, or resetting unmanaged resources. (Inherited from IDisposable.)
Public methodReload()Reloads the contents of FilePath into a TextBuffer.
Public methodReload(EditOptions)Reloads the contents of FilePath into TextBuffer, using the given EditOptions.
Public methodRenameRename the document to the given new file path.
Public methodSaveSaves the contents of the TextBuffer to the FilePath.
Public methodSaveAs(String, Boolean)Saves the contents of the TextBuffer to the specified file path.
Public methodSaveAs(String, Boolean, IContentType)Saves the contents of the TextBuffer to the specified file path.
Public methodSaveAs(String, Boolean, Boolean)Saves the contents of the TextBuffer to the specified file path.
Public methodSaveAs(String, Boolean, Boolean, IContentType)Saves the contents of the TextBuffer to the specified file path.
Public methodSaveCopy(String, Boolean)Saves the contents of the TextBuffer to the given filePath.
Public methodSaveCopy(String, Boolean, Boolean)Saves the contents of the TextBuffer to the specified file path.
Public methodSetEncoderFallbackChange the encoder fallback of Encoding.
Public methodUpdateDirtyStateUpdates the IsDirty and LastContentModifiedTime properties.
Top

  NameDescription
Public eventDirtyStateChangedOccurs when the value of IsDirty changes.
Public eventEncodingChangedOccurs when the Encoding property changes.
Public eventFileActionOccurredOccurs when the document has been loaded from or saved to disk.
Top
Show:
© 2014 Microsoft