2020-12-19 19:14:40 -05:00
|
|
|
|
using System;
|
|
|
|
|
using System.Collections.Generic;
|
|
|
|
|
using System.Collections.ObjectModel;
|
|
|
|
|
using System.Linq;
|
|
|
|
|
using System.Text;
|
|
|
|
|
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;
|
2020-12-25 10:49:51 -05:00
|
|
|
|
using auto_creamapi.Models;
|
2020-12-19 19:14:40 -05:00
|
|
|
|
using auto_creamapi.Utils;
|
|
|
|
|
using NinjaNye.SearchExtensions;
|
|
|
|
|
using NinjaNye.SearchExtensions.Models;
|
|
|
|
|
|
|
|
|
|
namespace auto_creamapi
|
|
|
|
|
{
|
|
|
|
|
/// <summary>
|
|
|
|
|
/// Interaction logic for SearchResultWindow.xaml
|
|
|
|
|
/// </summary>
|
|
|
|
|
public partial class SearchResultWindow
|
|
|
|
|
{
|
2020-12-23 06:34:31 -05:00
|
|
|
|
public SearchResultWindow(IEnumerable<SteamApp> list)
|
2020-12-19 19:14:40 -05:00
|
|
|
|
{
|
|
|
|
|
InitializeComponent();
|
|
|
|
|
DgApps.ItemsSource = list;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
private void OK_OnClick(object sender, RoutedEventArgs e)
|
|
|
|
|
{
|
|
|
|
|
GetSelectedApp();
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
private void DgApps_OnMouseDoubleClick(object sender, MouseButtonEventArgs e)
|
|
|
|
|
{
|
|
|
|
|
GetSelectedApp();
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
private void Cancel_OnClick(object sender, RoutedEventArgs e)
|
|
|
|
|
{
|
|
|
|
|
Close();
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
private void GetSelectedApp()
|
|
|
|
|
{
|
|
|
|
|
if (Application.Current.MainWindow is MainWindow currentMainWindow)
|
|
|
|
|
{
|
2020-12-23 06:34:31 -05:00
|
|
|
|
var app = (SteamApp) DgApps.SelectedItem;
|
|
|
|
|
if (app != null)
|
|
|
|
|
{
|
|
|
|
|
MyLogger.Log.Information($"Successfully got app {app}");
|
2020-12-25 10:49:51 -05:00
|
|
|
|
//currentMainWindow.Game.Text = app.Name;
|
|
|
|
|
//currentMainWindow.AppId.Text = app.AppId.ToString();
|
2020-12-23 06:34:31 -05:00
|
|
|
|
}
|
2020-12-19 19:14:40 -05:00
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
Close();
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|