Please refer to the following example that demonstrates how you can use the commands in RadSyntaxEditor. You should just choose the desired command through the Commands property of the control, then call the Execute method.
The following example demonstrates how to select and delete the occurrence of the "Telerik" word from the loaded text in the code-behind together with undo and redo buttons:
publicRadForm1()
{
InitializeComponent();
using (StreamReader reader = new StreamReader("../../CS_File.txt"))
{
this.radSyntaxEditor1.Document = new TextDocument(reader);
}
var xmlTragger = new XmlTagger(this.radSyntaxEditor1.SyntaxEditorElement);
this.radSyntaxEditor1.TaggersRegistry.RegisterTagger(xmlTragger);
var xmlFolding = new XmlFoldingTagger(this.radSyntaxEditor1.SyntaxEditorElement);
this.radSyntaxEditor1.TaggersRegistry.RegisterTagger(xmlFolding);
}
privatevoidradButton1_Click(object sender, EventArgs e)
{
this.radSyntaxEditor1.Commands.NavigateNextMatchCommand.Execute("Telerik");
this.radSyntaxEditor1.Commands.DeleteCommand.Execute(null);
}
privatevoidradButton2_Click(object sender, EventArgs e)
{
this.radSyntaxEditor1.Commands.UndoCommand.Execute(null);
}
privatevoidradButton3_Click(object sender, EventArgs e)
{
this.radSyntaxEditor1.Commands.RedoCommand.Execute(null);
}
I hope this helps. Let me know if you have further questions.