Skip to content

Instantly share code, notes, and snippets.

@bjoerntx
Created February 9, 2024 12:16
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save bjoerntx/e9a987274d5c6769da3ee254edadc166 to your computer and use it in GitHub Desktop.
Save bjoerntx/e9a987274d5c6769da3ee254edadc166 to your computer and use it in GitHub Desktop.
// create a new SubTextPart with the name "part1" and id 1
TXTextControl.SubTextPart subTextPart = new TXTextControl.SubTextPart("part1", 1);
// create a new UserInfo object
UserInfo userInfo = new UserInfo()
{
Name = "John Doe",
Address = "123 Main Street",
City = "Dallas",
State = "TX",
Zip = "75201",
Phone = "214-555-1212"
};
// serialize the UserInfo object to a JSON string
subTextPart.Data = JsonSerializer.Serialize(userInfo);
// add the subtext part to the SubTextParts collection
textControl1.SubTextParts.Add(subTextPart);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment