2using System.Collections.Generic;
3using System.Threading.Tasks;
17 private readonly List<IElement> collections =
new List<IElement>();
18 private readonly List<IElement> blocksInCollection =
new List<IElement>();
19 private readonly List<IElement> eventsInBlock =
new List<IElement>();
20 private Dictionary<string, IElement> currentCollection =
null;
21 private Dictionary<string, IElement> currentBlock =
null;
22 private Dictionary<string, IElement> currentEntry =
null;
23 private Dictionary<string, IElement> propertiesInEvent =
null;
47 return Task.FromResult(
true);
56 return Task.FromResult(
true);
66 this.currentCollection =
new Dictionary<string, IElement>()
71 this.blocksInCollection.Clear();
73 return Task.FromResult(
true);
82 if (this.blocksInCollection.Count > 0)
84 this.currentCollection[
"Blocks"] =
new ObjectVector(this.blocksInCollection.ToArray());
85 this.collections.Add(
new ObjectValue(this.currentCollection));
88 return Task.FromResult(
true);
98 this.currentBlock =
new Dictionary<string, IElement>()
103 this.eventsInBlock.Clear();
105 return Task.FromResult(
true);
117 return Task.FromResult(
true);
126 if (this.eventsInBlock.Count > 0)
128 this.currentBlock[
"Events"] =
new ObjectVector(this.eventsInBlock.ToArray());
129 this.blocksInCollection.Add(
new ObjectValue(this.currentBlock));
132 return Task.FromResult(
true);
145 this.propertiesInEvent =
new Dictionary<string, IElement>();
146 this.currentEntry =
new Dictionary<string, IElement>()
152 {
"this",
new ObjectValue(this.propertiesInEvent) }
155 return Task.FromResult(
true);
167 return Task.FromResult(
true);
176 this.eventsInBlock.Add(
new ObjectValue(this.currentEntry));
177 return Task.FromResult(
true);
187 return Task.FromResult(
true);
197 return Task.FromResult(
true);
207 return Task.FromResult(
true);
Class managing a script expression.
static IElement Encapsulate(object Value)
Encapsulates an object.
Export is serialized into object form.
Task< bool > StartLedger()
Is called when export of ledger is started.
Task< bool > ReportProperty(string PropertyName, object PropertyValue)
Is called when a property is reported.
Task< bool > EndCollection()
Is called when a collection is finished.
Task< bool > CollectionCleared(DateTimeOffset EntryTimestamp)
Is called when the collection has been cleared.
Task< bool > ReportError(string Message)
Is called when an error is reported.
ExportToJson()
Export is serialized into object form.
Task< bool > EndBlock()
Is called when a block in a collection is finished.
Task< bool > EndEntry()
Is called when an entry is finished.
Task< bool > ReportException(Exception Exception)
Is called when an exception has occurred.
Task< bool > BlockMetaData(string Key, object Value)
Reports block meta-data.
Task< bool > StartBlock(string BlockID)
Is called when a block in a collection is started.
IVector ToVector()
Returns an array of exported objects.
Task< bool > EndLedger()
Is called when export of ledger is finished.
Task< bool > StartCollection(string CollectionName)
Is called when a collection is started.
Task< bool > StartEntry(string ObjectId, string TypeName, EntryType EntryType, DateTimeOffset EntryTimestamp)
Is called when an entry is started.
Interface for ledger exports.
Basic interface for vectors.
EntryType
Ledger entry type.