ITextDocument Interface
Represents a document in the file system that persists an ITextBuffer.
Assembly: Microsoft.VisualStudio.Text.Data (in Microsoft.VisualStudio.Text.Data.dll)
| Name | Description | |
|---|---|---|
![]() | Encoding | Gets or sets the encoding of the document when saved to disk. |
![]() | FilePath | The name and path of the file. |
![]() | IsDirty | Determines whether the ITextBuffer is dirty. |
![]() | IsReloading | Determines whether the Reload method is executing. |
![]() | LastContentModifiedTime | Gets the last DateTime a change was made to the contents of the ITextBuffer. |
![]() | LastSavedTime | Gets the last DateTime the file was saved. This time exactly matches the last file written time on the file system. |
![]() | TextBuffer | Gets the ITextBuffer containing the document. This value is always non-null. |
| Name | Description | |
|---|---|---|
![]() | Dispose() | (Inherited from IDisposable.) |
![]() | Reload() | Reloads the contents of FilePath into a TextBuffer. |
![]() | Reload(EditOptions) | Reloads the contents of FilePath into TextBuffer, using the given EditOptions. |
![]() | Rename(String) | Rename the document to the given new file path. |
![]() | Save() | Saves the contents of the TextBuffer to the FilePath. |
![]() | SaveAs(String, Boolean) | Saves the contents of the TextBuffer to the specified file path. |
![]() | SaveAs(String, Boolean, Boolean) | Saves the contents of the TextBuffer to the specified file path. |
![]() | SaveAs(String, Boolean, Boolean, IContentType) | Saves the contents of the TextBuffer to the specified file path. |
![]() | SaveAs(String, Boolean, IContentType) | Saves the contents of the TextBuffer to the specified file path. |
![]() | SaveCopy(String, Boolean) | Saves the contents of the TextBuffer to the given filePath. |
![]() | SaveCopy(String, Boolean, Boolean) | Saves the contents of the TextBuffer to the specified file path. |
![]() | SetEncoderFallback(EncoderFallback) | Change the encoder fallback of Encoding. |
![]() | UpdateDirtyState(Boolean, DateTime) | Updates the IsDirty and LastContentModifiedTime properties. |
| Name | Description | |
|---|---|---|
![]() | DirtyStateChanged | Occurs when the value of IsDirty changes. |
![]() | EncodingChanged | Occurs when the Encoding property changes. |
![]() | FileActionOccurred | Occurs when the document has been loaded from or saved to disk. |


