From 8b4790e4931f12039aba5bff6f652a1ca4f62def Mon Sep 17 00:00:00 2001 From: John Lewin Date: Thu, 6 Sep 2018 11:31:09 -0700 Subject: [PATCH] Convert MatterControl project to .netstandard2 --- ApplicationView/ApplicationController.cs | 5 + MatterControl.csproj | 783 +++-------------------- Program.cs | 62 +- config-veldrid.json | 10 - 4 files changed, 118 insertions(+), 742 deletions(-) delete mode 100644 config-veldrid.json diff --git a/ApplicationView/ApplicationController.cs b/ApplicationView/ApplicationController.cs index e87c32500..81c699617 100644 --- a/ApplicationView/ApplicationController.cs +++ b/ApplicationView/ApplicationController.cs @@ -43,6 +43,11 @@ using MatterHackers.MatterControl.SlicerConfiguration; using MatterHackers.MatterControl.DesignTools.Operations; using Newtonsoft.Json; using System.Collections.ObjectModel; +using System.Runtime.CompilerServices; + +[assembly: InternalsVisibleTo("MatterControl.Tests")] +[assembly: InternalsVisibleTo("MatterControl.AutomationTests")] +[assembly: InternalsVisibleTo("CloudServices.Tests")] namespace MatterHackers.MatterControl { diff --git a/MatterControl.csproj b/MatterControl.csproj index a2c433744..c95ecffe3 100644 --- a/MatterControl.csproj +++ b/MatterControl.csproj @@ -1,719 +1,100 @@ - - + + - Debug - AnyCPU - {0B8D6F56-BD7F-4426-B858-D9292B084656} - WinExe - Properties - MatterHackers.MatterControl - MatterControl - False - False - False - Auto - - true - PackageReference - true - 4194304 - AnyCPU - 4096 - false - - - - - 2.0 - false - publish\ - true - Disk - false - Foreground - 7 - Days - false - false - true - 0 - 1.0.0.%2a - false - true - 8.0.30703 - 2.0 - v4.7.1 - - .\ + netstandard2.0 + MatterHackers Inc. - - True - full - False - bin\Debug\ - TRACE;DEBUG;USE_OPENGL;IS_WINDOWS;IS_WINDOWS_FORMS - prompt - 4 - AnyCPU - SHOW_MEMORY - false + + + + Off - - none - True - bin\Release\ - TRACE;USE_OPENGL;IS_WINDOWS;IS_WINDOWS_FORMS - prompt - 4 - AnyCPU - true - false + + + - - application.ico - - + - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - Code - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + - - - PdfSharp.dll - - - - - - - - - - - - - + + + - - False - .NET Framework 3.5 SP1 Client Profile - false - - - False - .NET Framework 3.5 SP1 - true - - - False - Windows Installer 3.1 - true - - - - - PreserveNewest - - - - - - - - - - - - - - - - - - - - - {cbdeec31-d688-417b-9bf2-f0db2e4fb268} - MatterControl.OpenGL - - - {97d5ade3-c1b4-4b46-8a3e-718a4f7f079f} - MatterControl.Printing - - - {9b062971-a88e-4a3d-b3c9-12b78d15fa66} - clipper_library - - - {94838988-523c-4b11-ad82-8b9b76f23a31} - DataConverters2D - - - {04667764-dc7b-4b95-aef6-b4e6c87a54e9} - DataConverters3D - - - {e9102310-0029-4d8f-b1e9-88fba6147d45} - GuiAutomation - - - {74f6bb6c-9d02-4512-a59a-21940e35c532} - Gui - - - {036bccba-52d8-457c-84ae-8821f209fe4a} - ImageProcessing - - - {df6845cd-64c6-4263-8357-da8066855739} - MarchingSquares - - - {1a901129-c885-425f-8d4b-86698f98a2b4} - MeshThumbnails - - - {1e01abe0-b494-4fe4-b0d6-540133286887} - RayTracer - - - {d3e41b4e-bfbb-44ca-94c8-95c00f754fdd} - VectorMath - - - {ae37de1f-22f7-49ee-8732-fc6bc8dc58d9} - Tesselate - - - {f1653f20-d47d-4f29-8c55-3c835542af5f} - Community.CsharpSqlite - - - {3df4cb3d-9a03-4256-9a81-70523aad828b} - Launcher - - - {545b6912-77ff-4b34-ba76-6c3d6a32be6a} - RenderOpenGl - - - {86f6aaf2-9b50-40b8-a427-1897d76471c5} - PolygonMesh - - - {865172a0-a1a9-49c2-9386-f2fdb4e141b7} - MatterControlPluginSystem - - - {ca96058c-1a37-465d-a357-d6d695b13d25} - Localizations - - - {657dbc6d-c3ea-4398-a3fa-ddb73c14f71b} - Agg - - - {990a9ad3-b6a4-407b-9dfc-9c722af7c9b9} - InfInstaller - - - {b0aed568-8796-42b9-baa9-ebc796134e78} - MatterSlice - - - {23bd06a4-d017-4dd0-a922-d2aad91c3484} - MatterSliceLib - - - {2c564be1-352d-4ddb-8226-f0981f983c60} - MSClipperLib - - - {8cb3464f-6130-4edb-8dc6-ccd2697fafbb} - Pathfinding - - - {23ec3364-7c93-4169-9ab2-7181c66004c0} - QuadTree - + + + + + + + + + + + + + + + + + + + + + - + - - - - - \ No newline at end of file + + + + PdfSharp.dll + + + + diff --git a/Program.cs b/Program.cs index 15071fbf4..54e16c5c0 100644 --- a/Program.cs +++ b/Program.cs @@ -8,7 +8,7 @@ using MatterHackers.MatterControl.DataStorage; using MatterHackers.MatterControl.SettingsManagement; using MatterHackers.MatterControl.SlicerConfiguration; using Microsoft.Extensions.Configuration; -using Mindscape.Raygun4Net; +//using Mindscape.Raygun4Net; namespace MatterHackers.MatterControl { @@ -18,7 +18,7 @@ namespace MatterHackers.MatterControl private static int raygunNotificationCount = 0; - private static RaygunClient _raygunClient; + //private static RaygunClient _raygunClient; private class SlicerOptions { @@ -39,14 +39,14 @@ namespace MatterHackers.MatterControl Thread.CurrentThread.CurrentCulture = CultureInfo.InvariantCulture; Thread.CurrentThread.CurrentUICulture = CultureInfo.InvariantCulture; - if (AggContext.OperatingSystem == OSType.Mac) - { - _raygunClient = new RaygunClient("qmMBpKy3OSTJj83+tkO7BQ=="); // this is the Mac key - } - else - { - _raygunClient = new RaygunClient("hQIlyUUZRGPyXVXbI6l1dA=="); // this is the PC key - } + //if (AggContext.OperatingSystem == OSType.Mac) + //{ + // _raygunClient = new RaygunClient("qmMBpKy3OSTJj83+tkO7BQ=="); // this is the Mac key + //} + //else + //{ + // _raygunClient = new RaygunClient("hQIlyUUZRGPyXVXbI6l1dA=="); // this is the PC key + //} // Set default Agg providers AggContext.Config.ProviderTypes.SystemWindow = "MatterHackers.Agg.UI.OpenGLSystemWindow, agg_platform_win32"; @@ -71,28 +71,28 @@ namespace MatterHackers.MatterControl Datastore.Instance.Initialize(); -#if !DEBUG - // 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") -#endif - { - System.Windows.Forms.Application.ThreadException += (s, e) => - { - if(raygunNotificationCount++ < RaygunMaxNotifications) - { - _raygunClient.Send(e.Exception); - } - }; +//#if !DEBUG +// // 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") +//#endif +// { +// System.Windows.Forms.Application.ThreadException += (s, e) => +// { +// if(raygunNotificationCount++ < RaygunMaxNotifications) +// { +// _raygunClient.Send(e.Exception); +// } +// }; - AppDomain.CurrentDomain.UnhandledException += (s, e) => - { - if (raygunNotificationCount++ < RaygunMaxNotifications) - { - _raygunClient.Send(e.ExceptionObject as Exception); - } - }; - } +// AppDomain.CurrentDomain.UnhandledException += (s, e) => +// { +// if (raygunNotificationCount++ < RaygunMaxNotifications) +// { +// _raygunClient.Send(e.ExceptionObject as Exception); +// } +// }; +// } // Init platformFeaturesProvider before ShowAsSystemWindow string platformFeaturesProvider = "MatterHackers.MatterControl.WindowsPlatformsFeatures, MatterControl.Winforms"; diff --git a/config-veldrid.json b/config-veldrid.json deleted file mode 100644 index d74e41005..000000000 --- a/config-veldrid.json +++ /dev/null @@ -1,10 +0,0 @@ -{ - "ProviderTypes": { - "OsInformationProvider": "MatterHackers.Agg.Platform.WinformsInformationProvider, agg_platform_win32", - "DialogProvider": "MatterHackers.Agg.Platform.WinformsFileDialogProvider, agg_platform_win32", - "SystemWindow": "MatterHackers.Veldrid.VeldridSystemWindow, MatterHackers.Veldrid", - "SystemWindowProvider": "MatterHackers.Veldrid.VeldridWindowProvider, MatterHackers.Veldrid", - "ImageIOProvider": "MatterHackers.Agg.Image.ImageIOWindowsPlugin, agg_platform_win32", - "StaticDataProvider": "MatterHackers.Agg.FileSystemStaticData, agg_platform_win32" - } -} \ No newline at end of file