mirror of
https://github.com/rommapp/playnite-plugin.git
synced 2026-04-23 06:54:42 +00:00
51 lines
1.4 KiB
C#
51 lines
1.4 KiB
C#
using System;
|
|
using System.Windows;
|
|
using System.Windows.Controls;
|
|
using System.Windows.Documents;
|
|
namespace RomM.DownloadQueue
|
|
{
|
|
public partial class DownloadQueueView : UserControl
|
|
{
|
|
private readonly RomM Plugin;
|
|
|
|
public DownloadQueueView(RomM plugin)
|
|
{
|
|
Plugin = plugin;
|
|
InitializeComponent();
|
|
}
|
|
|
|
private void CancelDownload(object sender, EventArgs e)
|
|
{
|
|
Plugin.DownloadQueue.CancelInstall();
|
|
}
|
|
|
|
private void BackToLibrary(object sender, RoutedEventArgs e)
|
|
{
|
|
Plugin.PlayniteApi.MainView.SwitchToLibraryView();
|
|
}
|
|
|
|
private void RemoveItem(object sender, RoutedEventArgs e)
|
|
{
|
|
var hyperlink = (Hyperlink)sender;
|
|
|
|
Plugin.DownloadQueue.Remove(hyperlink.DataContext as DownloadQueueItem);
|
|
}
|
|
|
|
private void Play(object sender, RoutedEventArgs e)
|
|
{
|
|
var button = (Button)sender;
|
|
var item = button.DataContext as DownloadQueueItem;
|
|
|
|
Plugin.PlayniteApi.StartGame(item.Game.Id);
|
|
}
|
|
|
|
private void ViewInLibrary(object sender, RoutedEventArgs e)
|
|
{
|
|
var button = (Button)sender;
|
|
var item = button.DataContext as DownloadQueueItem;
|
|
|
|
Plugin.PlayniteApi.MainView.SwitchToLibraryView();
|
|
Plugin.PlayniteApi.MainView.SelectGame(item.Game.Id);
|
|
}
|
|
}
|
|
} |