From c38c1c473124d46334901c4c26bb09237c2a27c7 Mon Sep 17 00:00:00 2001 From: Brian Lima Date: Thu, 29 Sep 2016 16:12:58 -0300 Subject: [PATCH] Big changes aimming for 2.0 Replaced entrypoint from MainWindow to GamesWindows. Getting apps installed from the computer via powershell. Redesigning UWPHook with Material Design in XAML. Lots of code still in the works, it compiles, but is not functional yet, wait for future commits. --- UWPHook.sln | 6 ++++ UWPHook/App.xaml | 11 +++++-- UWPHook/AppEntry.cs | 50 ++++++++++++++++++++++++++++++++ UWPHook/AppEntryModel.cs | 20 +++++++++++++ UWPHook/AppManager.cs | 10 +++---- UWPHook/GamesWindow.xaml | 57 +++++++++++++++++++++++++++++++++++++ UWPHook/GamesWindow.xaml.cs | 41 ++++++++++++++++++++++++++ UWPHook/MainWindow.xaml.cs | 13 +++++---- UWPHook/UWPHook.csproj | 21 ++++++++++++++ UWPHook/packages.config | 2 ++ 10 files changed, 219 insertions(+), 12 deletions(-) create mode 100644 UWPHook/AppEntry.cs create mode 100644 UWPHook/AppEntryModel.cs create mode 100644 UWPHook/GamesWindow.xaml create mode 100644 UWPHook/GamesWindow.xaml.cs diff --git a/UWPHook.sln b/UWPHook.sln index 0c780bf..e567898 100644 --- a/UWPHook.sln +++ b/UWPHook.sln @@ -7,6 +7,8 @@ Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "UWPHook", "UWPHook\UWPHook. EndProject Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "SharpSteam", "..\SharpSteam\SharpSteam\SharpSteam.csproj", "{D0A686FB-B373-4FBC-A0DD-C3417276A816}" EndProject +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "VDFParser", "..\..\..\Downloads\SharpSteam-master\SharpSteam-master\VDFParser\VDFParser\VDFParser.csproj", "{9543FB59-1EB6-4638-B24C-B12B9D4A15FC}" +EndProject Global GlobalSection(SolutionConfigurationPlatforms) = preSolution Debug|Any CPU = Debug|Any CPU @@ -21,6 +23,10 @@ Global {D0A686FB-B373-4FBC-A0DD-C3417276A816}.Debug|Any CPU.Build.0 = Debug|Any CPU {D0A686FB-B373-4FBC-A0DD-C3417276A816}.Release|Any CPU.ActiveCfg = Release|Any CPU {D0A686FB-B373-4FBC-A0DD-C3417276A816}.Release|Any CPU.Build.0 = Release|Any CPU + {9543FB59-1EB6-4638-B24C-B12B9D4A15FC}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {9543FB59-1EB6-4638-B24C-B12B9D4A15FC}.Debug|Any CPU.Build.0 = Debug|Any CPU + {9543FB59-1EB6-4638-B24C-B12B9D4A15FC}.Release|Any CPU.ActiveCfg = Release|Any CPU + {9543FB59-1EB6-4638-B24C-B12B9D4A15FC}.Release|Any CPU.Build.0 = Release|Any CPU EndGlobalSection GlobalSection(SolutionProperties) = preSolution HideSolutionNode = FALSE diff --git a/UWPHook/App.xaml b/UWPHook/App.xaml index 21febfc..5fb6b15 100644 --- a/UWPHook/App.xaml +++ b/UWPHook/App.xaml @@ -2,8 +2,15 @@ xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" xmlns:local="clr-namespace:UWPHook" - StartupUri="MainWindow.xaml"> + StartupUri="GamesWindow.xaml"> - + + + + + + + + diff --git a/UWPHook/AppEntry.cs b/UWPHook/AppEntry.cs new file mode 100644 index 0000000..bcf5c43 --- /dev/null +++ b/UWPHook/AppEntry.cs @@ -0,0 +1,50 @@ +using System.ComponentModel; +using System.Runtime.CompilerServices; + +namespace UWPHook +{ + public class AppEntry : INotifyPropertyChanged + { + private string _name; + /// + /// Gets or sets the name of the application + /// + public string Name + { + get { return _name; } + set { _name = value; } + } + + private string _aumid; + /// + /// Gets or sets the aumid of the application + /// + public string Aumid + { + get { return _aumid; } + set { _aumid = value; } + } + + private bool _isSelected; + /// + /// Gets or sets if the application is selected + /// + public bool IsSelected + { + get { return _isSelected; } + set + { + if (_isSelected == value) return; + _isSelected = value; + OnPropertyChanged(); + } + } + + public event PropertyChangedEventHandler PropertyChanged; + + protected virtual void OnPropertyChanged([CallerMemberName] string propertyName = null) + { + PropertyChanged?.Invoke(this, new PropertyChangedEventArgs(propertyName)); + } + } +} diff --git a/UWPHook/AppEntryModel.cs b/UWPHook/AppEntryModel.cs new file mode 100644 index 0000000..a647b28 --- /dev/null +++ b/UWPHook/AppEntryModel.cs @@ -0,0 +1,20 @@ +using System.Collections.ObjectModel; + +namespace UWPHook +{ + public class AppEntryModel + { + public AppEntryModel() + { + this._entries = new ObservableCollection(); + } + + private ObservableCollection _entries; + + public ObservableCollection Entries + { + get { return _entries; } + set { _entries = value; } + } + } +} diff --git a/UWPHook/AppManager.cs b/UWPHook/AppManager.cs index e6b8cd5..61d80be 100644 --- a/UWPHook/AppManager.cs +++ b/UWPHook/AppManager.cs @@ -11,11 +11,11 @@ using System.Threading.Tasks; namespace UWPHook { - class AppManager + static class AppManager { - private int id; + private static int id; - public void LaunchUWPApp(string uri) + public static void LaunchUWPApp(string uri) { var mgr = new ApplicationActivationManager(); uint processId; @@ -24,7 +24,7 @@ namespace UWPHook id = (int)processId; } - public Boolean IsRunning() + public static Boolean IsRunning() { if (id == 0) { @@ -42,7 +42,7 @@ namespace UWPHook return true; } - public List GetInstalledApps() + public static List GetInstalledApps() { List result = null; var assembly = Assembly.GetExecutingAssembly(); diff --git a/UWPHook/GamesWindow.xaml b/UWPHook/GamesWindow.xaml new file mode 100644 index 0000000..f1f6929 --- /dev/null +++ b/UWPHook/GamesWindow.xaml @@ -0,0 +1,57 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +