Neuron®
The Neuron® is the basis for the creation of open and secure federated networks for smart societies.
Loading...
Searching...
No Matches
ExportEntryMaxCount.cs
1using System;
4
6{
11 {
12 private int maxCount;
13
19 public ExportEntryMaxCount(ILedgerExport Output, int MaxCount)
20 : base(Output)
21 {
22 this.maxCount = MaxCount;
23 }
24
33 public override bool IncludeEntry(string ObjectId, string TypeName, EntryType EntryType, DateTimeOffset EntryTimestamp)
34 {
35 if (this.maxCount > 0)
36 {
37 this.maxCount--;
38 return true;
39 }
40 else
41 return false;
42 }
43
48 public override bool IncludeNonEntryEvent()
49 {
50 return this.maxCount >= 0;
51 }
52
57 public override bool ContinueExport() => this.maxCount > 0;
58 }
59}
Abstract base class for ledger exports with custom entry filter rules.
Limits the number of exported entries
override bool ContinueExport()
If export should be continued or not.
override bool IncludeNonEntryEvent()
If a non-entry event should be included.
override bool IncludeEntry(string ObjectId, string TypeName, EntryType EntryType, DateTimeOffset EntryTimestamp)
If an entry should be included.
ExportEntryMaxCount(ILedgerExport Output, int MaxCount)
Limits the number of exported entries
EntryType
Ledger entry type.
Definition: ILedgerEntry.cs:9