Archive Browser
Download DigitalRuneTextEditorCssHighlighting.zip, last updated 08/07/2011 (9.66 KB)
Download- md5: 4ef11a50a0bd719feec13b1ae50681d2
using System;
using System.IO;
using System.Windows.Forms;
using DigitalRune.Windows.TextEditor.Highlighting;
using DigitalRune.Windows.TextEditor.Properties;
// CSS Syntax Highlighting in the DigitalRune Text Editor Control
// http://cyotek.com/blog/css-syntax-highlighting-in-the-digitalrune-text-editor-control
namespace DigitalRuneTextEditorCssHighlighting
{
public partial class MainForm : Form
{
#region Public Constructors
public MainForm()
{
InitializeComponent();
}
#endregion Public Constructors
#region Event Handlers
private void exitToolStripMenuItem_Click(object sender, EventArgs e)
{
this.Close();
}
private void MainForm_Load(object sender, EventArgs e)
{
string definitionsFolder;
// load in the custom definitions
definitionsFolder = Path.Combine(AppDomain.CurrentDomain.BaseDirectory, "definitions");
HighlightingManager.Manager.AddSyntaxModeFileProvider(new FileSyntaxModeProvider(definitionsFolder));
// setup the text editor control
textEditorControl.Document.HighlightingStrategy = HighlightingManager.Manager.FindHighlighter("CSS");
textEditorControl.ShowSpaces = true;
textEditorControl.ShowTabs = true;
textEditorControl.ShowMatchingBracket = true;
textEditorControl.LineViewerStyle = LineViewerStyle.FullRow;
textEditorControl.ShowHRuler = true;
}
private void openToolStripMenuItem_Click(object sender, EventArgs e)
{
if (openFileDialog.ShowDialog(this) == System.Windows.Forms.DialogResult.OK)
textEditorControl.LoadFile(openFileDialog.FileName);
}
#endregion Event Handlers
}
}
Donate
This software may be used free of charge, but as with all free software there are costs involved to develop and maintain.
If this site or its services have saved you time, please consider a donation to help with running costs and timely updates.
Donate