public MiniMarkupBase ToMarkup() { int w1 = 30; var ts = Timestamp.ToUniversalTime().ToString("yyyy'-'MM'-'dd'T'HH':'mm':'ss'.'fff'Z'"); var res = new MiniMarkupSequence( new MiniMarkupLine(new MiniMarkupRun( $"AAS event message @ {ts}", fontSize: 16.0f)), new MiniMarkupLine( new MiniMarkupRun("Source:", isMonospaced: true, padsize: w1), new MiniMarkupRun(Source?.ToString())), new MiniMarkupLine( new MiniMarkupRun("SourceSemantic:", isMonospaced: true, padsize: w1), new MiniMarkupRun(SourceSemanticId?.ToString())), new MiniMarkupLine( new MiniMarkupRun("ObservableReference:", isMonospaced: true, padsize: w1), new MiniMarkupRun(ObservableReference?.ToString())), new MiniMarkupLine( new MiniMarkupRun("ObservableSemanticId:", isMonospaced: true, padsize: w1), new MiniMarkupRun(ObservableSemanticId?.ToString())), new MiniMarkupLine( new MiniMarkupRun("Topic:", isMonospaced: true, padsize: w1), new MiniMarkupRun(Topic)), new MiniMarkupLine( new MiniMarkupRun("Subject:", isMonospaced: true, padsize: w1), new MiniMarkupRun(Subject)) ); var sum = new List <MiniMarkupBase>(); if (PayloadItems != null) { foreach (var pl in PayloadItems) { sum.Add(pl.ToMarkup()); } } if (PayloadsRaw != null) { sum.Add( new MiniMarkupLine( new MiniMarkupRun("Payload:", isMonospaced: true, padsize: w1), new MiniMarkupRun("Raw event data present "), new MiniMarkupLink("[>>]", "http://127.0.0.1/", this))); } res.Children.AddRange(sum); return(res); }
// // Serialisation // public override string ToString() { var res = $"{this.GetType()}: " + $"{"" + Timestamp.ToString(CultureInfo.InvariantCulture)} @ " + $"Source={"" + Source?.ToString()}, " + $"SourceSemanticId={"" + SourceSemanticId?.ToString()}, " + $"ObservableReference={"" + ObservableReference?.ToString()}, " + $"ObservableSemanticId={"" + ObservableSemanticId?.ToString()}, " + $"Topic=\"{"" + Topic}\", " + $"Subject=\"{"" + Subject}\", "; if (Payloads != null) { foreach (var pl in Payloads) { res += pl.ToString(); } } return(res); }