3using System.Threading.Tasks;
24 private readonly Dictionary<string, int> headerOrder =
new Dictionary<string, int>();
41 get => this.variables;
42 internal set => this.variables = value;
53 foreach (
IElement[] Row
in this.rows)
58 int Padding = this.width - Row.Length;
67 return new ObjectMatrix(this.height, this.width, Elements)
69 ColumnNames = this.headers.ToArray()
84 this.headerOrder.Clear();
87 return Task.FromResult(
true);
96 return Task.FromResult(
true);
106 this.collectionProperties.Clear();
107 this.collectionProperties.Add(
new KeyValuePair<string, IElement>(
"Collection",
new StringValue(CollectionName)));
109 return Task.FromResult(
true);
118 return Task.FromResult(
true);
128 this.blockProperties.
Clear();
129 this.blockProperties.
Add(
new KeyValuePair<string, IElement>(
"BlockId",
new StringValue(BlockID)));
131 return Task.FromResult(
true);
143 return Task.FromResult(
true);
152 return Task.FromResult(
true);
165 this.entryProperties.
Clear();
166 this.entryProperties.
Add(
new KeyValuePair<string, IElement>(
"ObjectId",
new StringValue(ObjectId)));
167 this.entryProperties.
Add(
new KeyValuePair<string, IElement>(
"TypeName",
new StringValue(TypeName)));
169 this.entryProperties.
Add(
new KeyValuePair<string, IElement>(
"Timestamp",
new ObjectValue(EntryTimestamp)));
171 return Task.FromResult(
true);
183 return Task.FromResult(
true);
192 if (this.variables is
null)
193 return Task.FromResult(
false);
195 this.currentRow.Clear();
197 foreach (KeyValuePair<string, IElement> P
in this.collectionProperties)
198 this.AddPropertyToRow(P.Key, P.Value);
200 foreach (KeyValuePair<string, IElement> P
in this.blockProperties)
201 this.AddPropertyToRow(P.Key, P.Value);
203 foreach (KeyValuePair<string, IElement> P
in this.entryProperties)
204 this.AddPropertyToRow(P.Key, P.Value);
206 this.rows.
Add(this.currentRow.ToArray());
209 int c = this.currentRow.Count;
213 return Task.FromResult(
true);
216 private void AddPropertyToRow(
string Name,
IElement Value)
218 if (!this.headerOrder.TryGetValue(Name, out
int i))
220 i = this.headers.Count;
221 this.headerOrder[Name] = i;
222 this.headers.Add(Name);
225 int c = this.currentRow.Count;
231 this.currentRow.Add(
null);
235 this.currentRow.Add(Value);
238 this.currentRow[i] = Value;
248 return Task.FromResult(
true);
258 return Task.FromResult(
true);
268 return Task.FromResult(
true);
A chunked list is a linked list of chunks of objects of type T .
void Clear()
Clears the collection.
void Add(T Item)
Adds an item to the collection.
Class managing a script expression.
static IElement Encapsulate(object Value)
Encapsulates an object.
static readonly ObjectValue Null
Null value.
Export is serialized into table form, with an undefined number of columns.
Task< bool > ReportProperty(string PropertyName, object PropertyValue)
Is called when a property is reported.
Task< bool > ReportException(Exception Exception)
Is called when an exception has occurred.
Task< bool > CollectionCleared(DateTimeOffset EntryTimestamp)
Is called when the collection has been cleared.
Task< bool > EndEntry()
Is called when an entry is finished.
Task< bool > StartLedger(ILedgerProvider Provider)
Is called when export of ledger is started.
Task< bool > EndBlock()
Is called when a block in a collection is finished.
Task< bool > StartEntry(string ObjectId, string TypeName, EntryType EntryType, DateTimeOffset EntryTimestamp)
Is called when an entry is started.
ExportToVariableTable()
Export is serialized into table form, with an undefined number of columns.
Task< bool > EndLedger()
Is called when export of ledger is finished.
Task< bool > ReportError(string Message)
Is called when an error is reported.
Task< bool > EndCollection()
Is called when a collection is finished.
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.
ObjectMatrix ToMatrix()
Converts the exported information into an object matrix with column headers.
Task< bool > StartCollection(string CollectionName)
Is called when a collection is started.
Interface for ledger providers that can be plugged into the static Ledger class.
Interface for ledger exports.
Basic interface for all types of elements.
EntryType
Ledger entry type.