mirror of
https://github.com/eliasstepanik/OSCADSharpDotnet7.git
synced 2026-01-13 06:28:35 +00:00
+Added Variable class, Bind method to OSCADObject
This commit is contained in:
parent
eb49310d8a
commit
4f0d3ed1be
@ -227,6 +227,17 @@ namespace OSCADSharp
|
||||
#endregion
|
||||
|
||||
#region Utility Methods
|
||||
private Dictionary<string, Variable> bindings = new Dictionary<string, Variable>();
|
||||
/// <summary>
|
||||
/// Binds a variable to property of this object
|
||||
/// </summary>
|
||||
/// <param name="property"></param>
|
||||
/// <param name="variable"></param>
|
||||
public void Bind(string property, Variable variable)
|
||||
{
|
||||
bindings[property] = variable;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Returns the computed position of this object.
|
||||
///
|
||||
|
||||
@ -50,6 +50,7 @@
|
||||
<Compile Include="Ids.cs" />
|
||||
<Compile Include="Scripting\SingleStatementObject.cs" />
|
||||
<Compile Include="Scripting\StatementBuilder.cs" />
|
||||
<Compile Include="Scripting\Variable.cs" />
|
||||
<Compile Include="Settings.cs" />
|
||||
<Compile Include="Sizes.cs" />
|
||||
<Compile Include="Spatial\Bounds.cs" />
|
||||
|
||||
27
OSCADSharp/OSCADSharp/Scripting/Variable.cs
Normal file
27
OSCADSharp/OSCADSharp/Scripting/Variable.cs
Normal file
@ -0,0 +1,27 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
|
||||
namespace OSCADSharp.Scripting
|
||||
{
|
||||
/// <summary>
|
||||
/// A value for setting object properties in script output to
|
||||
/// a specific variable
|
||||
/// </summary>
|
||||
public class Variable
|
||||
{
|
||||
/// <summary>
|
||||
/// Name of the variable
|
||||
/// </summary>
|
||||
public string Name { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// Value of the variable.
|
||||
///
|
||||
/// Must be compatible with the data type being assigned to.
|
||||
/// </summary>
|
||||
public object Value { get; set; }
|
||||
}
|
||||
}
|
||||
Loading…
x
Reference in New Issue
Block a user