From 82a28479cf05629ecfe1cadcbcb5160eabc9b7c1 Mon Sep 17 00:00:00 2001 From: John Lewin Date: Thu, 2 Aug 2018 17:56:59 -0700 Subject: [PATCH] Init PlatformFeatures, ProcCommandLineArgs b4 ShowAsSystemWindow --- ApplicationView/ApplicationController.cs | 7 ------- Program.cs | 5 +++++ 2 files changed, 5 insertions(+), 7 deletions(-) diff --git a/ApplicationView/ApplicationController.cs b/ApplicationView/ApplicationController.cs index 5cc7ac29c..fce6e79dc 100644 --- a/ApplicationView/ApplicationController.cs +++ b/ApplicationView/ApplicationController.cs @@ -2399,8 +2399,6 @@ namespace MatterHackers.MatterControl private static string lastSection = ""; private static Stopwatch timer; - public static string PlatformFeaturesProvider { get; set; } = "MatterHackers.MatterControl.WindowsPlatformsFeatures, MatterControl"; - public static SystemWindow LoadRootWindow(int width, int height) { timer = Stopwatch.StartNew(); @@ -2780,8 +2778,6 @@ namespace MatterHackers.MatterControl public static async Task Initialize(SystemWindow systemWindow, Action reporter) { - AppContext.Platform = AggContext.CreateInstanceFrom(PlatformFeaturesProvider); - reporter?.Invoke(0.01, "PlatformInit"); AppContext.Platform.PlatformInit((status) => { @@ -2808,9 +2804,6 @@ namespace MatterHackers.MatterControl reporter?.Invoke(0.8, "Plugins"); AppContext.Platform.FindAndInstantiatePlugins(systemWindow); - reporter?.Invoke(0.9, "Process Commandline"); - AppContext.Platform.ProcessCommandline(); - reporter?.Invoke(0.91, "OnLoadActions"); applicationController.OnLoadActions(); diff --git a/Program.cs b/Program.cs index 1974f85e7..a985394dc 100644 --- a/Program.cs +++ b/Program.cs @@ -70,6 +70,11 @@ namespace MatterHackers.MatterControl }; } + // Init platformFeaturesProvider before ShowAsSystemWindow + string platformFeaturesProvider = "MatterHackers.MatterControl.WindowsPlatformsFeatures, MatterControl"; + AppContext.Platform = AggContext.CreateInstanceFrom(platformFeaturesProvider); + AppContext.Platform.ProcessCommandline(); + // Get startup bounds from MatterControl and construct system window //var systemWindow = new DesktopMainWindow(400, 200) var (width, height) = RootSystemWindow.GetStartupBounds();