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)
Syntax
'Declaration
Public Interface ITextDocument _
Inherits IDisposable
public interface ITextDocument : IDisposable
public interface class ITextDocument : IDisposable
type ITextDocument =
interface
interface IDisposable
end
public interface ITextDocument extends IDisposable
The ITextDocument type exposes the following members.
Properties
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. |
Top
Methods
Name | Description | |
---|---|---|
![]() |
Dispose | Performs application-defined tasks associated with freeing, releasing, or resetting unmanaged resources. (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 | 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, IContentType) | 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. |
![]() |
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 | Change the encoder fallback of Encoding. |
![]() |
UpdateDirtyState | Updates the IsDirty and LastContentModifiedTime properties. |
Top
Events
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. |
Top