Neuron®
The Neuron® is the basis for the creation of open and secure federated networks for smart societies.
Loading...
Searching...
No Matches
ContractEventHandler.cs
1using System.Text;
6
8{
13 {
18 : base()
19 {
20 }
21
39 string ParamtersVariable, string RolesVariable, string MachineReadableVariable,
40 string LegalIdVariable, string RoleVariable, string LocalName, string Namespace,
42 : base(Arguments, EventIndex)
43 {
44 StringBuilder sb = new StringBuilder();
45
46 sb.Append(nameof(ContractEventHandler));
47 sb.Append('|');
48 sb.Append(EventNode.GetType().Name);
49 sb.Append('|');
50 sb.Append(LocalName);
51 sb.Append('|');
52 sb.Append(Namespace);
53
54 if (NameType != SecondaryNameType.None)
55 {
56 sb.Append('|');
57 sb.Append(NameType.ToString());
58 }
59
60 this.EventType = sb.ToString();
61
62 this.ContractIdVariable = ContractIdVariable;
63 this.ContractXmlVariable = ContractXmlVariable;
64 this.ParametersVariable = ParamtersVariable;
65 this.RolesVariable = RolesVariable;
66 this.MachineReadableVariable = MachineReadableVariable;
67 this.LegalIdVariable = LegalIdVariable;
68 this.RoleVariable = RoleVariable;
69 this.LocalName = LocalName;
70 this.Namespace = Namespace;
71 this.NameType = NameType;
72 }
73
77 public string ContractIdVariable { get; set; }
78
82 public string ContractXmlVariable { get; set; }
83
87 public string ParametersVariable { get; set; }
88
92 public string RolesVariable { get; set; }
93
97 public string MachineReadableVariable { get; set; }
98
102 public string LegalIdVariable { get; set; }
103
107 public string RoleVariable { get; set; }
108
112 public string LocalName { get; set; }
113
117 public string Namespace { get; set; }
118
122 [DefaultValue(SecondaryNameType.None)]
123 public SecondaryNameType NameType { get; set; }
124
126 public override bool Equals(object obj)
127 {
128 return
129 base.Equals(obj) &&
130 obj is ContractEventHandler O &&
131 this.ContractIdVariable == O.ContractIdVariable &&
132 this.ContractXmlVariable == O.ContractXmlVariable &&
133 this.ParametersVariable == O.ParametersVariable &&
134 this.RolesVariable == O.RolesVariable &&
135 this.MachineReadableVariable == O.MachineReadableVariable &&
136 this.LegalIdVariable == O.LegalIdVariable &&
137 this.RoleVariable == O.RoleVariable &&
138 this.LocalName == O.LocalName &&
139 this.Namespace == O.Namespace &&
140 this.NameType == O.NameType;
141 }
142
144 public override int GetHashCode()
145 {
146 int Result = base.GetHashCode();
147
148 Result ^= Result << 5 ^ (this.ContractIdVariable?.GetHashCode() ?? 0);
149 Result ^= Result << 5 ^ (this.ContractXmlVariable?.GetHashCode() ?? 0);
150 Result ^= Result << 5 ^ (this.ParametersVariable?.GetHashCode() ?? 0);
151 Result ^= Result << 5 ^ (this.RolesVariable?.GetHashCode() ?? 0);
152 Result ^= Result << 5 ^ (this.MachineReadableVariable?.GetHashCode() ?? 0);
153 Result ^= Result << 5 ^ (this.LegalIdVariable?.GetHashCode() ?? 0);
154 Result ^= Result << 5 ^ (this.RoleVariable?.GetHashCode() ?? 0);
155 Result ^= Result << 5 ^ (this.LocalName?.GetHashCode() ?? 0);
156 Result ^= Result << 5 ^ (this.Namespace?.GetHashCode() ?? 0);
157 Result ^= Result << 5 ^ this.NameType.GetHashCode();
158
159 return Result;
160 }
161
162 }
163}
string Namespace
Namespace of machine-readable part of contract.
SecondaryNameType NameType
On which element the name check should be performed.
ContractEventHandler(EvaluationArguments Arguments, int EventIndex, ContractEventNode EventNode, string ContractIdVariable, string ContractXmlVariable, string ParamtersVariable, string RolesVariable, string MachineReadableVariable, string LegalIdVariable, string RoleVariable, string LocalName, string Namespace, SecondaryNameType NameType)
Event handler for contract events.
string LocalName
Local-name of machine-readable part of contract.
int EventIndex
Zero-based index of event handler in state.
Definition: EventHandler.cs:60
Contains information required for evaluating script in a state-machine.
Abstract base class for State-Machine event nodes.
Definition: EventNode.cs:11