2using System.Collections.Generic;
3using System.Threading.Tasks;
19 private Dictionary<string, IElement> currentCollection =
null;
20 private Dictionary<string, IElement> currentBlock =
null;
21 private Dictionary<string, IElement> currentEntry =
null;
22 private Dictionary<string, IElement> propertiesInEvent =
null;
38 get => this.variables;
39 internal set => this.variables = value;
48 return Task.FromResult(
true);
57 return Task.FromResult(
true);
67 this.currentCollection =
new Dictionary<string, IElement>()
72 return Task.FromResult(
true);
81 return Task.FromResult(
true);
91 this.currentBlock =
new Dictionary<string, IElement>()
96 return Task.FromResult(
true);
108 return Task.FromResult(
true);
117 return Task.FromResult(
true);
130 this.propertiesInEvent =
new Dictionary<string, IElement>();
131 this.currentEntry =
new Dictionary<string, IElement>()
137 {
"this",
new ObjectValue(this.propertiesInEvent) }
140 return Task.FromResult(
true);
152 return Task.FromResult(
true);
161 Dictionary<string, IElement> Data =
new Dictionary<string, IElement>();
163 foreach (KeyValuePair<string, IElement> P
in this.currentCollection)
164 Data[P.Key] = P.Value;
166 foreach (KeyValuePair<string, IElement> P
in this.currentBlock)
167 Data[P.Key] = P.Value;
169 foreach (KeyValuePair<string, IElement> P
in this.currentEntry)
170 Data[P.Key] = P.Value;
172 foreach (KeyValuePair<string, IElement> P
in this.propertiesInEvent)
173 Data[P.Key] = P.Value;
179 if (this.lambda.IsAsynchronous)
180 await this.lambda.EvaluateAsync(this.arguments, this.variables);
182 this.lambda.Evaluate(this.arguments, this.variables);
199 return Task.FromResult(
true);
209 return Task.FromResult(
true);
219 return Task.FromResult(
true);
Class managing a script expression.
static IElement Encapsulate(object Value)
Encapsulates an object.
Export is serialized into calls to a lambda expression having one argument.
Task< bool > ReportProperty(string PropertyName, object PropertyValue)
Is called when a property is reported.
async Task< bool > EndEntry()
Is called when an entry is finished.
Task< bool > StartBlock(string BlockID)
Is called when a block in a collection is started.
Task< bool > CollectionCleared(DateTimeOffset EntryTimestamp)
Is called when the collection has been cleared.
Task< bool > StartLedger()
Is called when export of ledger is started.
Task< bool > StartEntry(string ObjectId, string TypeName, EntryType EntryType, DateTimeOffset EntryTimestamp)
Is called when an entry is started.
Task< bool > EndLedger()
Is called when export of ledger is finished.
Task< bool > EndCollection()
Is called when a collection is finished.
Task< bool > ReportException(Exception Exception)
Is called when an exception has occurred.
Task< bool > StartCollection(string CollectionName)
Is called when a collection is started.
Task< bool > ReportError(string Message)
Is called when an error is reported.
ExportToLambda(ILambdaExpression Lambda)
Export is serialized into calls to a lambda expression having one argument.
Task< bool > EndBlock()
Is called when a block in a collection is finished.
Task< bool > BlockMetaData(string Key, object Value)
Reports block meta-data.
Interface for ledger exports.
Basic interface for all types of elements.
Base interface for lambda expressions.
EntryType
Ledger entry type.