Table of Contents

Class XmlParserEmbedded

Namespace
Alternet.Syntax.Parsers.Lsp.Xml.Embedded
Assembly
Alternet.Syntax.Parsers.Xml.Embedded.v9.dll

Represents a class that performs syntax and lexical analysis of specified Xml code text.

[ToolboxBitmap(typeof(XmlParserEmbedded), "Images.XmlParserEmbedded.Icon.bmp")]
public class XmlParserEmbedded : XmlParser, IComponent, IDisposable, ISyntaxParser, IParser, ILexer, INotify, IUpdate, IImport, ILspDocumentProvider
Inheritance
XmlParserEmbedded
Implements

Examples

Here is how to declare a XmlParserEmbedded and assign it to the edit control the from C# code:

public partial class Form1 : Form
{
    public Form1()
    {
        InitializeComponent();
    }

    private void Form1_Load(object sender, EventArgs e)
    {
        var parser = new Alternet.Syntax.Parsers.Lsp.Xml.Embedded.XmlParserEmbedded();
        var edit = new Alternet.Editor.SyntaxEdit();
        edit.Parent = this;
        edit.Lexer = parser;

        string fileName = "myfile.xml";
        if (System.IO.File.Exists(fileName))
        {
            parser.FileName = fileName;
            edit.LoadFile(fileName);
        }
    }
}

Here is how to declare a XmlParserEmbedded and assign it to the edit control the from Visual Basic code:

Partial Public Class Form1
    Inherits Form

    Public Sub New()
        InitializeComponent()
    End Sub

    Private Sub Form1_Load(ByVal sender As Object, ByVal e As EventArgs)
        Dim parser = New Alternet.Syntax.Parsers.Lsp.Xml.Embedded.XmlParserEmbedded()
        Dim edit = New Alternet.Editor.SyntaxEdit()
        edit.Parent = Me
        edit.Lexer = parser
        Dim fileName As String = "myfile.xml"

        If System.IO.File.Exists(fileName) Then
            parser.FileName = fileName
            edit.LoadFile(fileName)
        End If
    End Sub
End Class

Remarks

XmlParserEmbedded is a non-visual component designed to perform syntax highlighting for XML language.� This LangServer-based parser includes all required payloads (such as XML Language Server) in the form of embedded resources to provide features like full syntax and analysis of the XML code. When linked to the SyntaxEdit or TextEditor controls, this parser drives additional features such as code completion, code outlining, and underlying syntax errors and warnings.

Here are some of the essential features provided by the Embedded XmlParser:

  • Syntax Highlighting
  • IntelliSense (Code completion)
  • Code Outlining

Constructors

XmlParserEmbedded()

Initializes a new instance of the XmlParserEmbedded class with default settings.

XmlParserEmbedded(IContainer)

Initializes a new instance of the XmlParserEmbedded class with specified container.

Methods

CreateWorkspace()
DeployServer(IProgress<double>, string)
IsServerDeployed(string)