private void libraryGrid_MouseDown(object sender, MouseButtonEventArgs e) { // If clicked button is left (so it will not conflict with context menu) if (!SystemParameters.SwapButtons && e.ChangedButton == MouseButton.Left || SystemParameters.SwapButtons && e.ChangedButton == MouseButton.Right) { // Define our library details from .Tag attribute which we set earlier Definitions.Library Library = (sender as Grid).Tag as Definitions.Library; Definitions.SLM.selectedLibrary = Library; // Update games list from current selection Functions.Games.UpdateMainForm(Library, (Properties.Settings.Default.includeSearchResults && searchText.Text != "Search in Library (by app Name or app ID)") ? searchText.Text : null); } }
private void libraryGrid_Drop(object sender, DragEventArgs e) { Definitions.Library Library = (sender as Grid).Tag as Definitions.Library; Definitions.Game Game = e.Data.GetData(typeof(Definitions.Game)) as Definitions.Game; if (Game == null || Library == null) { return; } if (Game.IsSteamBackup) { System.Diagnostics.Process.Start(Path.Combine(Properties.Settings.Default.steamInstallationPath, "Steam.exe"), $"-install \"{Game.installationPath}\""); } else { new Forms.MoveGameForm(Game, Library).Show(); } }