Table of Contents

Property Strings

Namespace
Alternet.Syntax.Parsers.Roslyn
Assembly
Alternet.Syntax.Parsers.Roslyn.v9.dll

Strings

Gets or sets a list of strings to parse.

public override IStringList Strings { get; set; }

Property Value

IStringList

Examples

Here is how to use a Strings in the C# code:

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

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

        parser.Strings = new Alternet.Syntax.StringList();
        parser.Strings.Clear();
        for (int i = 0; i < 100; i++)
        {
            parser.Strings.Add(string.Format("Line No: {0}", i));
        }
    }
}

Here is how to use a Strings in the Visual Basic code:

Imports System

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.Roslyn.CsParser()
        Dim edit = New Alternet.Editor.SyntaxEdit()
        edit.Parent = Me
        edit.Lexer = parser
        parser.Strings = New Alternet.Syntax.StringList()
        parser.Strings.Clear()

        For i As Integer = 0 To 100 - 1
            parser.Strings.Add(String.Format("Line No: {0}", i))
        Next
    End Sub
End Class

Remarks

Each item in the list represents a text line parsed by the RoslynParser component.

This collection is altered as the user types the text in the SyntaxEdit control, to which this parser is associated.