diff --git a/OSCADSharp/OSCADSharp/OSCADObject.cs b/OSCADSharp/OSCADSharp/OSCADObject.cs index 7015e09..6a62825 100644 --- a/OSCADSharp/OSCADSharp/OSCADObject.cs +++ b/OSCADSharp/OSCADSharp/OSCADObject.cs @@ -227,17 +227,6 @@ namespace OSCADSharp #endregion #region Utility Methods - private Dictionary bindings = new Dictionary(); - /// - /// Binds a variable to property of this object - /// - /// - /// - public void Bind(string property, Variable variable) - { - bindings[property] = variable; - } - /// /// Returns the computed position of this object. /// diff --git a/OSCADSharp/OSCADSharp/OSCADSharp.csproj b/OSCADSharp/OSCADSharp/OSCADSharp.csproj index 194417c..a6032ff 100644 --- a/OSCADSharp/OSCADSharp/OSCADSharp.csproj +++ b/OSCADSharp/OSCADSharp/OSCADSharp.csproj @@ -48,6 +48,9 @@ + + + diff --git a/OSCADSharp/OSCADSharp/Scripting/BindingMapper.cs b/OSCADSharp/OSCADSharp/Scripting/BindingMapper.cs new file mode 100644 index 0000000..3c6c03d --- /dev/null +++ b/OSCADSharp/OSCADSharp/Scripting/BindingMapper.cs @@ -0,0 +1,15 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; + +namespace OSCADSharp.Scripting +{ + internal class BindingMapper + { + public string OpenSCADFieldName { get; set; } + public List BindingOptions { get; set; } + public Dictionary> BindingTransformers { get; set; } + } +} diff --git a/OSCADSharp/OSCADSharp/Scripting/Bindings.cs b/OSCADSharp/OSCADSharp/Scripting/Bindings.cs new file mode 100644 index 0000000..c8357e8 --- /dev/null +++ b/OSCADSharp/OSCADSharp/Scripting/Bindings.cs @@ -0,0 +1,19 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; + +namespace OSCADSharp.Scripting +{ + internal class Bindings + { + internal List Mappers { get; set; } = new List(); + + private Dictionary bindings = new Dictionary(); + internal void Add(string property, Variable variable) + { + bindings[property] = variable; + } + } +} diff --git a/OSCADSharp/OSCADSharp/Scripting/IBindable.cs b/OSCADSharp/OSCADSharp/Scripting/IBindable.cs new file mode 100644 index 0000000..6389eb4 --- /dev/null +++ b/OSCADSharp/OSCADSharp/Scripting/IBindable.cs @@ -0,0 +1,21 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; + +namespace OSCADSharp.Scripting +{ + /// + /// An object whose properties can be bound to variables + /// + public interface IBindable + { + /// + /// Binds a variable to property of this object + /// + /// + /// + void Bind(string property, Variable variable); + } +}