You are here: Plugin API > Library Reference > IHost Interface > IDocument Interface
IDocument Interface
The IDocument interface provides access to components associated with an editor document.
Properties
- EditorView CurrentEditorView - Gets the current EditorView in focus.
- bool EnableLocks - Gets and sets whether locks are enabled in the current document .
- ISelection Selection - Gets the ISelection of the currently selected text.
- bool ShowChanges - Gets and sets whether changes are shown in the current document.
- bool ShowLocks - Gets and sets whether locks are shown in the current document.
Events
- CheckingIn - Occurs when the editor document checks in to source control.
- Closing - Occurs when the editor document is closing.
- CurrentEditorViewChanged - Occurs when the editor view switches focus.
- EnableLocksChanged - Occurs when the editor document EnableLocks property changes.
- KeyDown - Occurs when a key is pressed down while the editor document has focus.
- KeyUp - Occurs when a key is released while the editor document has focus.
- MouseClick - Occurs when the editor document is clicked by the mouse.
- MouseDoubleClick - Occurs when the editor document is double-clicked by the mouse.
- MouseHover - Occurs when the editor document is hovered over by the mouse.
- MouseMove - Occurs when the mouse moves over the editor document.
- OnContentChanged - Occurs when content is changed in the editor document.
- PreviewKeyDown - Occurs before the KeyDown event when a key is pressed while the document has focus.
- Printing - Occurs when the Print or Print Preview command is invoked before the document prints.
- Saved - Occurs when the editor document saves.
- SavedAs - Occurs when the editor document runs the "Save As" command..
- Saving - Occurs before the editor document saves.
- SavingsAs - Occurs before the editor document runs the "Save As" command .
- ShowChangesChanged - Occurs when the editor document ShowChanges property changes.
- ShowLocksChanged - Occurs when the editor document ShowLocks property changes.
Methods
- bool ApplyStylesheet(string) - Adds the referenced CSS stylesheet to the working list of styles. Paths may be absolute or relative.
- void Close() - Closes the document.
- void EndOperation() - Ends the current operation.
- int GetCursorPosition() - Returns the linear position of the insertion point. The intial position starts from 0.
- string GetDocumentText() - Returns the document text.
- string GetDocumentXml() - Returns the xml of the document as text.
- string GetSourceUrl() - Returns the url of the editor document.
- List<ToolStripItem> GetUserPendingContextMenuItems() - Returns the list of System.Windows.Forms.ToolStripItem(s) that are pending to be added to the context menu.
- XmlDocument GetXmlDocument() - Returns the System.Xml.XmlDocument of the document.
- void InsertDocumentNode(XmlNode, XmlNode, int, bool) - Inserts a new System.Xml.XmlNode as a child under the referenced parent node in the DOM. The last boolean parameter determines whether this operation will be reflected in the Flare Track Change system.
- void LookupVariableValue(string, string) - Returns the value of the given variable set and name.
- void RemoveDocumentNode(XmlNode, bool) - Removes an existing System.Xml.XmlNode from the DOM. The last boolean parameter determines whether this operation will be reflected in the Flare Track Change system.
- bool RemoveStylesheet(string) - Removes the referenced CSS stylesheet to the working list of styles. Paths may be absolute or relative.
- void ReplaceDocumentNode(XmlNode, XmlNode, bool) - Replaces an existing System.Xml.XmlNode with a new node in the DOM. The last boolean parameter determines whether this operation will be reflected in the Flare Track Change system.
- bool Save() - Saves the current document. Returns bool indicating success of operation.
- void Select(string) - Selects the first instance of text matching the search string after the current position of the insertion point.
- void Select(XmlNode) - Selects the matching System.Xml.XmlNode.
- void SetCursorPosition(int) - Sets the position of the insertion point to the specified value.
- void StartOperation(string) - Starts a new operation. All changes within a StartOperation and EndOperation call will be bundled into one undoable operation in Flare's undo/redo stack.
- void UpdateView() - Refreshes the document.