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.
UWPTest
Brian Lima 8 years ago
parent 2ecd50509c
commit c38c1c4731

@ -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

@ -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">
<Application.Resources>
<ResourceDictionary>
<ResourceDictionary.MergedDictionaries>
<ResourceDictionary Source="pack://application:,,,/MaterialDesignThemes.Wpf;component/Themes/MaterialDesignTheme.Light.xaml"/>
<ResourceDictionary Source="pack://application:,,,/MaterialDesignThemes.Wpf;component/Themes/MaterialDesignTheme.Defaults.xaml"/>
<ResourceDictionary Source="pack://application:,,,/MaterialDesignColors;component/Themes/Recommended/Primary/MaterialDesignColor.BlueGrey.xaml"/>
<ResourceDictionary Source="pack://application:,,,/MaterialDesignColors;component/Themes/Recommended/Accent/MaterialDesignColor.Lime.xaml"/>
</ResourceDictionary.MergedDictionaries>
</ResourceDictionary>
</Application.Resources>
</Application>

@ -0,0 +1,50 @@
using System.ComponentModel;
using System.Runtime.CompilerServices;
namespace UWPHook
{
public class AppEntry : INotifyPropertyChanged
{
private string _name;
/// <summary>
/// Gets or sets the name of the application
/// </summary>
public string Name
{
get { return _name; }
set { _name = value; }
}
private string _aumid;
/// <summary>
/// Gets or sets the aumid of the application
/// </summary>
public string Aumid
{
get { return _aumid; }
set { _aumid = value; }
}
private bool _isSelected;
/// <summary>
/// Gets or sets if the application is selected
/// </summary>
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));
}
}
}

@ -0,0 +1,20 @@
using System.Collections.ObjectModel;
namespace UWPHook
{
public class AppEntryModel
{
public AppEntryModel()
{
this._entries = new ObservableCollection<AppEntry>();
}
private ObservableCollection<AppEntry> _entries;
public ObservableCollection<AppEntry> Entries
{
get { return _entries; }
set { _entries = value; }
}
}
}

