From 9ca8c0583b2a891c57b5f11db6118a34b7c21dd0 Mon Sep 17 00:00:00 2001 From: Matthew Connelly Date: Tue, 19 Nov 2019 11:31:53 +0000 Subject: [PATCH] switch UI app to .net core --- {paperangapp => PaperangPad}/App.xaml | 4 +- PaperangPad/App.xaml.cs | 15 ++ {paperangapp => PaperangPad}/LUITextbox.cs | 2 +- {paperangapp => PaperangPad}/MainWindow.xaml | 14 +- .../MainWindow.xaml.cs | 13 +- PaperangPad/PaperangPad.csproj | 25 ++ liblogtiny/liblogtiny.csproj | 2 +- libpaperang.sln | 15 +- libpaperang/libpaperang.csproj | 2 +- paperangapp/App.config | 18 -- paperangapp/App.xaml.cs | 9 - paperangapp/Properties/AssemblyInfo.cs | 53 ---- paperangapp/Properties/Resources.Designer.cs | 63 ----- paperangapp/Properties/Resources.resx | 117 --------- paperangapp/Properties/Settings.Designer.cs | 26 -- paperangapp/Properties/Settings.settings | 7 - paperangapp/packages.config | 29 -- paperangapp/paperangapp.csproj | 248 ------------------ 18 files changed, 68 insertions(+), 594 deletions(-) rename {paperangapp => PaperangPad}/App.xaml (74%) create mode 100644 PaperangPad/App.xaml.cs rename {paperangapp => PaperangPad}/LUITextbox.cs (98%) rename {paperangapp => PaperangPad}/MainWindow.xaml (90%) rename {paperangapp => PaperangPad}/MainWindow.xaml.cs (98%) create mode 100644 PaperangPad/PaperangPad.csproj delete mode 100644 paperangapp/App.config delete mode 100644 paperangapp/App.xaml.cs delete mode 100644 paperangapp/Properties/AssemblyInfo.cs delete mode 100644 paperangapp/Properties/Resources.Designer.cs delete mode 100644 paperangapp/Properties/Resources.resx delete mode 100644 paperangapp/Properties/Settings.Designer.cs delete mode 100644 paperangapp/Properties/Settings.settings delete mode 100644 paperangapp/packages.config delete mode 100644 paperangapp/paperangapp.csproj diff --git a/paperangapp/App.xaml b/PaperangPad/App.xaml similarity index 74% rename from paperangapp/App.xaml rename to PaperangPad/App.xaml index 1748407..7fbfa61 100644 --- a/paperangapp/App.xaml +++ b/PaperangPad/App.xaml @@ -1,7 +1,7 @@ - diff --git a/PaperangPad/App.xaml.cs b/PaperangPad/App.xaml.cs new file mode 100644 index 0000000..c55a728 --- /dev/null +++ b/PaperangPad/App.xaml.cs @@ -0,0 +1,15 @@ +using System; +using System.Collections.Generic; +using System.Configuration; +using System.Data; +using System.Linq; +using System.Threading.Tasks; +using System.Windows; + +namespace PaperangPad { + /// + /// Interaction logic for App.xaml + /// + public partial class App : Application { + } +} diff --git a/paperangapp/LUITextbox.cs b/PaperangPad/LUITextbox.cs similarity index 98% rename from paperangapp/LUITextbox.cs rename to PaperangPad/LUITextbox.cs index f6ff40b..f33499f 100644 --- a/paperangapp/LUITextbox.cs +++ b/PaperangPad/LUITextbox.cs @@ -1,7 +1,7 @@ using System.ComponentModel; using liblogtiny; -namespace paperangapp { +namespace PaperangPad { class LUITextbox : ILogTiny, INotifyPropertyChanged { public event PropertyChangedEventHandler PropertyChanged; protected void OnPropertyChanged(string propertyName) => diff --git a/paperangapp/MainWindow.xaml b/PaperangPad/MainWindow.xaml similarity index 90% rename from paperangapp/MainWindow.xaml rename to PaperangPad/MainWindow.xaml index a7a0639..7bddf8b 100644 --- a/paperangapp/MainWindow.xaml +++ b/PaperangPad/MainWindow.xaml @@ -1,10 +1,10 @@ - diff --git a/paperangapp/MainWindow.xaml.cs b/PaperangPad/MainWindow.xaml.cs similarity index 98% rename from paperangapp/MainWindow.xaml.cs rename to PaperangPad/MainWindow.xaml.cs index cc3bb4a..4fe2384 100644 --- a/paperangapp/MainWindow.xaml.cs +++ b/PaperangPad/MainWindow.xaml.cs @@ -1,18 +1,22 @@ using AForge.Imaging.Filters; using System; using System.Drawing; +using System.Drawing.Drawing2D; using System.Drawing.Imaging; using System.IO; using System.Threading.Tasks; using System.Timers; using System.Windows; -using System.Windows.Forms; using liblogtiny; using libpaperang; using libpaperang.Interfaces; using libpaperang.Main; +using System.Windows.Forms; -namespace paperangapp { +namespace PaperangPad { + /// + /// Interaction logic for MainWindow.xaml + /// public partial class MainWindow : Window { //TODO memory optimisation - this thing is a hongery boi private ILogTiny logger; @@ -66,7 +70,10 @@ namespace paperangapp { usbpoll.Elapsed += EvtUsbPoll; usbpoll.Start(); logger.Verbose("USB presence interval event started"); - byte _szW; byte _szH; int _szM; int _sc; + byte _szW; + byte _szH; + int _szM; + int _sc; //bayer2 _szW = (byte)(bayer2.GetUpperBound(1) + 1); _szH = (byte)(bayer2.GetUpperBound(0) + 1); diff --git a/PaperangPad/PaperangPad.csproj b/PaperangPad/PaperangPad.csproj new file mode 100644 index 0000000..376bd25 --- /dev/null +++ b/PaperangPad/PaperangPad.csproj @@ -0,0 +1,25 @@ + + + + WinExe + netcoreapp3.0 + true + + + + + + + + + + + + + + + ..\..\..\..\..\..\Program Files (x86)\Reference Assemblies\Microsoft\Framework\.NETFramework\v4.7.2\System.Windows.Forms.dll + + + + \ No newline at end of file diff --git a/liblogtiny/liblogtiny.csproj b/liblogtiny/liblogtiny.csproj index 5eef989..94e42d5 100644 --- a/liblogtiny/liblogtiny.csproj +++ b/liblogtiny/liblogtiny.csproj @@ -1,7 +1,7 @@  - netstandard2.0 + netstandard1.4 diff --git a/libpaperang.sln b/libpaperang.sln index 4bce014..01ec029 100644 --- a/libpaperang.sln +++ b/libpaperang.sln @@ -3,25 +3,18 @@ Microsoft Visual Studio Solution File, Format Version 12.00 # Visual Studio Version 16 VisualStudioVersion = 16.0.29215.179 MinimumVisualStudioVersion = 10.0.40219.1 -Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "paperangapp", "paperangapp\paperangapp.csproj", "{677A8867-809E-4476-A9AE-7BEB5CE02F96}" - ProjectSection(ProjectDependencies) = postProject - {A429CCEB-9331-4CD9-B3C0-A8F736732DEA} = {A429CCEB-9331-4CD9-B3C0-A8F736732DEA} - EndProjectSection -EndProject Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "libpaperang", "libpaperang\libpaperang.csproj", "{A429CCEB-9331-4CD9-B3C0-A8F736732DEA}" EndProject Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "liblogtiny", "liblogtiny\liblogtiny.csproj", "{B7D242A8-F9DE-450B-9C87-5519CA782193}" EndProject +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "PaperangPad", "PaperangPad\PaperangPad.csproj", "{3D8CEAAD-A9C6-4DA0-B3EC-36D69A05B6EB}" +EndProject Global GlobalSection(SolutionConfigurationPlatforms) = preSolution Debug|Any CPU = Debug|Any CPU Release|Any CPU = Release|Any CPU EndGlobalSection GlobalSection(ProjectConfigurationPlatforms) = postSolution - {677A8867-809E-4476-A9AE-7BEB5CE02F96}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {677A8867-809E-4476-A9AE-7BEB5CE02F96}.Debug|Any CPU.Build.0 = Debug|Any CPU - {677A8867-809E-4476-A9AE-7BEB5CE02F96}.Release|Any CPU.ActiveCfg = Release|Any CPU - {677A8867-809E-4476-A9AE-7BEB5CE02F96}.Release|Any CPU.Build.0 = Release|Any CPU {A429CCEB-9331-4CD9-B3C0-A8F736732DEA}.Debug|Any CPU.ActiveCfg = Debug|Any CPU {A429CCEB-9331-4CD9-B3C0-A8F736732DEA}.Debug|Any CPU.Build.0 = Debug|Any CPU {A429CCEB-9331-4CD9-B3C0-A8F736732DEA}.Release|Any CPU.ActiveCfg = Release|Any CPU @@ -30,6 +23,10 @@ Global {B7D242A8-F9DE-450B-9C87-5519CA782193}.Debug|Any CPU.Build.0 = Debug|Any CPU {B7D242A8-F9DE-450B-9C87-5519CA782193}.Release|Any CPU.ActiveCfg = Release|Any CPU {B7D242A8-F9DE-450B-9C87-5519CA782193}.Release|Any CPU.Build.0 = Release|Any CPU + {3D8CEAAD-A9C6-4DA0-B3EC-36D69A05B6EB}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {3D8CEAAD-A9C6-4DA0-B3EC-36D69A05B6EB}.Debug|Any CPU.Build.0 = Debug|Any CPU + {3D8CEAAD-A9C6-4DA0-B3EC-36D69A05B6EB}.Release|Any CPU.ActiveCfg = Release|Any CPU + {3D8CEAAD-A9C6-4DA0-B3EC-36D69A05B6EB}.Release|Any CPU.Build.0 = Release|Any CPU EndGlobalSection GlobalSection(SolutionProperties) = preSolution HideSolutionNode = FALSE diff --git a/libpaperang/libpaperang.csproj b/libpaperang/libpaperang.csproj index b5bb490..5482bc3 100644 --- a/libpaperang/libpaperang.csproj +++ b/libpaperang/libpaperang.csproj @@ -1,7 +1,7 @@  - netstandard2.0 + netstandard1.6 diff --git a/paperangapp/App.config b/paperangapp/App.config deleted file mode 100644 index 484e465..0000000 --- a/paperangapp/App.config +++ /dev/null @@ -1,18 +0,0 @@ - - - - - - - - - - - - - - - - - - \ No newline at end of file diff --git a/paperangapp/App.xaml.cs b/paperangapp/App.xaml.cs deleted file mode 100644 index a5e8eab..0000000 --- a/paperangapp/App.xaml.cs +++ /dev/null @@ -1,9 +0,0 @@ -using System.Windows; - -namespace paperangapp { - /// - /// Interaction logic for App.xaml - /// - public partial class App : Application { - } -} diff --git a/paperangapp/Properties/AssemblyInfo.cs b/paperangapp/Properties/AssemblyInfo.cs deleted file mode 100644 index cfa7934..0000000 --- a/paperangapp/Properties/AssemblyInfo.cs +++ /dev/null @@ -1,53 +0,0 @@ -using System.Reflection; -using System.Runtime.InteropServices; -using System.Windows; - -// General Information about an assembly is controlled through the following -// set of attributes. Change these attribute values to modify the information -// associated with an assembly. -[assembly: AssemblyTitle("paperangapp")] -[assembly: AssemblyDescription("")] -[assembly: AssemblyConfiguration("")] -[assembly: AssemblyCompany("")] -[assembly: AssemblyProduct("paperangapp")] -[assembly: AssemblyCopyright("Copyright © 2019")] -[assembly: AssemblyTrademark("")] -[assembly: AssemblyCulture("")] - -// Setting ComVisible to false makes the types in this assembly not visible -// to COM components. If you need to access a type in this assembly from -// COM, set the ComVisible attribute to true on that type. -[assembly: ComVisible(false)] - -//In order to begin building localizable applications, set -//CultureYouAreCodingWith in your .csproj file -//inside a . For example, if you are using US english -//in your source files, set the to en-US. Then uncomment -//the NeutralResourceLanguage attribute below. Update the "en-US" in -//the line below to match the UICulture setting in the project file. - -//[assembly: NeutralResourcesLanguage("en-US", UltimateResourceFallbackLocation.Satellite)] - - -[assembly: ThemeInfo( - ResourceDictionaryLocation.None, //where theme specific resource dictionaries are located - //(used if a resource is not found in the page, - // or application resource dictionaries) - ResourceDictionaryLocation.SourceAssembly //where the generic resource dictionary is located - //(used if a resource is not found in the page, - // app, or any theme specific resource dictionaries) -)] - - -// Version information for an assembly consists of the following four values: -// -// Major Version -// Minor Version -// Build Number -// Revision -// -// You can specify all the values or you can default the Build and Revision Numbers -// by using the '*' as shown below: -// [assembly: AssemblyVersion("1.0.*")] -[assembly: AssemblyVersion("1.0.0.0")] -[assembly: AssemblyFileVersion("1.0.0.0")] diff --git a/paperangapp/Properties/Resources.Designer.cs b/paperangapp/Properties/Resources.Designer.cs deleted file mode 100644 index a3e157b..0000000 --- a/paperangapp/Properties/Resources.Designer.cs +++ /dev/null @@ -1,63 +0,0 @@ -//------------------------------------------------------------------------------ -// -// This code was generated by a tool. -// Runtime Version:4.0.30319.42000 -// -// Changes to this file may cause incorrect behavior and will be lost if -// the code is regenerated. -// -//------------------------------------------------------------------------------ - -namespace paperangapp.Properties { - using System; - - - /// - /// A strongly-typed resource class, for looking up localized strings, etc. - /// - // This class was auto-generated by the StronglyTypedResourceBuilder - // class via a tool like ResGen or Visual Studio. - // To add or remove a member, edit your .ResX file then rerun ResGen - // with the /str option, or rebuild your VS project. - [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Resources.Tools.StronglyTypedResourceBuilder", "16.0.0.0")] - [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] - [global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()] - internal class Resources { - - private static global::System.Resources.ResourceManager resourceMan; - - private static global::System.Globalization.CultureInfo resourceCulture; - - [global::System.Diagnostics.CodeAnalysis.SuppressMessageAttribute("Microsoft.Performance", "CA1811:AvoidUncalledPrivateCode")] - internal Resources() { - } - - /// - /// Returns the cached ResourceManager instance used by this class. - /// - [global::System.ComponentModel.EditorBrowsableAttribute(global::System.ComponentModel.EditorBrowsableState.Advanced)] - internal static global::System.Resources.ResourceManager ResourceManager { - get { - if (object.ReferenceEquals(resourceMan, null)) { - global::System.Resources.ResourceManager temp = new global::System.Resources.ResourceManager("paperangapp.Properties.Resources", typeof(Resources).Assembly); - resourceMan = temp; - } - return resourceMan; - } - } - - /// - /// Overrides the current thread's CurrentUICulture property for all - /// resource lookups using this strongly typed resource class. - /// - [global::System.ComponentModel.EditorBrowsableAttribute(global::System.ComponentModel.EditorBrowsableState.Advanced)] - internal static global::System.Globalization.CultureInfo Culture { - get { - return resourceCulture; - } - set { - resourceCulture = value; - } - } - } -} diff --git a/paperangapp/Properties/Resources.resx b/paperangapp/Properties/Resources.resx deleted file mode 100644 index af7dbeb..0000000 --- a/paperangapp/Properties/Resources.resx +++ /dev/null @@ -1,117 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - text/microsoft-resx - - - 2.0 - - - System.Resources.ResXResourceReader, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - - System.Resources.ResXResourceWriter, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - \ No newline at end of file diff --git a/paperangapp/Properties/Settings.Designer.cs b/paperangapp/Properties/Settings.Designer.cs deleted file mode 100644 index 44e4dee..0000000 --- a/paperangapp/Properties/Settings.Designer.cs +++ /dev/null @@ -1,26 +0,0 @@ -//------------------------------------------------------------------------------ -// -// This code was generated by a tool. -// Runtime Version:4.0.30319.42000 -// -// Changes to this file may cause incorrect behavior and will be lost if -// the code is regenerated. -// -//------------------------------------------------------------------------------ - -namespace paperangapp.Properties { - - - [global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()] - [global::System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.VisualStudio.Editors.SettingsDesigner.SettingsSingleFileGenerator", "16.2.0.0")] - internal sealed partial class Settings : global::System.Configuration.ApplicationSettingsBase { - - private static Settings defaultInstance = ((Settings)(global::System.Configuration.ApplicationSettingsBase.Synchronized(new Settings()))); - - public static Settings Default { - get { - return defaultInstance; - } - } - } -} diff --git a/paperangapp/Properties/Settings.settings b/paperangapp/Properties/Settings.settings deleted file mode 100644 index 033d7a5..0000000 --- a/paperangapp/Properties/Settings.settings +++ /dev/null @@ -1,7 +0,0 @@ - - - - - - - \ No newline at end of file diff --git a/paperangapp/packages.config b/paperangapp/packages.config deleted file mode 100644 index 338b932..0000000 --- a/paperangapp/packages.config +++ /dev/null @@ -1,29 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - \ No newline at end of file diff --git a/paperangapp/paperangapp.csproj b/paperangapp/paperangapp.csproj deleted file mode 100644 index aef1465..0000000 --- a/paperangapp/paperangapp.csproj +++ /dev/null @@ -1,248 +0,0 @@ - - - - - Debug - AnyCPU - {677A8867-809E-4476-A9AE-7BEB5CE02F96} - WinExe - paperangapp - libpaperang-test-ui - v4.7.2 - 512 - {60dc8134-eba5-43b8-bcc9-bb4bc16c2548};{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC} - 4 - true - true - true - - - c:\swdep\paperang\ - true - Web - true - Foreground - 7 - Days - false - false - true - https://swdist.ext.maff.scot/paperang/ - true - publish.htm - 6 - 1.0.0.%2a - false - true - true - - - AnyCPU - true - full - false - bin\Debug\ - DEBUG;TRACE - prompt - 4 - false - - - AnyCPU - none - true - bin\Release\ - - - prompt - 4 - false - true - - - C9E8C53D36488D4F4CBA62BF7D60BC1DBE0648B1 - - - paperangapp_TemporaryKey.pfx - - - true - - - false - - - - ..\packages\AForge.2.2.5\lib\AForge.dll - - - ..\packages\AForge.Imaging.2.2.5\lib\AForge.Imaging.dll - - - ..\packages\AForge.Math.2.2.5\lib\AForge.Math.dll - - - ..\packages\LibUsbDotNet.2.2.29\lib\net45\LibUsbDotNet.LibUsbDotNet.dll - - - - ..\packages\System.Collections.Specialized.4.3.0\lib\net46\System.Collections.Specialized.dll - True - True - - - - - ..\packages\System.Diagnostics.FileVersionInfo.4.3.0\lib\net46\System.Diagnostics.FileVersionInfo.dll - True - True - - - ..\packages\System.Diagnostics.TraceSource.4.3.0\lib\net46\System.Diagnostics.TraceSource.dll - True - True - - - - ..\packages\System.Drawing.Common.4.6.0\lib\net461\System.Drawing.Common.dll - - - ..\packages\System.IO.4.3.0\lib\net462\System.IO.dll - True - True - - - ..\packages\System.IO.FileSystem.4.3.0\lib\net46\System.IO.FileSystem.dll - True - True - - - ..\packages\System.IO.FileSystem.Primitives.4.3.0\lib\net46\System.IO.FileSystem.Primitives.dll - True - True - - - ..\packages\System.Runtime.4.3.1\lib\net462\System.Runtime.dll - True - True - - - ..\packages\System.Runtime.Extensions.4.3.1\lib\net462\System.Runtime.Extensions.dll - True - True - - - ..\packages\System.Runtime.InteropServices.4.3.0\lib\net463\System.Runtime.InteropServices.dll - True - True - - - ..\packages\System.Runtime.InteropServices.RuntimeInformation.4.3.0\lib\net45\System.Runtime.InteropServices.RuntimeInformation.dll - True - True - - - ..\packages\System.Security.AccessControl.4.6.0\lib\net461\System.Security.AccessControl.dll - - - ..\packages\System.Security.Principal.Windows.4.6.0\lib\net461\System.Security.Principal.Windows.dll - - - ..\packages\System.Threading.Overlapped.4.3.0\lib\net46\System.Threading.Overlapped.dll - True - True - - - ..\packages\System.Threading.Thread.4.3.0\lib\net46\System.Threading.Thread.dll - True - True - - - ..\packages\System.Threading.ThreadPool.4.3.0\lib\net46\System.Threading.ThreadPool.dll - True - True - - - - - - - - - - 4.0 - - - - - - - - MSBuild:Compile - Designer - - - MSBuild:Compile - Designer - - - App.xaml - Code - - - - MainWindow.xaml - Code - - - - - Code - - - True - True - Resources.resx - - - True - Settings.settings - True - - - ResXFileCodeGenerator - Resources.Designer.cs - - - - SettingsSingleFileGenerator - Settings.Designer.cs - - - - - - - - {b7d242a8-f9de-450b-9c87-5519ca782193} - liblogtiny - - - {a429cceb-9331-4cd9-b3c0-a8f736732dea} - libpaperang - - - - - False - Microsoft .NET Framework 4.7.2 %28x86 and x64%29 - true - - - False - .NET Framework 3.5 SP1 - false - - - - \ No newline at end of file