From ca6bc89206f6c1ce7b21952a9514c76a050daf98 Mon Sep 17 00:00:00 2001 From: Michael Smith Date: Fri, 18 Mar 2016 20:12:00 -0700 Subject: [PATCH] Nested OpenSCADPathFinder in OutputSettings --- .../OSCADSharp/IO/OpenSCADPathFinder.cs | 34 ------------------- OSCADSharp/OSCADSharp/IO/OutputSettings.cs | 30 ++++++++++++++-- OSCADSharp/OSCADSharp/OSCADSharp.csproj | 7 ++-- 3 files changed, 31 insertions(+), 40 deletions(-) delete mode 100644 OSCADSharp/OSCADSharp/IO/OpenSCADPathFinder.cs diff --git a/OSCADSharp/OSCADSharp/IO/OpenSCADPathFinder.cs b/OSCADSharp/OSCADSharp/IO/OpenSCADPathFinder.cs deleted file mode 100644 index a1e0196..0000000 --- a/OSCADSharp/OSCADSharp/IO/OpenSCADPathFinder.cs +++ /dev/null @@ -1,34 +0,0 @@ -using System; -using System.Collections.Generic; -using System.IO; -using System.Linq; -using System.Text; -using System.Threading.Tasks; - -namespace OSCADSharp.IO -{ - /// - /// Known where the default installation locations for OpenSCAD - /// are, and finds the right path for the current environment - /// - internal class OpenSCADPathFinder - { - private string[] possibleFilePaths = new string[] - { - @"C:\Program Files (x86)\OpenSCAD\openscad.exe", - @"C:\Program Files\OpenSCAD\openscad.exe" - }; - - internal string GetPath() - { - foreach (string path in possibleFilePaths) - { - if (File.Exists(path)) - return path; - } - - return null; - } - - } -} diff --git a/OSCADSharp/OSCADSharp/IO/OutputSettings.cs b/OSCADSharp/OSCADSharp/IO/OutputSettings.cs index 0e837bb..5519ac7 100644 --- a/OSCADSharp/OSCADSharp/IO/OutputSettings.cs +++ b/OSCADSharp/OSCADSharp/IO/OutputSettings.cs @@ -7,12 +7,12 @@ using System.Text; using System.Threading.Tasks; namespace OSCADSharp.IO -{ +{ /// /// Settings for OpenSCAD scripts /// public static class OutputSettings - { + { /// /// Code-gen header /// @@ -23,6 +23,30 @@ namespace OSCADSharp.IO /// Path to the OpenSCAD executable for file invocation /// (Default value is set the default install directory on Windows) /// - public static string OpenSCADPath { get; set; } = new OpenSCADPathFinder().GetPath(); + public static string OpenSCADPath { get; set; } = new OpenSCADPathFinder().GetPath(); + + /// + /// Known where the default installation locations for OpenSCAD + /// are, and finds the right path for the current environment + /// + private class OpenSCADPathFinder + { + private string[] possibleFilePaths = new string[] + { + @"C:\Program Files (x86)\OpenSCAD\openscad.exe", + @"C:\Program Files\OpenSCAD\openscad.exe" + }; + + internal string GetPath() + { + foreach (string path in possibleFilePaths) + { + if (File.Exists(path)) + return path; + } + + return null; + } + } } } diff --git a/OSCADSharp/OSCADSharp/OSCADSharp.csproj b/OSCADSharp/OSCADSharp/OSCADSharp.csproj index 3e18185..ed76643 100644 --- a/OSCADSharp/OSCADSharp/OSCADSharp.csproj +++ b/OSCADSharp/OSCADSharp/OSCADSharp.csproj @@ -42,6 +42,7 @@ + @@ -51,7 +52,6 @@ - @@ -75,7 +75,6 @@ - @@ -85,7 +84,9 @@ - + + +