@ -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<String> GetInstalledApps()
public static List<String> GetInstalledApps()
{
List<String> result = null;
var assembly = Assembly.GetExecutingAssembly();

@ -0,0 +1,57 @@
<Window x:Class="UWPHook.GamesWindow"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
xmlns:materialDesign="http://materialdesigninxaml.net/winfx/xaml/themes"
xmlns:local="clr-namespace:UWPHook"
TextElement.Foreground="{DynamicResource MaterialDesignBody}"
Background="{DynamicResource MaterialDesignPaper}"
TextElement.FontWeight="Medium"
TextElement.FontSize="14"
FontFamily="Segoe UI Light"
mc:Ignorable="d"
Title="GamesWindow" Height="600" Width="800">
<Grid x:Name="grid">
<Grid.RowDefinitions>
<RowDefinition Height="28*"/>
<RowDefinition Height="144*"/>
<RowDefinition Height="19*"/>
</Grid.RowDefinitions>
<materialDesign:ColorZone Padding="16" materialDesign:ShadowAssist.ShadowDepth="Depth2" Mode="PrimaryMid" Height="78"/>
<Button Click="Button_Click_1" Style="{StaticResource MaterialDesignFloatingActionMiniLightButton}"
Margin="0,51,10,0" HorizontalAlignment="Right"
ToolTip="Load installed UWP Apps" VerticalAlignment="Top" Grid.RowSpan="2">
<materialDesign:PackIcon Kind="Reload" Height="24" Width="24" />
</Button>
<Grid Margin="10" Grid.Row="1">
<ItemsControl Grid.IsSharedSizeScope="True" x:Name="listGames" Margin="0,0,0,10">
<ItemsControl.ItemTemplate>
<DataTemplate>
<Border x:Name="Border" Padding="8" BorderThickness="0 0 0 1" BorderBrush="{DynamicResource MaterialDesignDivider}">
<Grid>
<Grid.ColumnDefinitions>
<ColumnDefinition SharedSizeGroup="Checkerz" />
<ColumnDefinition />
</Grid.ColumnDefinitions>
<ToggleButton VerticalAlignment="Center" IsChecked="{Binding IsSelected}"
Style="{StaticResource MaterialDesignActionLightToggleButton}" />
<StackPanel Margin="8 0 0 0" Grid.Column="1">
<TextBox FontWeight="Bold" Text="{Binding Name}" />
<TextBlock Text="{Binding Aumid}" />
</StackPanel>
</Grid>
</Border>
<DataTemplate.Triggers>
<DataTrigger Binding="{Binding IsSelected}" Value="True">
<Setter TargetName="Border" Property="Background" Value="{DynamicResource MaterialDesignSelection}" />
</DataTrigger>
</DataTemplate.Triggers>
</DataTemplate>
</ItemsControl.ItemTemplate>
</ItemsControl>
</Grid>
<Button x:Name="button" Content="Export selected Apps to Steam" Click="button_Click" HorizontalAlignment="Right" Margin="0,0,10,10" Grid.Row="2" VerticalAlignment="Bottom" Width="227"/>
</Grid>
</Window>

@ -0,0 +1,41 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows;
using System.Windows.Controls;
using System.Windows.Data;
using System.Windows.Documents;
using System.Windows.Input;
using System.Windows.Media;
using System.Windows.Media.Imaging;
using System.Windows.Shapes;
namespace UWPHook
{
/// <summary>
/// Interaction logic for GamesWindow.xaml
/// </summary>
public partial class GamesWindow : Window
{
AppEntryModel Apps;
public GamesWindow()
{
InitializeComponent();
Apps = new AppEntryModel();
listGames.ItemsSource = Apps.Entries;
}
private void button_Click(object sender, RoutedEventArgs e)
{
}
private void Button_Click_1(object sender, RoutedEventArgs e)
{
var installedApps = AppManager.GetInstalledApps();
}
}
}

@ -1,8 +1,12 @@
using System;
using SharpSteam;
using System;
using System.Collections.Generic;
using System.Diagnostics;
using System.IO;
using System.Threading;
using System.Windows;
using VDFParser;
using VDFParser.Models;
namespace UWPHook
{
@ -23,13 +27,13 @@ namespace UWPHook
{
if (Environment.GetCommandLineArgs().Length > 1)
{
manager = new AppManager();
//manager = new AppManager();
try
{
this.Hide();
Launch_Game(String.Join(" ", Environment.GetCommandLineArgs()));
while (manager.IsRunning())
//while (manager.IsRunning())
{
Thread.Sleep(5000);
}
@ -60,7 +64,7 @@ namespace UWPHook
{
try
{
manager.LaunchUWPApp(game.game_path);
//manager.LaunchUWPApp(game.game_path);
}
catch (Exception ex)
{
@ -79,7 +83,6 @@ namespace UWPHook
private void helpButton_Click(object sender, RoutedEventArgs e)
{
manager.InstalledApps();
Process.Start("https://www.reddit.com/r/UWPHook/comments/53eaj9/welcome_to_uwphook_link_your_uwp_games_to_steam/");
}

@ -56,6 +56,14 @@
<StartupObject>UWPHook.App</StartupObject>
</PropertyGroup>
<ItemGroup>
<Reference Include="MaterialDesignColors, Version=1.1.2.0, Culture=neutral, processorArchitecture=MSIL">
<HintPath>..\packages\MaterialDesignColors.1.1.2\lib\net45\MaterialDesignColors.dll</HintPath>
<Private>True</Private>
</Reference>
<Reference Include="MaterialDesignThemes.Wpf, Version=2.1.0.657, Culture=neutral, processorArchitecture=MSIL">
<HintPath>..\packages\MaterialDesignThemes.2.1.0.657\lib\net45\MaterialDesignThemes.Wpf.dll</HintPath>
<Private>True</Private>
</Reference>
<Reference Include="Newtonsoft.Json, Version=9.0.0.0, Culture=neutral, PublicKeyToken=30ad4fe6b2a6aeed, processorArchitecture=MSIL">
<HintPath>..\packages\Newtonsoft.Json.9.0.1\lib\net45\Newtonsoft.Json.dll</HintPath>
<Private>True</Private>
@ -85,7 +93,16 @@
<Generator>MSBuild:Compile</Generator>
<SubType>Designer</SubType>
</ApplicationDefinition>
<Compile Include="AppEntry.cs" />
<Compile Include="AppEntryModel.cs" />
<Compile Include="GamesWindow.xaml.cs">
<DependentUpon>GamesWindow.xaml</DependentUpon>
</Compile>
<Compile Include="ScriptManager.cs" />
<Page Include="GamesWindow.xaml">
<SubType>Designer</SubType>
<Generator>MSBuild:Compile</Generator>
</Page>
<Page Include="MainWindow.xaml">
<Generator>MSBuild:Compile</Generator>
<SubType>Designer</SubType>
@ -155,6 +172,10 @@
<EmbeddedResource Include="Resources\GetAUMIDScript.txt" />
</ItemGroup>
<ItemGroup>
<ProjectReference Include="..\..\..\..\Downloads\SharpSteam-master\SharpSteam-master\VDFParser\VDFParser\VDFParser.csproj">
<Project>{9543fb59-1eb6-4638-b24c-b12b9d4a15fc}</Project>
<Name>VDFParser</Name>
</ProjectReference>
<ProjectReference Include="..\..\SharpSteam\SharpSteam\SharpSteam.csproj">
<Project>{d0a686fb-b373-4fbc-a0dd-c3417276a816}</Project>
<Name>SharpSteam</Name>

@ -1,5 +1,7 @@
<?xml version="1.0" encoding="utf-8"?>
<packages>
<package id="MaterialDesignColors" version="1.1.2" targetFramework="net461" />
<package id="MaterialDesignThemes" version="2.1.0.657" targetFramework="net461" />
<package id="Newtonsoft.Json" version="9.0.1" targetFramework="net461" />
<package id="System.Management.Automation" version="6.1.7601.17515" targetFramework="net461" />
</packages>
Loading…
Cancel
Save