Neuron®
The Neuron® is the basis for the creation of open and secure federated networks for smart societies.
Loading...
Searching...
No Matches
OnTextNote.cs
1using System.Threading.Tasks;
5
7{
11 public class OnTextNote : OnNote
12 {
16 public OnTextNote()
17 : base()
18 {
19 }
20
24 public override string LocalName => nameof(OnTextNote);
25
30 public override IStateMachineNode Create()
31 {
32 return new OnTextNote();
33 }
34
44 public override async Task<EventHandlerReference> Register(int EventIndex, EvaluationArguments Arguments, OnEvent Event)
45 {
46 string NoteVariable = await this.EvaluateNoteVariable(Arguments);
47 string PersonalVariable = await this.EvaluateNoteVariable(Arguments);
48
49 TokenNoteEventHandler Handler = new TokenNoteEventHandler(Arguments,
50 EventIndex, this, NoteVariable, PersonalVariable, string.Empty,
51 string.Empty, string.Empty, string.Empty);
52
53 await Database.Insert(Handler);
54 await Handler.AddToCache();
55
56 return null;
57 }
58
62 public override string Label => nameof(OnTextNote);
63 }
64}
Static interface for database persistence. In order to work, a database provider has to be assigned t...
Definition: Database.cs:21
static async Task Insert(object Object)
Inserts an object into the default collection of the database.
Definition: Database.cs:97
async Task AddToCache()
Removes the event handler from the cache.
Contains information required for evaluating script in a state-machine.
Abstract base class for note events.
Definition: OnNote.cs:13
Task< string > EvaluateNoteVariable(EvaluationArguments Arguments)
Evaluates the note variable definition.
Definition: OnNote.cs:62
Event raised when a text note has been logged on the token corresponding to the state-machine.
Definition: OnTextNote.cs:12
override async Task< EventHandlerReference > Register(int EventIndex, EvaluationArguments Arguments, OnEvent Event)
Registers the event
Definition: OnTextNote.cs:44
override IStateMachineNode Create()
Creates a new node of the corresponding type.
Definition: OnTextNote.cs:30
OnTextNote()
Event raised when a text note has been logged on the token corresponding to the state-machine.
Definition: OnTextNote.cs:16
Action executed when entering a state.
Definition: OnEvent.cs:19