Neuron®
The Neuron® is the basis for the creation of open and secure federated networks for smart societies.
Loading...
Searching...
No Matches
XmlScriptAttributeString.cs
1using System;
2using System.Collections.Generic;
3using System.Threading.Tasks;
4using System.Xml;
7
9{
14 {
15 private readonly string value;
16
25 public XmlScriptAttributeString(string Name, string Value, int Start, int Length, Expression Expression)
26 : base(Name, Start, Length, Expression)
27 {
28 this.value = Value;
29 }
30
38 public override bool ForAllChildNodes(ScriptNodeEventHandler Callback, object State, SearchMethod Order)
39 {
40 return true;
41 }
42
49 internal override void Build(XmlDocument Document, XmlElement Parent, Variables Variables)
50 {
51 Parent.SetAttribute(this.Name, this.value);
52 }
53
58 internal override string GetValue(Variables Variables)
59 {
60 return this.value;
61 }
62
67 internal override Task<string> GetValueAsync(Variables Variables)
68 {
69 return Task.FromResult<string>(this.value);
70 }
71
78 public override PatternMatchResult PatternMatch(XmlNode CheckAgainst, Dictionary<string, IElement> AlreadyFound)
79 {
80 if (CheckAgainst is XmlAttribute)
81 return CheckAgainst.Value == this.value ? PatternMatchResult.Match : PatternMatchResult.NoMatch;
82 else
83 return PatternMatchResult.NoMatch;
84 }
85
92 public override PatternMatchResult PatternMatch(string CheckAgainst, Dictionary<string, IElement> AlreadyFound)
93 {
94 return CheckAgainst == this.value ? PatternMatchResult.Match : PatternMatchResult.NoMatch;
95 }
96
102 public override bool IsApplicable(string CheckAgainst)
103 {
104 return CheckAgainst == this.value;
105 }
106 }
107}
Class managing a script expression.
Definition: Expression.cs:39
int Length
Length of expression covered by node.
Definition: ScriptNode.cs:101
ScriptNode Parent
Parent node.
Definition: ScriptNode.cs:126
int Start
Start position in script expression.
Definition: ScriptNode.cs:92
Collection of variables.
Definition: Variables.cs:25
Abstract base class for XML Script attribute nodes.
XML Script attribute node, whose value is defined by script.
override bool ForAllChildNodes(ScriptNodeEventHandler Callback, object State, SearchMethod Order)
Calls the callback method for all child nodes.
override PatternMatchResult PatternMatch(string CheckAgainst, Dictionary< string, IElement > AlreadyFound)
Performs a pattern match operation.
override PatternMatchResult PatternMatch(XmlNode CheckAgainst, Dictionary< string, IElement > AlreadyFound)
Performs a pattern match operation.
XmlScriptAttributeString(string Name, string Value, int Start, int Length, Expression Expression)
XML Script attribute node, whose value is defined by script.
override bool IsApplicable(string CheckAgainst)
If the node is applicable in pattern matching against CheckAgainst .
delegate bool ScriptNodeEventHandler(ScriptNode Node, out ScriptNode NewNode, object State)
Delegate for ScriptNode callback methods.
PatternMatchResult
Status result of a pattern matching operation.
Definition: ScriptNode.cs:17
SearchMethod
Method to traverse the expression structure
Definition: ScriptNode.cs:38