Neuron®
The Neuron® is the basis for the creation of open and secure federated networks for smart societies.
Loading...
Searching...
No Matches
OnExternalTextNote.cs
1using System.Threading.Tasks;
5
7{
12 {
17 : base()
18 {
19 }
20
24 public override string LocalName => nameof(OnExternalTextNote);
25
30 public override IStateMachineNode Create()
31 {
32 return new OnExternalTextNote();
33 }
34
42 public override async Task<bool> Register(int EventIndex, EvaluationArguments Arguments, OnEvent Event)
43 {
44 string SourceVariable = await this.GetSourceVariable(Arguments);
45 string Privilege = await this.GetPrivilege(Arguments);
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, SourceVariable,
51 Privilege, string.Empty, string.Empty);
52
53 await Database.Insert(Handler);
54 await Handler.AddToCache();
55
56 return false;
57 }
58
62 public override string Label => nameof(OnExternalTextNote);
63 }
64}
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 external note events.
Task< string > GetSourceVariable(EvaluationArguments Arguments)
Evaluates the source variable to use (if any).
Task< string > GetPrivilege(EvaluationArguments Arguments)
Evaluates the privilege to require (if any).
Event raised when an external text note has been logged on the token corresponding to the state-machi...
override IStateMachineNode Create()
Creates a new node of the corresponding type.
override async Task< bool > Register(int EventIndex, EvaluationArguments Arguments, OnEvent Event)
Registers the event
OnExternalTextNote()
Event raised when an external text note has been logged on the token corresponding to the state-machi...
Task< string > EvaluateNoteVariable(EvaluationArguments Arguments)
Evaluates the note variable definition.
Definition: OnNote.cs:62
Action executed when entering a state.
Definition: OnEvent.cs:17