This repository has been archived on 2026-05-22. You can view files and clone it, but cannot push or open issues or pull requests.
Files
Befunge.Net/Befunge/Editor/Utils/Extensions.cs

15 lines
526 B
C#

using System.Windows.Controls;
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?.StylizedString(text) ?? new[] {new Run(text)});
}
}