ITextDocument Interface
Definition
Important
Some information relates to prerelease product that may be substantially modified before it’s released. Microsoft makes no warranties, express or implied, with respect to the information provided here.
Represents a document in the file system that persists an ITextBuffer.
public interface class ITextDocument : IDisposable
public interface ITextDocument : IDisposable
type ITextDocument = interface
interface IDisposable
Public Interface ITextDocument
Implements IDisposable
- Implements
Properties
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 document is currently being reloaded. |
LastContentModifiedTime |
Gets the last DateTime a change was made to the contents of the document. If it has not been modified since it was loaded or reloaded from disk, this will be the last write time of the underlying file at the time the load or reload occurred; otherwise, it is the last time the contents of the text buffer were changed. |
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. |
Methods
Reload() |
Reloads the contents of FilePath into 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 FilePath. |
SaveAs(String, Boolean, Boolean, IContentType) |
Saves the contents of the TextBuffer to the given |
SaveAs(String, Boolean, Boolean) |
Saves the contents of the TextBuffer to the given |
SaveAs(String, Boolean, IContentType) |
Saves the contents of the TextBuffer to the given |
SaveAs(String, Boolean) |
Saves the contents of the TextBuffer to the given |
SaveCopy(String, Boolean, Boolean) |
Saves the contents of the TextBuffer to the given |
SaveCopy(String, Boolean) |
Saves the contents of the TextBuffer to the given |
SetEncoderFallback(EncoderFallback) |
Change the encoder fallback of Encoding. |
UpdateDirtyState(Boolean, DateTime) |
Updates the IsDirty and LastContentModifiedTime properties. |
Events
DirtyStateChanged |
Occurs when the value of IsDirty changes. You may not call UpdateDirtyState(Boolean, DateTime) in order to change the IsDirty property while handling this event. |
EncodingChanged |
Occurs when the Encoding property changes. |
FileActionOccurred |
Occurs when the document has been loaded from or saved to disk. |