diff --git a/DeveloperLabs/MyEmployees/ExportDataLibrary/ExportDataLibrary.csproj b/DeveloperLabs/MyEmployees/ExportDataLibrary/ExportDataLibrary.csproj index fbdfea7..ce9940f 100644 --- a/DeveloperLabs/MyEmployees/ExportDataLibrary/ExportDataLibrary.csproj +++ b/DeveloperLabs/MyEmployees/ExportDataLibrary/ExportDataLibrary.csproj @@ -1,105 +1,39 @@ - - - + - Debug - AnyCPU - {CE812A43-7F69-4361-9B0B-43AA20739446} + netstandard2.0 Library - Properties - ExportDataLibrary - ExportDataLibrary - v4.7.2 - 512 - true - - - true - full - false - bin\Debug\ - DEBUG;TRACE - prompt - 4 - - - pdbonly - true - bin\Release\ - TRACE - prompt - 4 + false - true bin\x86\Debug\ - DEBUG;TRACE - full - x86 - 7.3 - prompt MinimumRecommendedRules.ruleset bin\x86\Release\ - TRACE - true - pdbonly - x86 - 7.3 - prompt MinimumRecommendedRules.ruleset - true bin\x64\Debug\ - DEBUG;TRACE - full - x64 - 7.3 - prompt MinimumRecommendedRules.ruleset bin\x64\Release\ - TRACE - true - pdbonly - x64 - 7.3 - prompt MinimumRecommendedRules.ruleset - - - - - - - - - - - - - - - - {a8814208-9b34-41c9-b0d0-b31a6c11af27} - MyEmployees.PluginInterface - - - - + 9.0.0 + + 4.5.0 + + all + - \ No newline at end of file diff --git a/DeveloperLabs/MyEmployees/MyEmployees.Package/MyEmployees.Package.wapproj b/DeveloperLabs/MyEmployees/MyEmployees.Package/MyEmployees.Package.wapproj index 88b3a0f..16a3168 100644 --- a/DeveloperLabs/MyEmployees/MyEmployees.Package/MyEmployees.Package.wapproj +++ b/DeveloperLabs/MyEmployees/MyEmployees.Package/MyEmployees.Package.wapproj @@ -102,6 +102,12 @@ + + + + build + + PreserveNewest diff --git a/DeveloperLabs/MyEmployees/MyEmployees.PluginInterface/MyEmployees.PluginInterface.csproj b/DeveloperLabs/MyEmployees/MyEmployees.PluginInterface/MyEmployees.PluginInterface.csproj index acc808f..c91f72b 100644 --- a/DeveloperLabs/MyEmployees/MyEmployees.PluginInterface/MyEmployees.PluginInterface.csproj +++ b/DeveloperLabs/MyEmployees/MyEmployees.PluginInterface/MyEmployees.PluginInterface.csproj @@ -1,88 +1,30 @@ - - - + - Debug - AnyCPU - {A8814208-9B34-41C9-B0D0-B31A6C11AF27} + netstandard2.0 Library - Properties - MyEmployees.PluginInterface - MyEmployees.PluginInterface - v4.7.2 - 512 - true - - - true - full - false - bin\Debug\ - DEBUG;TRACE - prompt - 4 - - - pdbonly - true - bin\Release\ - TRACE - prompt - 4 + false - true bin\x86\Debug\ - DEBUG;TRACE - full - x86 - 7.3 - prompt MinimumRecommendedRules.ruleset bin\x86\Release\ - TRACE - true - pdbonly - x86 - 7.3 - prompt MinimumRecommendedRules.ruleset - true bin\x64\Debug\ - DEBUG;TRACE - full - x64 - 7.3 - prompt MinimumRecommendedRules.ruleset bin\x64\Release\ - TRACE - true - pdbonly - x64 - 7.3 - prompt MinimumRecommendedRules.ruleset - - - - - - - - - - - - + + + + all + - \ No newline at end of file diff --git a/DeveloperLabs/MyEmployees/MyEmployees.sln b/DeveloperLabs/MyEmployees/MyEmployees.sln index 1ea9af9..53fc4bc 100644 --- a/DeveloperLabs/MyEmployees/MyEmployees.sln +++ b/DeveloperLabs/MyEmployees/MyEmployees.sln @@ -1,13 +1,13 @@  Microsoft Visual Studio Solution File, Format Version 12.00 -# Visual Studio Version 16 -VisualStudioVersion = 16.0.28606.126 +# Visual Studio Version 17 +VisualStudioVersion = 17.2.32516.85 MinimumVisualStudioVersion = 10.0.40219.1 -Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "MyEmployees", "MyEmployees\MyEmployees.csproj", "{6C859FC9-03B3-4D7D-B83E-A276457C80F6}" +Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "MyEmployees", "MyEmployees\MyEmployees.csproj", "{6C859FC9-03B3-4D7D-B83E-A276457C80F6}" EndProject -Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "ExportDataLibrary", "ExportDataLibrary\ExportDataLibrary.csproj", "{CE812A43-7F69-4361-9B0B-43AA20739446}" +Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "ExportDataLibrary", "ExportDataLibrary\ExportDataLibrary.csproj", "{CE812A43-7F69-4361-9B0B-43AA20739446}" EndProject -Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "MyEmployees.PluginInterface", "MyEmployees.PluginInterface\MyEmployees.PluginInterface.csproj", "{A8814208-9B34-41C9-B0D0-B31A6C11AF27}" +Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "MyEmployees.PluginInterface", "MyEmployees.PluginInterface\MyEmployees.PluginInterface.csproj", "{A8814208-9B34-41C9-B0D0-B31A6C11AF27}" EndProject Project("{C7167F0D-BC9F-4E6E-AFE1-012C56B48DB5}") = "MyEmployees.Package", "MyEmployees.Package\MyEmployees.Package.wapproj", "{80DB0989-9307-466B-ABA0-9F82D424CBD8}" EndProject @@ -25,8 +25,8 @@ Global Release|x86 = Release|x86 EndGlobalSection GlobalSection(ProjectConfigurationPlatforms) = postSolution - {6C859FC9-03B3-4D7D-B83E-A276457C80F6}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {6C859FC9-03B3-4D7D-B83E-A276457C80F6}.Debug|Any CPU.Build.0 = Debug|Any CPU + {6C859FC9-03B3-4D7D-B83E-A276457C80F6}.Debug|Any CPU.ActiveCfg = Debug|x86 + {6C859FC9-03B3-4D7D-B83E-A276457C80F6}.Debug|Any CPU.Build.0 = Debug|x86 {6C859FC9-03B3-4D7D-B83E-A276457C80F6}.Debug|ARM.ActiveCfg = Debug|Any CPU {6C859FC9-03B3-4D7D-B83E-A276457C80F6}.Debug|ARM.Build.0 = Debug|Any CPU {6C859FC9-03B3-4D7D-B83E-A276457C80F6}.Debug|ARM64.ActiveCfg = Debug|Any CPU @@ -51,8 +51,8 @@ Global {CE812A43-7F69-4361-9B0B-43AA20739446}.Debug|ARM.Build.0 = Debug|Any CPU {CE812A43-7F69-4361-9B0B-43AA20739446}.Debug|ARM64.ActiveCfg = Debug|Any CPU {CE812A43-7F69-4361-9B0B-43AA20739446}.Debug|ARM64.Build.0 = Debug|Any CPU - {CE812A43-7F69-4361-9B0B-43AA20739446}.Debug|x64.ActiveCfg = Debug|x64 - {CE812A43-7F69-4361-9B0B-43AA20739446}.Debug|x64.Build.0 = Debug|x64 + {CE812A43-7F69-4361-9B0B-43AA20739446}.Debug|x64.ActiveCfg = Debug|Any CPU + {CE812A43-7F69-4361-9B0B-43AA20739446}.Debug|x64.Build.0 = Debug|Any CPU {CE812A43-7F69-4361-9B0B-43AA20739446}.Debug|x86.ActiveCfg = Debug|x86 {CE812A43-7F69-4361-9B0B-43AA20739446}.Debug|x86.Build.0 = Debug|x86 {CE812A43-7F69-4361-9B0B-43AA20739446}.Release|Any CPU.ActiveCfg = Release|Any CPU @@ -71,8 +71,8 @@ Global {A8814208-9B34-41C9-B0D0-B31A6C11AF27}.Debug|ARM.Build.0 = Debug|Any CPU {A8814208-9B34-41C9-B0D0-B31A6C11AF27}.Debug|ARM64.ActiveCfg = Debug|Any CPU {A8814208-9B34-41C9-B0D0-B31A6C11AF27}.Debug|ARM64.Build.0 = Debug|Any CPU - {A8814208-9B34-41C9-B0D0-B31A6C11AF27}.Debug|x64.ActiveCfg = Debug|x64 - {A8814208-9B34-41C9-B0D0-B31A6C11AF27}.Debug|x64.Build.0 = Debug|x64 + {A8814208-9B34-41C9-B0D0-B31A6C11AF27}.Debug|x64.ActiveCfg = Debug|Any CPU + {A8814208-9B34-41C9-B0D0-B31A6C11AF27}.Debug|x64.Build.0 = Debug|Any CPU {A8814208-9B34-41C9-B0D0-B31A6C11AF27}.Debug|x86.ActiveCfg = Debug|x86 {A8814208-9B34-41C9-B0D0-B31A6C11AF27}.Debug|x86.Build.0 = Debug|x86 {A8814208-9B34-41C9-B0D0-B31A6C11AF27}.Release|Any CPU.ActiveCfg = Release|Any CPU diff --git a/DeveloperLabs/MyEmployees/MyEmployees/Form1.cs b/DeveloperLabs/MyEmployees/MyEmployees/Form1.cs index 79809e2..ae24364 100644 --- a/DeveloperLabs/MyEmployees/MyEmployees/Form1.cs +++ b/DeveloperLabs/MyEmployees/MyEmployees/Form1.cs @@ -33,6 +33,7 @@ private void Form1_Load(object sender, EventArgs e) LoadConfig(); LoadData(); CheckKioskMode(); + MyEmployees.Helpers.WinAppSDK.initializeWinAppRuntime(); //await CheckForUpdates(); } diff --git a/DeveloperLabs/MyEmployees/MyEmployees/Helpers/WinAppSDK.cs b/DeveloperLabs/MyEmployees/MyEmployees/Helpers/WinAppSDK.cs new file mode 100644 index 0000000..cf144a1 --- /dev/null +++ b/DeveloperLabs/MyEmployees/MyEmployees/Helpers/WinAppSDK.cs @@ -0,0 +1,71 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; +using System.Windows.Forms; +using Microsoft.Windows.ApplicationModel.WindowsAppRuntime; + +namespace MyEmployees.Helpers +{ + /// + /// Provides methods to get the status of the WindowsAppRuntime and attempt to initialize it if required + /// + public class WinAppSDK + { + /// + /// Attempts to get initialize WindowsAppRuntime by deploying required packages if they are not present + /// + public static void initializeWinAppRuntime() + { + if (DeploymentManager.GetStatus().Status != DeploymentStatus.Ok) + { + // Initialize does a status check, and if the status is not Ok it will attempt to get + // the WindowsAppRuntime into a good state by deploying packages. Unlike a simple + // status check, Initialize can sometimes take several seconds to deploy the packages. + // These should be run on a separate thread so as not to hang your app while the + // packages deploy. + var initializeTask = Task.Run(() => DeploymentManager.Initialize()); + initializeTask.Wait(); + if (initializeTask.Result.Status == DeploymentStatus.Ok) + { + MessageBox.Show("The WindowsAppRuntime was successfully initialized and is now ready for use!"); + } + else + { + MessageBox.Show("Result ExtendedError: " + initializeTask.Result.ExtendedError.ToString()); + // The WindowsAppRuntime is in a bad state which Initialize() did not fix. + // Do error reporting or gather information for submitting a bug. + // Gracefully exit the program or carry on without using the WindowsAppRuntime. + MessageBox.Show("Initialize() failed to ensure the WindowsAppRuntime."); + } + } + else + { + MessageBox.Show("The WindowsAppRuntime was already in an Ok status, no action taken."); + } + } + + /// + /// Checks to see if the packages required for the WindowsAppRuntime are present + /// + public static void getWinAppRuntimeStatus() + { + // GetStatus() is a fast check to see if all of the packages the WindowsAppRuntime + // requires and expects are present in in an Ok state. + DeploymentResult result = DeploymentManager.GetStatus(); + + // Check the resulting Status. + if (result.Status == DeploymentStatus.Ok) + { + MessageBox.Show("The WindowsAppRuntime is ready for use!"); + } + else + { + // A not-Ok status means it is not ready for us. The Status will indicate the + // reason it is not Ok, such as some packages need to be installed. + MessageBox.Show("The WindowsAppRuntime is not ready for use."); + } + } + } +} diff --git a/DeveloperLabs/MyEmployees/MyEmployees/MyEmployees.csproj b/DeveloperLabs/MyEmployees/MyEmployees/MyEmployees.csproj index ccfc519..12dbf45 100644 --- a/DeveloperLabs/MyEmployees/MyEmployees/MyEmployees.csproj +++ b/DeveloperLabs/MyEmployees/MyEmployees/MyEmployees.csproj @@ -1,141 +1,39 @@ - - - + - Debug - AnyCPU - {6C859FC9-03B3-4D7D-B83E-A276457C80F6} + net6.0-windows10.0.17763.0 WinExe - MyEmployees - MyEmployees - v4.7.2 - 512 - true - true - - - - - - AnyCPU - true - full - false - bin\Debug\ - DEBUG;TRACE - prompt - 4 - - - AnyCPU - pdbonly - true - bin\Release\ - TRACE - prompt - 4 + false + true + x86;x64;arm64 + win10-x86;win10-x64;win10-arm64 + true contoso_5Ob_icon.ico - true bin\x86\Debug\ - DEBUG;TRACE - full - x86 - 7.3 - prompt MinimumRecommendedRules.ruleset - true bin\x86\Release\ - TRACE - true - pdbonly - x86 - 7.3 - prompt MinimumRecommendedRules.ruleset - true - true bin\x64\Debug\ - DEBUG;TRACE - full - x64 - 7.3 - prompt MinimumRecommendedRules.ruleset - true bin\x64\Release\ - TRACE - true - pdbonly - x64 - 7.3 - prompt MinimumRecommendedRules.ruleset - true - - - - - - - - - - - - - - - - - Form - - - AboutForm.cs - - - - - Form - - - Form1.cs - - - - - AboutForm.cs - - - Form1.cs - - - ResXFileCodeGenerator - Resources.Designer.cs - Designer - - - True - Resources.resx - True - - + Always @@ -143,47 +41,38 @@ PreserveNewest - + Designer - - SettingsSingleFileGenerator - Settings.Designer.cs - - - True - Settings.settings - True - - - - - - {a8814208-9b34-41c9-b0d0-b31a6c11af27} - MyEmployees.PluginInterface - + 9.0.0 - - 10.0.18362.2005 - + + + 12.0.1 4.5.11 + + 1.0.109.2 4.5.0 + + + all + + - \ No newline at end of file diff --git a/DeveloperLabs/MyEmployees/MyEmployees/Program.cs b/DeveloperLabs/MyEmployees/MyEmployees/Program.cs index e53a823..e75615b 100644 --- a/DeveloperLabs/MyEmployees/MyEmployees/Program.cs +++ b/DeveloperLabs/MyEmployees/MyEmployees/Program.cs @@ -15,6 +15,7 @@ static class Program static void Main() { Application.EnableVisualStyles(); + Application.SetHighDpiMode(HighDpiMode.SystemAware); Application.SetCompatibleTextRenderingDefault(false); Application.Run(new Form1()); } diff --git a/DeveloperLabs/MyEmployees/MyEmployees/appsettings.json b/DeveloperLabs/MyEmployees/MyEmployees/appsettings.json new file mode 100644 index 0000000..0bbdc67 --- /dev/null +++ b/DeveloperLabs/MyEmployees/MyEmployees/appsettings.json @@ -0,0 +1,5 @@ +{ + "ConnectionStrings": { + "LobApp.Properties.Settings.ExpensesConnectionString": "Provider=Microsoft.Jet.OLEDB.4.0;Data Source=|DataDirectory|\\Expenses.mdb" + } +} \ No newline at end of file