Progress, finished new UI, implementing new logic.

UWPTest
Brian Lima 8 years ago
parent c38c1c4731
commit 5963ee9e60

@ -7,7 +7,7 @@ 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}"
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "VDFParser", "..\SharpSteam\VDFParser\VDFParser\VDFParser.csproj", "{9543FB59-1EB6-4638-B24C-B12B9D4A15FC}"
EndProject
Global
GlobalSection(SolutionConfigurationPlatforms) = preSolution

@ -8,7 +8,7 @@
<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/Primary/MaterialDesignColor.Blue.xaml"/>
<ResourceDictionary Source="pack://application:,,,/MaterialDesignColors;component/Themes/Recommended/Accent/MaterialDesignColor.Lime.xaml"/>
</ResourceDictionary.MergedDictionaries>
</ResourceDictionary>

@ -5,6 +5,22 @@ namespace UWPHook
{
public class AppEntry : INotifyPropertyChanged
{
private bool _isSelected;
/// <summary>
/// Gets or sets if the application is selected
/// </summary>
public bool Selected
{
get { return _isSelected; }
set
{
if (_isSelected == value) return;
_isSelected = value;
OnPropertyChanged();
}
}
private string _name;
/// <summary>
/// Gets or sets the name of the application
@ -25,21 +41,6 @@ namespace UWPHook
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)

@ -15,6 +15,10 @@ namespace UWPHook
{
private static int id;
/// <summary>
/// Launch a UWP App using a shell command and sets a internal id, to it's proccess id
/// </summary>
/// <param name="uri"></param>
public static void LaunchUWPApp(string uri)
{
var mgr = new ApplicationActivationManager();
@ -24,6 +28,10 @@ namespace UWPHook
id = (int)processId;
}
/// <summary>
/// Checks if the launched app is running
/// </summary>
/// <returns></returns>
public static Boolean IsRunning()
{
if (id == 0)
@ -42,6 +50,10 @@ namespace UWPHook
return true;
}
/// <summary>
/// Gets a list of installed UWP Apps on the system, containing each app name + AUMID, separated by '|'
/// </summary>
/// <returns>List of installed UWP Apps</returns>
public static List<String> GetInstalledApps()
{
List<String> result = null;
@ -53,7 +65,7 @@ namespace UWPHook
using (StreamReader reader = new StreamReader(stream))
{
ScriptManager script = new ScriptManager();
var r = script.RunScript(reader.ReadToEnd()).Split(';').ToList<string>();
result = script.RunScript(reader.ReadToEnd()).Split(';').ToList<string>();
}
}

@ -18,40 +18,23 @@
<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}"
<materialDesign:ColorZone Padding="16" materialDesign:ShadowAssist.ShadowDepth="Depth2" Mode="PrimaryMid" Height="80"/>
<Image x:Name="image" HorizontalAlignment="Left" Width="178" Height="80" VerticalAlignment="Top" Source="Resources/4.png" Stretch="UniformToFill" ToolTip="Welcome to UWPHook, add your UWP apps and games to Steam!"/>
<Button Click="HelpButton_Click" Style="{StaticResource MaterialDesignFloatingActionMiniLightButton}"
Margin="0,6,10,0" HorizontalAlignment="Right"
ToolTip="About" VerticalAlignment="Top">
<materialDesign:PackIcon Kind="Help" Height="24" Width="24" />
</Button>
<Button Click="LoadButton_Click" 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>
<DataGrid x:Name="listGames" Margin="0,25,0,0" CanUserSortColumns="True" CanUserAddRows="False"
materialDesign:DataGridAssist.CellPadding="4 2 2 2" materialDesign:DataGridAssist.ColumnHeaderPadding="4 2 2 2"/>
<Label x:Name="label" Content="Press 'Load installed apps' to get a list of installed apps on your system." HorizontalAlignment="Left" Margin="0,-10,0,0" VerticalAlignment="Top"/>
</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"/>
<Button Content="Export selected Apps to Steam" Click="ExportButton_Click" HorizontalAlignment="Right" Margin="0,0,10,10" Grid.Row="2" VerticalAlignment="Bottom" Width="227"/>
</Grid>
</Window>

@ -11,6 +11,9 @@ using System.Windows.Input;
using System.Windows.Media;
using System.Windows.Media.Imaging;
using System.Windows.Shapes;
using VDFParser;
using VDFParser.Models;
using SharpSteam;
namespace UWPHook
{
@ -20,7 +23,7 @@ namespace UWPHook
public partial class GamesWindow : Window
{
AppEntryModel Apps;
public GamesWindow()
{
InitializeComponent();
@ -28,14 +31,43 @@ namespace UWPHook
listGames.ItemsSource = Apps.Entries;
}
private void button_Click(object sender, RoutedEventArgs e)
private void ExportButton_Click(object sender, RoutedEventArgs e)
{
string steam_folder = SteamManager.GetSteamFolder();
var users = SteamManager.GetUsers(steam_folder);
foreach (var user in users)
{
var shortcuts = SteamManager.ReadShortcuts(user);
if (shortcuts != null)
{
//foreach (var item in Apps.Entries.Select<)
//{
//
//}
}
}
}
private void Button_Click_1(object sender, RoutedEventArgs e)
private void LoadButton_Click(object sender, RoutedEventArgs e)
{
var installedApps = AppManager.GetInstalledApps();
foreach (var app in installedApps)
{
var valor = app.Replace("\r\n", "").Split('|');
if (!String.IsNullOrEmpty(valor[0]))
{
Apps.Entries.Add(new AppEntry() { Name = valor[0], Aumid = valor[1], Selected = false });
}
}
listGames.Columns[2].IsReadOnly = true;
label.Content = "Installed Apps";
}
private void HelpButton_Click(object sender, RoutedEventArgs e)
{
}
}
}

@ -5,7 +5,7 @@
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
xmlns:local="clr-namespace:UWPHook"
mc:Ignorable="d"
Title="UWPHook" Height="600" Width="800" Loaded="Window_Loaded" Icon="hook_icon.ico">
Title="UWPHook" Height="600" Width="800" Loaded="Window_Loaded">
<Grid>
<Grid.RowDefinitions>
<RowDefinition Height="147*"/>

@ -16,7 +16,6 @@ namespace UWPHook
public partial class MainWindow : Window
{
GameModel gamesView;
AppManager manager;
public MainWindow()
{

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.1 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.9 KiB

@ -5,7 +5,7 @@ foreach ($app in $installedapps)
{
    foreach ($id in (Get-AppxPackageManifest $app).package.applications.application.id)
    {
        $aumidList += $app.packagefamilyname + "!" + $id + ";"
        $aumidList += $app.name + "|" + $app.packagefamilyname + "!" + $id + ";"
    }
}

Binary file not shown.

After

Width:  |  Height:  |  Size: 133 KiB

Before

Width:  |  Height:  |  Size: 25 KiB

After

Width:  |  Height:  |  Size: 25 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 122 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 91 KiB

@ -50,7 +50,7 @@
<WarningLevel>4</WarningLevel>
</PropertyGroup>
<PropertyGroup>
<ApplicationIcon>hook_icon.ico</ApplicationIcon>
<ApplicationIcon>Resources\hook_icon.ico</ApplicationIcon>
</PropertyGroup>
<PropertyGroup>
<StartupObject>UWPHook.App</StartupObject>
@ -151,7 +151,7 @@
<None Include="App.config" />
</ItemGroup>
<ItemGroup>
<Resource Include="hook_icon.ico" />
<Resource Include="Resources\hook_icon.ico" />
</ItemGroup>
<ItemGroup>
<None Include="Resources\delete.png" />
@ -172,14 +172,25 @@
<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>
</ProjectReference>
<ProjectReference Include="..\..\SharpSteam\VDFParser\VDFParser\VDFParser.csproj">
<Project>{9543fb59-1eb6-4638-b24c-b12b9d4a15fc}</Project>
<Name>VDFParser</Name>
</ProjectReference>
</ItemGroup>
<ItemGroup>
<Resource Include="Resources\hook_black_transparent.png" />
<Resource Include="Resources\hook_white_background.png" />
</ItemGroup>
<ItemGroup>
<Resource Include="Resources\hook_white_transparent.png" />
</ItemGroup>
<ItemGroup>
<Resource Include="Resources\4.png" />
<Resource Include="Resources\5.png" />
</ItemGroup>
<Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
<!-- To modify your build process, add your task inside one of the targets below and uncomment it.

Loading…
Cancel
Save