Created
January 2, 2024 13:35
-
-
Save bjoerntx/85f683c0c14422cf673292a6aab7bb4a to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
namespace MyClassLibrary | |
{ | |
public static class Class1 | |
{ | |
static Class1() | |
{ | |
TXTextControl.ServerTextControl.EntryAssembly = | |
typeof(Class1).Assembly; | |
} | |
public static string GetHtml() | |
{ | |
using (TXTextControl.ServerTextControl tx = | |
new TXTextControl.ServerTextControl()) | |
{ | |
tx.Create(); | |
TXTextControl.Selection selection = | |
new TXTextControl.Selection(); | |
selection.Text = "Hello, World!"; | |
selection.Start = 0; | |
selection.Length = 5; | |
selection.Bold = true; | |
tx.Selection = selection; | |
var html = ""; | |
tx.Save(out html, TXTextControl.StringStreamType.HTMLFormat); | |
return html; | |
} | |
} | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment