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;
49 return Task.FromResult(
true);
58 return Task.FromResult(
true);
68 this.currentCollection =
new Dictionary<string, IElement>()
73 return Task.FromResult(
true);
82 return Task.FromResult(
true);
92 this.currentBlock =
new Dictionary<string, IElement>()
97 return Task.FromResult(
true);
109 return Task.FromResult(
true);
118 return Task.FromResult(
true);
131 this.propertiesInEvent =
new Dictionary<string, IElement>();
132 this.currentEntry =
new Dictionary<string, IElement>()
138 {
"this",
new ObjectValue(this.propertiesInEvent) }
141 return Task.FromResult(
true);
153 return Task.FromResult(
true);
162 Dictionary<string, IElement> Data =
new Dictionary<string, IElement>();
164 foreach (KeyValuePair<string, IElement> P
in this.currentCollection)
165 Data[P.Key] = P.Value;
167 foreach (KeyValuePair<string, IElement> P
in this.currentBlock)
168 Data[P.Key] = P.Value;
170 foreach (KeyValuePair<string, IElement> P
in this.currentEntry)
171 Data[P.Key] = P.Value;
173 foreach (KeyValuePair<string, IElement> P
in this.propertiesInEvent)
174 Data[P.Key] = P.Value;
180 if (this.lambda.IsAsynchronous)
181 await this.lambda.EvaluateAsync(this.arguments, this.variables);
183 this.lambda.Evaluate(this.arguments, this.variables);
200 return Task.FromResult(
true);
210 return Task.FromResult(
true);
220 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 > 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 > StartLedger(ILedgerProvider Provider)
Is called when export of ledger is started.
Task< bool > BlockMetaData(string Key, object Value)
Reports block meta-data.
Interface for ledger providers that can be plugged into the static Ledger class.
Interface for ledger exports.
Basic interface for all types of elements.
Base interface for lambda expressions.
EntryType
Ledger entry type.