aboutsummaryrefslogtreecommitdiffstatsci
path: root/src
diff options
context:
space:
mode:
authorjpbruyere <jp.bruyere@hotmail.com>2016-12-21 10:20:39 +0100
committerjpbruyere <jp.bruyere@hotmail.com>2016-12-21 10:20:39 +0100
commit37199aaa7104294355cbc81ecd9088103b7d29be (patch)
tree82ca1744ef538289ff5b77c2dd4b50638943f401 /src
parent1e0999a15644cea132896651ec6d0e39d3da21d4 (diff)
BindingDefinition class
Diffstat (limited to 'src')
-rw-r--r--src/IML/BindingDefinition.cs59
1 files changed, 59 insertions, 0 deletions
diff --git a/src/IML/BindingDefinition.cs b/src/IML/BindingDefinition.cs
new file mode 100644
index 00000000..dd76f183
--- /dev/null
+++ b/src/IML/BindingDefinition.cs
@@ -0,0 +1,59 @@
+//
+// BindingDefinition.cs
+//
+// Author:
+// Jean-Philippe Bruyère <jp.bruyere@hotmail.com>
+//
+// Copyright (c) 2016 jp
+//
+// This program is free software: you can redistribute it and/or modify
+// it under the terms of the GNU General Public License as published by
+// the Free Software Foundation, either version 3 of the License, or
+// (at your option) any later version.
+//
+// This program is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+// GNU General Public License for more details.
+//
+// You should have received a copy of the GNU General Public License
+// along with this program. If not, see <http://www.gnu.org/licenses/>.
+using System;
+
+namespace Crow.IML
+{
+ /// <summary>
+ /// store binding source and target addresses and member names
+ /// </summary>
+ public class BindingDefinition
+ {
+ public NodeAddress SourceNA;
+ public string SourceMember;
+ public NodeAddress TargetNA;
+ public string TargetMember;
+ public string TargetName;
+ public bool TwoWay = false;
+
+ #region CTOR
+ public BindingDefinition (NodeAddress _sourceNA, string _sourceMember, NodeAddress _targetNA, string _targetMember, string _targetName = "", bool _twoWay = false)
+ {
+ SourceNA = _sourceNA;
+ SourceMember = _sourceMember;
+ TargetNA = _targetNA;
+ TargetMember = _targetMember;
+ TargetName = _targetName;
+ TwoWay = _twoWay;
+ }
+ #endregion
+
+ /// <summary>
+ /// replace the target node address with corresponding named node address, and clear the target name once resolved
+ /// </summary>
+ /// <param name="newTargetNA">Named Node</param>
+ public void ResolveTargetName(NodeAddress newTargetNA){
+ TargetNA = newTargetNA;
+ TargetName = "";
+ }
+ }
+}
+