From 17b36580b38d06dc638cbef8a73b6b3107b08f38 Mon Sep 17 00:00:00 2001 From: John Lewin Date: Tue, 22 Aug 2017 14:58:13 -0700 Subject: [PATCH] Fix build errors --- MatterControlApplication.cs | 35 ----------------- Program.cs | 48 +++++++++++++++++------- Utilities/WebUtilities/RequestManager.cs | 2 +- 3 files changed, 35 insertions(+), 50 deletions(-) diff --git a/MatterControlApplication.cs b/MatterControlApplication.cs index 316a5fd96..7afa6089d 100644 --- a/MatterControlApplication.cs +++ b/MatterControlApplication.cs @@ -84,24 +84,6 @@ namespace MatterHackers.MatterControl private Stopwatch totalDrawTime = new Stopwatch(); - private const int RaygunMaxNotifications = 15; - - private static int raygunNotificationCount = 0; - - private static RaygunClient _raygunClient = GetCorrectClient(); - - private static RaygunClient GetCorrectClient() - { - if (AggContext.OperatingSystem == OSType.Mac) - { - return new RaygunClient("qmMBpKy3OSTJj83+tkO7BQ=="); // this is the Mac key - } - else - { - return new RaygunClient("hQIlyUUZRGPyXVXbI6l1dA=="); // this is the PC key - } - } - public static bool IsLoading { get; private set; } = true; public static void RequestPowerShutDown() @@ -332,23 +314,6 @@ namespace MatterHackers.MatterControl private bool dropWasOnChild = true; - public enum ReportSeverity2 { Warning, Error } - - public void ReportException(Exception e, string key = "", string value = "", ReportSeverity2 warningLevel = ReportSeverity2.Warning) - { - // Conditionally spin up error reporting if not on the Stable channel - string channel = UserSettings.Instance.get(UserSettingsKey.UpdateFeedType); - if (string.IsNullOrEmpty(channel) || channel != "release" || OemSettings.Instance.WindowTitleExtra == "Experimental") - { -#if !DEBUG - if (raygunNotificationCount++ < RaygunMaxNotifications) - { - _raygunClient.Send(e); - } -#endif - } - } - private EventHandler unregisterEvent; public static MatterControlApplication Instance diff --git a/Program.cs b/Program.cs index 094a5553b..87c54e177 100644 --- a/Program.cs +++ b/Program.cs @@ -8,25 +8,22 @@ using System.Threading.Tasks; using System.Windows.Forms; using MatterHackers.Agg.UI; using MatterHackers.MatterControl.DataStorage; +using MatterHackers.MatterControl.SettingsManagement; +using Mindscape.Raygun4Net; +using MatterHackers.Agg.Platform; namespace MatterHackers.MatterControl { static class Program { - - // ** Standard Winforms Main ** // - //[STAThread] - //static void Main() - //{ - // Application.EnableVisualStyles(); - // Application.SetCompatibleTextRenderingDefault(false); - // Application.Run(new Form1()); - //} + private const int RaygunMaxNotifications = 15; - /// - /// The main entry point for the application. - /// - [STAThread] + private static int raygunNotificationCount = 0; + + /// + /// The main entry point for the application. + /// + [STAThread] public static void Main() { CultureInfo.DefaultThreadCurrentCulture = CultureInfo.InvariantCulture; @@ -69,5 +66,28 @@ namespace MatterHackers.MatterControl } #endif } - } + + private static RaygunClient _raygunClient = GetCorrectClient(); + + private static RaygunClient GetCorrectClient() + { + if (AggContext.OperatingSystem == OSType.Mac) + { + return new RaygunClient("qmMBpKy3OSTJj83+tkO7BQ=="); // this is the Mac key + } + else + { + return new RaygunClient("hQIlyUUZRGPyXVXbI6l1dA=="); // this is the PC key + } + } + + // ** Standard Winforms Main ** // + //[STAThread] + //static void Main() + //{ + // Application.EnableVisualStyles(); + // Application.SetCompatibleTextRenderingDefault(false); + // Application.Run(new Form1()); + //} + } } diff --git a/Utilities/WebUtilities/RequestManager.cs b/Utilities/WebUtilities/RequestManager.cs index 4dd04f23a..0b8182a25 100644 --- a/Utilities/WebUtilities/RequestManager.cs +++ b/Utilities/WebUtilities/RequestManager.cs @@ -157,7 +157,7 @@ namespace MatterHackers.MatterControl } catch (Exception e) { - MatterControlApplication.Instance.ReportException(e); + System.Diagnostics.Trace.WriteLine(e.Message); } } return request;