4using System.Globalization;
48 StringBuilder sb =
new();
50 foreach (
string Row
in Rows)
53 XmlDocument Doc =
new()
55 PreserveWhitespace =
true
57 Doc.LoadXml(sb.ToString());
67 Output.WriteStartElement(
"Label");
68 Output.WriteAttributeString(
"Text", ex.Message);
69 Output.WriteAttributeString(
"FontFamily",
"Courier New");
70 Output.WriteAttributeString(
"TextColor",
"Red");
71 Output.WriteAttributeString(
"LineBreakMode",
"WordWrap");
72 Output.WriteEndElement();
77 Output.WriteStartElement(
"VerticalStackLayout");
78 Output.WriteAttributeString(
"HorizontalOptions",
"Center");
80 bool ImageShown =
false;
84 (
string? FileName,
int Width,
int Height) = await PhotosLoader.LoadPhotoAsTemporaryFile(
Contract.
Attachments,
87 if (!
string.IsNullOrEmpty(FileName))
89 Output.WriteStartElement(
"Image");
90 Output.WriteAttributeString(
"Source", FileName);
91 Output.WriteAttributeString(
"WidthRequest", Width.ToString(CultureInfo.InvariantCulture));
92 Output.WriteAttributeString(
"HeightRequest", Height.ToString(CultureInfo.InvariantCulture));
93 Output.WriteEndElement();
101 Output.WriteStartElement(
"Path");
102 Output.WriteAttributeString(
"VerticalOptions",
"Center");
103 Output.WriteAttributeString(
"HorizontalOptions",
"Center");
104 Output.WriteAttributeString(
"HeightRequest",
"16");
105 Output.WriteAttributeString(
"WidthRequest",
"16");
106 Output.WriteAttributeString(
"Aspect",
"Uniform");
107 Output.WriteAttributeString(
"Fill",
"{AppThemeBinding Light={StaticResource PrimaryForegroundLight}, Dark={StaticResource PrimaryForegroundDark}}");
108 Output.WriteAttributeString(
"Data",
"{x:Static ui:Geometries.ContractPath}");
109 Output.WriteEndElement();
114 Output.WriteStartElement(
"Label");
115 Output.WriteAttributeString(
"LineBreakMode",
"WordWrap");
116 Output.WriteAttributeString(
"FontSize",
"Medium");
117 Output.WriteAttributeString(
"HorizontalOptions",
"Center");
118 Output.WriteAttributeString(
"Text", FriendlyName);
119 Output.WriteEndElement();
121 Output.WriteStartElement(
"VerticalStackLayout.GestureRecognizers");
123 StringBuilder Xml =
new();
126 Output.WriteStartElement(
"TapGestureRecognizer");
127 Output.WriteAttributeString(
"Command",
"{Binding Path=IotScUriClicked}");
129 Output.WriteEndElement();
131 Output.WriteEndElement();
132 Output.WriteEndElement();
const int DefaultImageHeight
The default height to use when generating QR Code images.
const int DefaultImageWidth
The default width to use when generating QR Code images.
const string IotSc
The IoT Smart Contract URI Scheme (iotsc)
A set of never changing property constants and helpful values.
Base class that references services in the app.
static IXmppService XmppService
The XMPP service for XMPP communication.
The data model for a contract.
static async Task< string?> GetCategory(Contract Contract)
Gets the category of a contract
Handles embedded Smart Contracts.
async Task< bool > RenderMauiXaml(MauiXamlRenderer Renderer, string[] Rows, string Language, int Indent, MarkdownDocument Document)
Generates Maui XAML
MarkdownDocument? Document
Markdown document.
IoTScCodeBlock()
Handles embedded Smart Contracts.
void Register(MarkdownDocument Document)
Registers the Markdown document in which the construct resides.
bool EvaluatesScript
If script is evaluated for this type of code block.
Grade Supports(string Language)
How much the module supports code of a given language (i.e. type of content)
Renders XAML (Maui flavour) from a Markdown document.
readonly XmlWriter XmlOutput
XML output
Contains a markdown document. This markdown document class supports original markdown,...
Contains the definition of a contract
static Task< ParsedContract > Parse(XmlDocument Xml)
Validates a contract XML Document, and returns the contract definition in it.
Attachment[] Attachments
Attachments assigned to the legal identity.
void Serialize(StringBuilder Xml, bool IncludeNamespace, bool IncludeIdAttribute, bool IncludeClientSignatures, bool IncludeAttachments, bool IncludeStatus, bool IncludeServerSignature, bool IncludeAttachmentReferences)
Serializes the Contract, in normalized form.
Contains information about a parsed contract.
Contract Contract
Contract object
Interface for code content Maui XAML renderers.
Interface for all markdown handlers of code content.