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
44 public override async Task<EventHandlerReference> Register(int EventIndex, EvaluationArguments Arguments, OnEvent Event)
45 {
46 string SourceVariable = await this.GetSourceVariable(Arguments);
47 string Privilege = await this.GetPrivilege(Arguments);
48 string NoteVariable = await this.EvaluateNoteVariable(Arguments);
49 string PersonalVariable = await this.EvaluateNoteVariable(Arguments);
50
51 TokenNoteEventHandler Handler = new TokenNoteEventHandler(Arguments,
52 EventIndex, this, NoteVariable, PersonalVariable, SourceVariable,
53 Privilege, string.Empty, string.Empty);
54
55 await Database.Insert(Handler);
56 await Handler.AddToCache();
57
58 return null;
59 }
60
64 public override string Label => nameof(OnExternalTextNote);
65 }
66}
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 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.
OnExternalTextNote()
Event raised when an external text note has been logged on the token corresponding to the state-machi...
override async Task< EventHandlerReference > Register(int EventIndex, EvaluationArguments Arguments, OnEvent Event)
Registers the event
Task< string > EvaluateNoteVariable(EvaluationArguments Arguments)
Evaluates the note variable definition.
Definition: OnNote.cs:62
Action executed when entering a state.
Definition: OnEvent.cs:19