mirror of
https://github.com/eliasstepanik/OSCADSharpDotnet7.git
synced 2026-01-14 15:08:35 +00:00
Made a number of fields ReadOnly that are never mutated
This commit is contained in:
parent
fd12071509
commit
cf7eaa9000
@ -31,7 +31,7 @@ namespace OSCADSharp.DataBinding
|
||||
this.bindings.Synonym("innervalue", propertyName);
|
||||
}
|
||||
|
||||
private string boundProperty = null;
|
||||
private readonly string boundProperty = null;
|
||||
|
||||
internal bool IsBound { get; set; } = false;
|
||||
public void Bind(string property, Variable variable)
|
||||
|
||||
@ -11,7 +11,7 @@ namespace OSCADSharp.DataBinding
|
||||
{
|
||||
#region Fields
|
||||
private Dictionary<string, Binding> bindings = new Dictionary<string, Binding>();
|
||||
private Dictionary<string, string> propertyNametoOpenSCADFieldMappings = new Dictionary<string, string>();
|
||||
private readonly Dictionary<string, string> propertyNametoOpenSCADFieldMappings = new Dictionary<string, string>();
|
||||
private Dictionary<string, string> synonyms = new Dictionary<string, string>();
|
||||
#endregion
|
||||
|
||||
|
||||
@ -17,7 +17,7 @@ namespace OSCADSharp.DataBinding
|
||||
/// top of OpenSCAD scripts
|
||||
/// </summary>
|
||||
public static Variables Global { get; set; } = new Variables();
|
||||
private ConcurrentDictionary<string, Variable> variables = new ConcurrentDictionary<string, Variable>();
|
||||
private readonly ConcurrentDictionary<string, Variable> variables = new ConcurrentDictionary<string, Variable>();
|
||||
|
||||
/// <summary>
|
||||
/// Adds a variable to the collection
|
||||
|
||||
@ -31,7 +31,7 @@ namespace OSCADSharp.IO
|
||||
/// </summary>
|
||||
private class OpenSCADPathFinder
|
||||
{
|
||||
private string[] possibleFilePaths = new string[]
|
||||
private readonly string[] possibleFilePaths = new string[]
|
||||
{
|
||||
@"C:\Program Files (x86)\OpenSCAD\openscad.exe",
|
||||
@"C:\Program Files\OpenSCAD\openscad.exe"
|
||||
|
||||
@ -15,7 +15,7 @@ namespace OSCADSharp
|
||||
/// <summary>
|
||||
/// An object that's mirrored on a plane
|
||||
/// </summary>
|
||||
internal class MirroredObject : SingleStatementObject
|
||||
private class MirroredObject : SingleStatementObject
|
||||
{
|
||||
/// <summary>
|
||||
/// The normal vector of a plane intersecting the origin of the object,
|
||||
@ -133,7 +133,7 @@ namespace OSCADSharp
|
||||
/// <summary>
|
||||
/// Creates an object that's the convex hull of child objects
|
||||
/// </summary>
|
||||
internal class HulledObject : MultiStatementObject
|
||||
private class HulledObject : MultiStatementObject
|
||||
{
|
||||
internal HulledObject(IEnumerable<OSCADObject> children) : base("hull()", children)
|
||||
{
|
||||
@ -145,7 +145,7 @@ namespace OSCADSharp
|
||||
/// <summary>
|
||||
/// Creates an object that's the minkowski sum of child objects
|
||||
/// </summary>
|
||||
internal class MinkowskiedObject : MultiStatementObject
|
||||
private class MinkowskiedObject : MultiStatementObject
|
||||
{
|
||||
|
||||
internal MinkowskiedObject(IEnumerable<OSCADObject> children) : base("minkowski()", children)
|
||||
|
||||
@ -18,7 +18,7 @@ namespace OSCADSharp
|
||||
/// </summary>
|
||||
internal class MultiStatementObject : OSCADObject
|
||||
{
|
||||
private string outerStatement;
|
||||
private readonly string outerStatement;
|
||||
|
||||
internal MultiStatementObject(string outerStatement, IEnumerable<OSCADObject> children)
|
||||
{
|
||||
|
||||
@ -20,7 +20,7 @@ namespace OSCADSharp
|
||||
public abstract partial class OSCADObject : IBindable
|
||||
{
|
||||
#region Attributes
|
||||
private int id = Ids.Get();
|
||||
private readonly int id = Ids.Get();
|
||||
|
||||
/// <summary>
|
||||
/// The unique Id of the object
|
||||
|
||||
@ -14,7 +14,7 @@ namespace OSCADSharp.Spatial
|
||||
internal class Matrix
|
||||
{
|
||||
#region Fields/Properties
|
||||
private double[] values;
|
||||
private readonly double[] values;
|
||||
|
||||
internal int ColumnCount { get; private set; }
|
||||
internal int RowCount { get; private set; }
|
||||
|
||||
@ -12,7 +12,7 @@ namespace OSCADSharp.Utility
|
||||
internal static class Ids
|
||||
{
|
||||
private static int globalId = 0;
|
||||
private static object idLockObject = new object();
|
||||
private readonly static object idLockObject = new object();
|
||||
|
||||
/// <summary>
|
||||
/// Gets a unique auto-incrementing integer id
|
||||
|
||||
@ -13,9 +13,9 @@ namespace OSCADSharp.Utility
|
||||
/// </summary>
|
||||
internal class SingleBlockFormatter
|
||||
{
|
||||
private string outerCode;
|
||||
private string innerCode;
|
||||
private string indentationAmount = " ";
|
||||
private readonly string outerCode;
|
||||
private readonly string innerCode;
|
||||
private readonly string indentationAmount = " ";
|
||||
|
||||
internal SingleBlockFormatter(string outerCode, string innerCode)
|
||||
{
|
||||
|
||||
@ -14,7 +14,7 @@ namespace OSCADSharp.Utility
|
||||
internal class StatementBuilder
|
||||
{
|
||||
private StringBuilder SB { get; set; } = new StringBuilder();
|
||||
private Bindings bindings = null;
|
||||
private readonly Bindings bindings = null;
|
||||
|
||||
internal StatementBuilder(Bindings bindings)
|
||||
{
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user