C# Class Nexus.UI.Controls.XmlEditor

An XML text editor.
This editor provides highlighting, code copmletion, autoindenting, and code folding.
Inheritance: ICSharpCode.TextEditor.TextEditorControl
ファイルを表示 Open project: NexusMods/NexusModManager-4.5 Class Usage Examples

Public Methods

Method Description
ShowCodeCompletionWindow ( char p_chrChar ) : void

Displays the code completion window.

ValidateOnTimer ( object sender, EventArgs e ) : void

Validates the XML against the schema, after a given period has elapsed.

This method is called by a timer after a set span after the text in the editor was last changed.

ValidateXml ( ) : bool

Validates the XML against the schema.

XmlEditor ( ) : System

The default constructor.

m_cdpXmlCompletionProvider_GotAutoCompleteList ( object sender, AutoCompleteListEventArgs e ) : void

Handles the XmlCompletionProvider.GotAutoCompleteList event of the completion provider.

This raises the editor's GotAutoCompleteList event.

Protected Methods

Method Description
Dispose ( bool disposing ) : void

Disposes of resources used by the editor.

This makes sure that the code completion windows is closed.

HighlightMalformedTag ( IDocument p_docDocument, string p_strTagName, TextLocation p_tlcStart, TextLocation p_tlcEnd ) : void

Highlights any malformed XML tags that are found.

OnTextChanged ( EventArgs e ) : void

Starts the timers to update the code folds and validate the XML.

Private Methods

Method Description
DisposeCodeCompletionWindow ( object sender, EventArgs e ) : void

Disposes of the code completion window when it closes.

HighlightValidationErrors ( object sender, ValidationEventArgs e ) : void

Highlights any XML validation errors that are found.

HighlightValidationErrors ( string p_strMessage, TextLocation p_tlcStart ) : void

Highlights any XML validation errors that are found.

TextArea_KeyEventHandler ( char p_chrChar ) : bool

Called whenever a character is about to be added to the document.

UpdateFolds ( object sender, EventArgs e ) : void

Updates the code folds.

This method is called by a timer after a set span after the text in the editor was last changed.

Method Details

Dispose() protected method

Disposes of resources used by the editor.
This makes sure that the code completion windows is closed.
protected Dispose ( bool disposing ) : void
disposing bool Whether or not the object is being disposed.
return void

HighlightMalformedTag() protected method

Highlights any malformed XML tags that are found.
protected HighlightMalformedTag ( IDocument p_docDocument, string p_strTagName, TextLocation p_tlcStart, TextLocation p_tlcEnd ) : void
p_docDocument IDocument The document being validated.
p_strTagName string The name of the malformed tag.
p_tlcStart TextLocation The start of the malformed tag.
p_tlcEnd TextLocation The end of the malformed tag.
return void

OnTextChanged() protected method

Starts the timers to update the code folds and validate the XML.
protected OnTextChanged ( EventArgs e ) : void
e System.EventArgs An describing the event arguments.
return void

ShowCodeCompletionWindow() public method

Displays the code completion window.
public ShowCodeCompletionWindow ( char p_chrChar ) : void
p_chrChar char The character that was typed that caused the code window to display.
return void

ValidateOnTimer() public method

Validates the XML against the schema, after a given period has elapsed.
This method is called by a timer after a set span after the text in the editor was last changed.
public ValidateOnTimer ( object sender, EventArgs e ) : void
sender object The object that triggered the event.
e System.EventArgs An describing the event arguments.
return void

ValidateXml() public method

Validates the XML against the schema.
public ValidateXml ( ) : bool
return bool

XmlEditor() public method

The default constructor.
public XmlEditor ( ) : System
return System

m_cdpXmlCompletionProvider_GotAutoCompleteList() public method

Handles the XmlCompletionProvider.GotAutoCompleteList event of the completion provider.
This raises the editor's GotAutoCompleteList event.
public m_cdpXmlCompletionProvider_GotAutoCompleteList ( object sender, AutoCompleteListEventArgs e ) : void
sender object The object that raised the event.
e AutoCompleteListEventArgs An describing the event arguments.
return void