Basic Syntax highlighting, added CodeTextBox to MainWindow to test it.
This commit is contained in:
14
Befunge/Editor/Utils/Extensions.cs
Normal file
14
Befunge/Editor/Utils/Extensions.cs
Normal file
@@ -0,0 +1,14 @@
|
||||
using System.Windows.Documents;
|
||||
using Befunge.Editor.CharStyles;
|
||||
|
||||
namespace Befunge.Editor.Utils
|
||||
{
|
||||
internal static class Extensions
|
||||
{
|
||||
public static void AppendStylizedText(this Paragraph p, ITextStyler styler, char text)
|
||||
=> AppendStylizedText(p, styler, text.ToString());
|
||||
|
||||
public static void AppendStylizedText(this Paragraph p, ITextStyler styler, string text)
|
||||
=> p.Inlines.AddRange(styler?.StyledString(text) ?? new[] {new Run(text)});
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user