From cde6e42923428430a423b9b74713721a6e6a8da3 Mon Sep 17 00:00:00 2001 From: John Lewin Date: Wed, 31 Oct 2018 14:06:39 -0700 Subject: [PATCH] Add configuration option for McwsTestEnvironment --- MatterControl.csproj | 1 + .../ApplicationView/ApplicationController.cs | 10 +++++++++- MatterControlLib/RootSystemWindow.cs | 2 -- Program.cs | 2 ++ 4 files changed, 12 insertions(+), 3 deletions(-) diff --git a/MatterControl.csproj b/MatterControl.csproj index 6e70d8529..b1d923e09 100644 --- a/MatterControl.csproj +++ b/MatterControl.csproj @@ -58,6 +58,7 @@ + diff --git a/MatterControlLib/ApplicationView/ApplicationController.cs b/MatterControlLib/ApplicationView/ApplicationController.cs index 0618e2ef5..5fe3bbcbc 100644 --- a/MatterControlLib/ApplicationView/ApplicationController.cs +++ b/MatterControlLib/ApplicationView/ApplicationController.cs @@ -107,13 +107,16 @@ namespace MatterHackers.MatterControl Titillium, }; - public class AppContext + + public static class AppContext { /// /// Native platform features /// public static INativePlatformFeatures Platform { get; set; } + public static MatterControlOptions Options { get; set; } = new MatterControlOptions(); + public static bool IsLoading { get; internal set; } = true; /// @@ -232,6 +235,11 @@ namespace MatterHackers.MatterControl ApplicationController.Instance.ReloadAll(); }); } + + public class MatterControlOptions + { + public bool McwsTestEnvironment { get; set; } + } } public class ApplicationController diff --git a/MatterControlLib/RootSystemWindow.cs b/MatterControlLib/RootSystemWindow.cs index 84dbb5065..e0a19b95e 100644 --- a/MatterControlLib/RootSystemWindow.cs +++ b/MatterControlLib/RootSystemWindow.cs @@ -33,13 +33,11 @@ using System.IO; using MatterHackers.Agg; using MatterHackers.Agg.Platform; using MatterHackers.Agg.UI; -using MatterHackers.DataConverters3D; using MatterHackers.Localizations; using MatterHackers.MatterControl.DataStorage; using MatterHackers.MatterControl.PrinterCommunication; using MatterHackers.MatterControl.PrintQueue; using MatterHackers.MatterControl.SettingsManagement; -using MatterHackers.RenderOpenGl.OpenGl; using MatterHackers.VectorMath; namespace MatterHackers.MatterControl diff --git a/Program.cs b/Program.cs index b577dc99e..c295ce3e7 100644 --- a/Program.cs +++ b/Program.cs @@ -87,6 +87,8 @@ namespace MatterHackers.MatterControl MatterHackers.MatterControl.AppContext.Platform = AggContext.CreateInstanceFrom(platformFeaturesProvider); MatterHackers.MatterControl.AppContext.Platform.ProcessCommandline(); + config.Bind("MatterControl", MatterHackers.MatterControl.AppContext.Options); + // Get startup bounds from MatterControl and construct system window //var systemWindow = new DesktopMainWindow(400, 200) var (width, height) = RootSystemWindow.GetStartupBounds();