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
42 public override async Task<bool> Register(int EventIndex, EvaluationArguments Arguments, OnEvent Event)
43 {
44 string NoteVariable = await this.EvaluateNoteVariable(Arguments);
45 string PersonalVariable = await this.EvaluateNoteVariable(Arguments);
46
47 TokenNoteEventHandler Handler = new TokenNoteEventHandler(Arguments,
48 EventIndex, this, NoteVariable, PersonalVariable, string.Empty,
49 string.Empty, string.Empty, string.Empty);
50
51 await Database.Insert(Handler);
52 await Handler.AddToCache();
53
54 return false;
55 }
56
60 public override string Label => nameof(OnTextNote);
61 }
62}
Static interface for database persistence. In order to work, a database provider has to be assigned t...
Definition: Database.cs:19
static async Task Insert(object Object)
Inserts an object into the default collection of the database.
Definition: Database.cs:95
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< bool > Register(int EventIndex, EvaluationArguments Arguments, OnEvent Event)
Registers the event
Definition: OnTextNote.cs:42
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:17