]> O.S.I.I.S - jp/crow.git/commitdiff
BindingDefinition class
authorjpbruyere <jp.bruyere@hotmail.com>
Wed, 21 Dec 2016 09:20:39 +0000 (10:20 +0100)
committerjpbruyere <jp.bruyere@hotmail.com>
Wed, 21 Dec 2016 09:20:39 +0000 (10:20 +0100)
Crow.csproj
src/IML/BindingDefinition.cs [new file with mode: 0644]

index 6cae0a7ec30833edc33a2909565abeeb8a6a9403..35a755a7ede7bffeeb569d765d6d42524f6767ea 100644 (file)
     <Compile Include="src\IML\Node.cs" />
     <Compile Include="src\IML\MemberAddress.cs" />
     <Compile Include="src\IML\NodeStack.cs" />
+    <Compile Include="src\IML\BindingDefinition.cs" />
   </ItemGroup>
   <ItemGroup>
     <Reference Include="System" />
diff --git a/src/IML/BindingDefinition.cs b/src/IML/BindingDefinition.cs
new file mode 100644 (file)
index 0000000..dd76f18
--- /dev/null
@@ -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 = "";
+               }
+       }
+}
+