From 37199aaa7104294355cbc81ecd9088103b7d29be Mon Sep 17 00:00:00 2001 From: jpbruyere Date: Wed, 21 Dec 2016 10:20:39 +0100 Subject: [PATCH] BindingDefinition class --- Crow.csproj | 1 + src/IML/BindingDefinition.cs | 59 ++++++++++++++++++++++++++++++++++++ 2 files changed, 60 insertions(+) create mode 100644 src/IML/BindingDefinition.cs diff --git a/Crow.csproj b/Crow.csproj index 6cae0a7e..35a755a7 100644 --- a/Crow.csproj +++ b/Crow.csproj @@ -148,6 +148,7 @@ + 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 +// +// 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 . +using System; + +namespace Crow.IML +{ + /// + /// store binding source and target addresses and member names + /// + 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 + + /// + /// replace the target node address with corresponding named node address, and clear the target name once resolved + /// + /// Named Node + public void ResolveTargetName(NodeAddress newTargetNA){ + TargetNA = newTargetNA; + TargetName = ""; + } + } +} + -- 2.47.3