C# Class Nexus.UI.Controls.XmlEditor

An XML text editor.
This editor provides highlighting, code copmletion, autoindenting, and code folding.
Inheritance: ICSharpCode.TextEditor.TextEditorControl
Afficher le fichier Open project: NexusMods/NexusModManager-4.5 Class Usage Examples

Méthodes publiques

Méthode 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.

Méthodes protégées

Méthode 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

Méthode 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 méthode

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.
Résultat void

HighlightMalformedTag() protected méthode

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.
Résultat void

OnTextChanged() protected méthode

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.
Résultat void

ShowCodeCompletionWindow() public méthode

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.
Résultat void

ValidateOnTimer() public méthode

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.
Résultat void

ValidateXml() public méthode

Validates the XML against the schema.
public ValidateXml ( ) : bool
Résultat bool

XmlEditor() public méthode

The default constructor.
public XmlEditor ( ) : System
Résultat System

m_cdpXmlCompletionProvider_GotAutoCompleteList() public méthode

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.
Résultat void