diff --git a/HeliosPlus.Shared/ProfileItem.cs b/HeliosPlus.Shared/ProfileItem.cs index 2877070..da65bc6 100644 --- a/HeliosPlus.Shared/ProfileItem.cs +++ b/HeliosPlus.Shared/ProfileItem.cs @@ -134,14 +134,25 @@ namespace HeliosPlus.Shared { get { + IEnumerable currentDisplays = WindowsDisplayAPI.Display.GetDisplays(); + foreach (Display availableDisplay in currentDisplays) + { + if (availableDisplay.IsAvailable) + Console.WriteLine(""); + } + // Find the list of TargetDisplays we currently have from the currentprofile List availableDevicePaths = new List(); ProfileViewport[] availableViewports = ProfileRepository.CurrentProfile.Viewports; + foreach (ProfileViewport availableViewport in availableViewports) { + PathInfo pathInfo = availableViewport.ToPathInfo(); + //pathInfo.TargetsInfo; foreach (ProfileViewportTargetDisplay realTD in availableViewport.TargetDisplays) { - availableDevicePaths.Add(realTD.DevicePath); + string devicePath = realTD.DevicePath; + availableDevicePaths.Add(devicePath); } } diff --git a/HeliosPlus.Shared/ProfileRepository.cs b/HeliosPlus.Shared/ProfileRepository.cs index 26716ca..829e778 100644 --- a/HeliosPlus.Shared/ProfileRepository.cs +++ b/HeliosPlus.Shared/ProfileRepository.cs @@ -110,7 +110,7 @@ namespace HeliosPlus.Shared } #endregion - + #region Class Methods public static bool AddProfile(ProfileItem Profile) { @@ -156,6 +156,7 @@ namespace HeliosPlus.Shared } + public static bool RemoveProfile(ProfileItem Profile) { if (!(Profile is ProfileItem)) diff --git a/HeliosPlus.Tests/Data/Profiles/DisplayProfiles_1.0.json b/HeliosPlus.Tests/Data/Profiles/DisplayProfiles_1.0.json new file mode 100644 index 0000000..8d0755a Binary files /dev/null and b/HeliosPlus.Tests/Data/Profiles/DisplayProfiles_1.0.json differ diff --git a/HeliosPlus.Tests/Data/Profiles/profile-{7f7a3839-a676-40b5-9df9-085ffc1805ee}.ico b/HeliosPlus.Tests/Data/Profiles/profile-{7f7a3839-a676-40b5-9df9-085ffc1805ee}.ico new file mode 100644 index 0000000..e6b1c9e Binary files /dev/null and b/HeliosPlus.Tests/Data/Profiles/profile-{7f7a3839-a676-40b5-9df9-085ffc1805ee}.ico differ diff --git a/HeliosPlus.Tests/Data/Profiles/profile-{9ccf3cdb-1782-4a6c-9c70-d7da60c8c851}.ico b/HeliosPlus.Tests/Data/Profiles/profile-{9ccf3cdb-1782-4a6c-9c70-d7da60c8c851}.ico new file mode 100644 index 0000000..08e9d7e Binary files /dev/null and b/HeliosPlus.Tests/Data/Profiles/profile-{9ccf3cdb-1782-4a6c-9c70-d7da60c8c851}.ico differ diff --git a/HeliosPlus.Tests/Data/Profiles/profile-{cfba2c25-76e9-47ea-8ce4-bc98de6586fa}.ico b/HeliosPlus.Tests/Data/Profiles/profile-{cfba2c25-76e9-47ea-8ce4-bc98de6586fa}.ico new file mode 100644 index 0000000..b662277 Binary files /dev/null and b/HeliosPlus.Tests/Data/Profiles/profile-{cfba2c25-76e9-47ea-8ce4-bc98de6586fa}.ico differ diff --git a/HeliosPlus.Tests/Data/Shortcuts/Shortcuts_1.0.json b/HeliosPlus.Tests/Data/Shortcuts/Shortcuts_1.0.json new file mode 100644 index 0000000..ce8e77b Binary files /dev/null and b/HeliosPlus.Tests/Data/Shortcuts/Shortcuts_1.0.json differ diff --git a/HeliosPlus.Tests/Data/Shortcuts/steam-{7f7a3839-a676-40b5-9df9-085ffc1805ee}-241930.ico b/HeliosPlus.Tests/Data/Shortcuts/steam-{7f7a3839-a676-40b5-9df9-085ffc1805ee}-241930.ico new file mode 100644 index 0000000..c2410cf Binary files /dev/null and b/HeliosPlus.Tests/Data/Shortcuts/steam-{7f7a3839-a676-40b5-9df9-085ffc1805ee}-241930.ico differ diff --git a/HeliosPlus.Tests/Data/Shortcuts/steam-{9ccf3cdb-1782-4a6c-9c70-d7da60c8c851}-244210.ico b/HeliosPlus.Tests/Data/Shortcuts/steam-{9ccf3cdb-1782-4a6c-9c70-d7da60c8c851}-244210.ico new file mode 100644 index 0000000..3cedaeb Binary files /dev/null and b/HeliosPlus.Tests/Data/Shortcuts/steam-{9ccf3cdb-1782-4a6c-9c70-d7da60c8c851}-244210.ico differ diff --git a/HeliosPlus.Tests/Data/Shortcuts/steam-{9ccf3cdb-1782-4a6c-9c70-d7da60c8c851}-284160.ico b/HeliosPlus.Tests/Data/Shortcuts/steam-{9ccf3cdb-1782-4a6c-9c70-d7da60c8c851}-284160.ico new file mode 100644 index 0000000..3db6b4d Binary files /dev/null and b/HeliosPlus.Tests/Data/Shortcuts/steam-{9ccf3cdb-1782-4a6c-9c70-d7da60c8c851}-284160.ico differ diff --git a/HeliosPlus.Tests/Data/Shortcuts/steam-{9ccf3cdb-1782-4a6c-9c70-d7da60c8c851}-421020.ico b/HeliosPlus.Tests/Data/Shortcuts/steam-{9ccf3cdb-1782-4a6c-9c70-d7da60c8c851}-421020.ico new file mode 100644 index 0000000..a4cb122 Binary files /dev/null and b/HeliosPlus.Tests/Data/Shortcuts/steam-{9ccf3cdb-1782-4a6c-9c70-d7da60c8c851}-421020.ico differ diff --git a/HeliosPlus.Tests/Data/Shortcuts/steam-{9ccf3cdb-1782-4a6c-9c70-d7da60c8c851}-461950.ico b/HeliosPlus.Tests/Data/Shortcuts/steam-{9ccf3cdb-1782-4a6c-9c70-d7da60c8c851}-461950.ico new file mode 100644 index 0000000..5c66f4f Binary files /dev/null and b/HeliosPlus.Tests/Data/Shortcuts/steam-{9ccf3cdb-1782-4a6c-9c70-d7da60c8c851}-461950.ico differ diff --git a/HeliosPlus.Tests/Data/Shortcuts/steam-{cfba2c25-76e9-47ea-8ce4-bc98de6586fa}-24740.ico b/HeliosPlus.Tests/Data/Shortcuts/steam-{cfba2c25-76e9-47ea-8ce4-bc98de6586fa}-24740.ico new file mode 100644 index 0000000..df893e4 Binary files /dev/null and b/HeliosPlus.Tests/Data/Shortcuts/steam-{cfba2c25-76e9-47ea-8ce4-bc98de6586fa}-24740.ico differ diff --git a/HeliosPlus.Tests/Data/Shortcuts/steam-{cfba2c25-76e9-47ea-8ce4-bc98de6586fa}-24870.ico b/HeliosPlus.Tests/Data/Shortcuts/steam-{cfba2c25-76e9-47ea-8ce4-bc98de6586fa}-24870.ico new file mode 100644 index 0000000..dd9c28f Binary files /dev/null and b/HeliosPlus.Tests/Data/Shortcuts/steam-{cfba2c25-76e9-47ea-8ce4-bc98de6586fa}-24870.ico differ diff --git a/HeliosPlus.Tests/Data/Shortcuts/steam-{cfba2c25-76e9-47ea-8ce4-bc98de6586fa}-345390.ico b/HeliosPlus.Tests/Data/Shortcuts/steam-{cfba2c25-76e9-47ea-8ce4-bc98de6586fa}-345390.ico new file mode 100644 index 0000000..053f97b Binary files /dev/null and b/HeliosPlus.Tests/Data/Shortcuts/steam-{cfba2c25-76e9-47ea-8ce4-bc98de6586fa}-345390.ico differ diff --git a/HeliosPlus.Tests/Data/Shortcuts/steam-{cfba2c25-76e9-47ea-8ce4-bc98de6586fa}-374900.ico b/HeliosPlus.Tests/Data/Shortcuts/steam-{cfba2c25-76e9-47ea-8ce4-bc98de6586fa}-374900.ico new file mode 100644 index 0000000..d113a7b Binary files /dev/null and b/HeliosPlus.Tests/Data/Shortcuts/steam-{cfba2c25-76e9-47ea-8ce4-bc98de6586fa}-374900.ico differ diff --git a/HeliosPlus.Tests/Data/Shortcuts/steam-{cfba2c25-76e9-47ea-8ce4-bc98de6586fa}-493490.ico b/HeliosPlus.Tests/Data/Shortcuts/steam-{cfba2c25-76e9-47ea-8ce4-bc98de6586fa}-493490.ico new file mode 100644 index 0000000..09d9758 Binary files /dev/null and b/HeliosPlus.Tests/Data/Shortcuts/steam-{cfba2c25-76e9-47ea-8ce4-bc98de6586fa}-493490.ico differ diff --git a/HeliosPlus.Tests/Data/Shortcuts/steam-{cfba2c25-76e9-47ea-8ce4-bc98de6586fa}-50.ico b/HeliosPlus.Tests/Data/Shortcuts/steam-{cfba2c25-76e9-47ea-8ce4-bc98de6586fa}-50.ico new file mode 100644 index 0000000..bc4e4c6 Binary files /dev/null and b/HeliosPlus.Tests/Data/Shortcuts/steam-{cfba2c25-76e9-47ea-8ce4-bc98de6586fa}-50.ico differ diff --git a/HeliosPlus.Tests/Data/Shortcuts/steam-{cfba2c25-76e9-47ea-8ce4-bc98de6586fa}-690790.ico b/HeliosPlus.Tests/Data/Shortcuts/steam-{cfba2c25-76e9-47ea-8ce4-bc98de6586fa}-690790.ico new file mode 100644 index 0000000..3631481 Binary files /dev/null and b/HeliosPlus.Tests/Data/Shortcuts/steam-{cfba2c25-76e9-47ea-8ce4-bc98de6586fa}-690790.ico differ diff --git a/HeliosPlus.Tests/Data/Shortcuts/steam-{cfba2c25-76e9-47ea-8ce4-bc98de6586fa}-70.ico b/HeliosPlus.Tests/Data/Shortcuts/steam-{cfba2c25-76e9-47ea-8ce4-bc98de6586fa}-70.ico new file mode 100644 index 0000000..8a5a2c6 Binary files /dev/null and b/HeliosPlus.Tests/Data/Shortcuts/steam-{cfba2c25-76e9-47ea-8ce4-bc98de6586fa}-70.ico differ diff --git a/HeliosPlus.Tests/Data/Shortcuts/steam-{cfba2c25-76e9-47ea-8ce4-bc98de6586fa}-928600.ico b/HeliosPlus.Tests/Data/Shortcuts/steam-{cfba2c25-76e9-47ea-8ce4-bc98de6586fa}-928600.ico new file mode 100644 index 0000000..daa6a4b Binary files /dev/null and b/HeliosPlus.Tests/Data/Shortcuts/steam-{cfba2c25-76e9-47ea-8ce4-bc98de6586fa}-928600.ico differ diff --git a/HeliosPlus.Tests/HeliosPlus.Tests.csproj b/HeliosPlus.Tests/HeliosPlus.Tests.csproj new file mode 100644 index 0000000..16690d3 --- /dev/null +++ b/HeliosPlus.Tests/HeliosPlus.Tests.csproj @@ -0,0 +1,78 @@ + + + + + + Debug + AnyCPU + {D7AFD3CC-53BF-4991-ABFE-638A3F355310} + Library + Properties + HeliosPlus.Tests + HeliosPlus.Tests + v4.7.2 + 512 + {3AC096D0-A1C2-E12C-1390-A8335801FDAB};{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC} + 15.0 + $(MSBuildExtensionsPath32)\Microsoft\VisualStudio\v$(VisualStudioVersion) + $(ProgramFiles)\Common Files\microsoft shared\VSTT\$(VisualStudioVersion)\UITestExtensionPackages + False + UnitTest + + + + + true + full + false + bin\Debug\ + DEBUG;TRACE + prompt + 4 + + + pdbonly + true + bin\Release\ + TRACE + prompt + 4 + + + + ..\packages\MSTest.TestFramework.2.1.1\lib\net45\Microsoft.VisualStudio.TestPlatform.TestFramework.dll + + + ..\packages\MSTest.TestFramework.2.1.1\lib\net45\Microsoft.VisualStudio.TestPlatform.TestFramework.Extensions.dll + + + + + + + + + + + + + + {1cacda43-01c7-4cd4-bf6e-9421a29510fc} + HeliosPlus.Shared + + + {608d941a-b431-400c-a91d-c6f971c29577} + HeliosPlus + + + + + + + This project references NuGet package(s) that are missing on this computer. Use NuGet Package Restore to download them. For more information, see http://go.microsoft.com/fwlink/?LinkID=322105. The missing file is {0}. + + + + + + \ No newline at end of file diff --git a/HeliosPlus.Tests/Properties/AssemblyInfo.cs b/HeliosPlus.Tests/Properties/AssemblyInfo.cs new file mode 100644 index 0000000..fd776b0 --- /dev/null +++ b/HeliosPlus.Tests/Properties/AssemblyInfo.cs @@ -0,0 +1,20 @@ +using System.Reflection; +using System.Runtime.CompilerServices; +using System.Runtime.InteropServices; + +[assembly: AssemblyTitle("HeliosPlus.Tests")] +[assembly: AssemblyDescription("")] +[assembly: AssemblyConfiguration("")] +[assembly: AssemblyCompany("")] +[assembly: AssemblyProduct("HeliosPlus.Tests")] +[assembly: AssemblyCopyright("Copyright © 2020")] +[assembly: AssemblyTrademark("")] +[assembly: AssemblyCulture("")] + +[assembly: ComVisible(false)] + +[assembly: Guid("d7afd3cc-53bf-4991-abfe-638a3f355310")] + +// [assembly: AssemblyVersion("1.0.*")] +[assembly: AssemblyVersion("1.0.0.0")] +[assembly: AssemblyFileVersion("1.0.0.0")] diff --git a/HeliosPlus.Tests/UnitTest1.cs b/HeliosPlus.Tests/UnitTest1.cs new file mode 100644 index 0000000..f0ab1a6 --- /dev/null +++ b/HeliosPlus.Tests/UnitTest1.cs @@ -0,0 +1,15 @@ +using System; +using Microsoft.VisualStudio.TestTools.UnitTesting; + +namespace HeliosPlus.Tests +{ + [TestClass] + public class UnitTest1 + { + [TestMethod] + public void TestMethod1() + { + Assert.IsTrue(true); + } + } +} diff --git a/HeliosPlus.Tests/packages.config b/HeliosPlus.Tests/packages.config new file mode 100644 index 0000000..7079f81 --- /dev/null +++ b/HeliosPlus.Tests/packages.config @@ -0,0 +1,5 @@ + + + + + \ No newline at end of file diff --git a/HeliosPlus.Tests1/HeliosPlus.Tests.csproj b/HeliosPlus.Tests1/HeliosPlus.Tests.csproj new file mode 100644 index 0000000..e95dc80 --- /dev/null +++ b/HeliosPlus.Tests1/HeliosPlus.Tests.csproj @@ -0,0 +1,21 @@ + + + + netcoreapp3.1 + + false + + + + + + + + + + + + + + + diff --git a/HeliosPlus.Tests1/UnitTest1.cs b/HeliosPlus.Tests1/UnitTest1.cs new file mode 100644 index 0000000..cb667f9 --- /dev/null +++ b/HeliosPlus.Tests1/UnitTest1.cs @@ -0,0 +1,20 @@ +using NUnit.Framework; +using System.IO; +using System; + +namespace HeliosPlus.Tests +{ + public class Tests + { + [SetUp] + public void Setup() + { + } + + [Test] + public void Test1() + { + Assert.Pass(); + } + } +} \ No newline at end of file diff --git a/HeliosPlus.sln b/HeliosPlus.sln index aa69622..29e84be 100644 --- a/HeliosPlus.sln +++ b/HeliosPlus.sln @@ -10,6 +10,8 @@ Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "HeliosPlus.Shared", "Helios EndProject Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "HeliosPlus.Reporting", "HeliosPlus.Reporting\HeliosPlus.Reporting.csproj", "{76DF2BCF-911B-4820-B63E-8F3468DB5E79}" EndProject +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "HeliosPlus.Tests", "HeliosPlus.Tests\HeliosPlus.Tests.csproj", "{D7AFD3CC-53BF-4991-ABFE-638A3F355310}" +EndProject Global GlobalSection(SolutionConfigurationPlatforms) = preSolution Debug|AnyCPU = Debug|AnyCPU @@ -32,6 +34,10 @@ Global {76DF2BCF-911B-4820-B63E-8F3468DB5E79}.Debug|AnyCPU.Build.0 = Debug|Any CPU {76DF2BCF-911B-4820-B63E-8F3468DB5E79}.Release|AnyCPU.ActiveCfg = Release|Any CPU {76DF2BCF-911B-4820-B63E-8F3468DB5E79}.Release|AnyCPU.Build.0 = Release|Any CPU + {D7AFD3CC-53BF-4991-ABFE-638A3F355310}.Debug|AnyCPU.ActiveCfg = Debug|Any CPU + {D7AFD3CC-53BF-4991-ABFE-638A3F355310}.Debug|AnyCPU.Build.0 = Debug|Any CPU + {D7AFD3CC-53BF-4991-ABFE-638A3F355310}.Release|AnyCPU.ActiveCfg = Release|Any CPU + {D7AFD3CC-53BF-4991-ABFE-638A3F355310}.Release|AnyCPU.Build.0 = Release|Any CPU EndGlobalSection GlobalSection(SolutionProperties) = preSolution HideSolutionNode = FALSE diff --git a/HeliosPlus/ShortcutRepository.cs b/HeliosPlus/ShortcutRepository.cs index 0a25608..d7c4b55 100644 --- a/HeliosPlus/ShortcutRepository.cs +++ b/HeliosPlus/ShortcutRepository.cs @@ -685,6 +685,10 @@ namespace HeliosPlus if (ProfileRepository.IsActiveProfile(profile)) return true; + // We need to check if the profile is valid + if (!profile.IsPossible) + return false; + var instanceStatus = IPCService.GetInstance().Status; try