Neuron®
The Neuron® is the basis for the creation of open and secure federated networks for smart societies.
Loading...
Searching...
No Matches
ReportObject.cs
1using System;
2using System.Threading.Tasks;
3using System.Xml;
4using Waher.Content;
6
8{
13 {
14 private readonly object @object;
15 private readonly byte[] binary;
16 private readonly string contentType;
17
24 public ReportObject(object Object, byte[] Binary, string ContentType)
25 {
26 this.@object = Object;
27 this.binary = Binary;
28 this.contentType = ContentType;
29 }
30
35 public static async Task<ReportObject> CreateAsync(XmlElement Xml)
36 {
37 byte[] Binary = Convert.FromBase64String(Xml.InnerText);
38 string ContentType = XML.Attribute(Xml, "contentType");
40
42 }
43
47 public object Object => this.@object;
48
52 public byte[] Binary => this.binary;
53
57 public string ContentType => this.contentType;
58
63 public override void ExportXml(XmlWriter Output)
64 {
65 Output.WriteStartElement("Object");
66 Output.WriteAttributeString("contentType", this.contentType);
67 Output.WriteValue(Convert.ToBase64String(this.binary));
68 Output.WriteEndElement();
69 }
70 }
71}
Abstract base class for report elements.
Contains information about a report object.
Definition: ReportObject.cs:13
static async Task< ReportObject > CreateAsync(XmlElement Xml)
Contains information about a report object.
Definition: ReportObject.cs:35
override void ExportXml(XmlWriter Output)
Exports element to XML
Definition: ReportObject.cs:63
ReportObject(object Object, byte[] Binary, string ContentType)
Contains information about a report object.
Definition: ReportObject.cs:24
Static class managing encoding and decoding of internet content.
static Task< object > DecodeAsync(string ContentType, byte[] Data, Encoding Encoding, KeyValuePair< string, string >[] Fields, Uri BaseUri)
Decodes an object.
Helps with common XML-related tasks.
Definition: XML.cs:19
static string Attribute(XmlElement E, string Name)
Gets the value of an XML attribute.
Definition: XML.cs:914