From 9f59bafa50477536938632202ae5d7209b67b6a0 Mon Sep 17 00:00:00 2001 From: Richard Lake Date: Mon, 22 Jun 2015 20:42:12 +0930 Subject: [PATCH] Create a typedef to simplify code. --- GUI/MainInstall.cs | 17 ++++++++--------- 1 file changed, 8 insertions(+), 9 deletions(-) diff --git a/GUI/MainInstall.cs b/GUI/MainInstall.cs index 4713e210e0..69d1c0f285 100644 --- a/GUI/MainInstall.cs +++ b/GUI/MainInstall.cs @@ -8,6 +8,7 @@ namespace CKAN { + using ModChanges = List>; public partial class Main { private BackgroundWorker m_InstallWorker; @@ -27,7 +28,7 @@ private void InstallMods(object sender, DoWorkEventArgs e) // this probably need ClearLog(); var opts = - (KeyValuePair>, RelationshipResolverOptions>) e.Argument; + (KeyValuePair) e.Argument; ModuleInstaller installer = ModuleInstaller.GetInstance(CurrentInstance, GUI.user); // setup progress callback @@ -184,7 +185,7 @@ private void InstallMods(object sender, DoWorkEventArgs e) // this probably need { m_TabController.HideTab("WaitTabPage"); m_TabController.ShowTab("ManageModsTabPage"); - e.Result = new KeyValuePair>>(false, opts.Key); + e.Result = new KeyValuePair(false, opts.Key); return; } @@ -203,7 +204,7 @@ private void InstallMods(object sender, DoWorkEventArgs e) // this probably need }; //Set the result to false/failed in case we return - e.Result = new KeyValuePair>>(false, opts.Key); + e.Result = new KeyValuePair(false, opts.Key); SetDescription("Uninstalling selected mods"); if (!WasSuccessful(() => installer.UninstallList(toUninstall))) return; @@ -224,22 +225,20 @@ private void InstallMods(object sender, DoWorkEventArgs e) // this probably need { if (installCanceled) { - e.Result = new KeyValuePair>>(false, - opts.Key); + e.Result = new KeyValuePair(false,opts.Key); return; } var ret = InstallList(toInstall, opts.Value, downloader); if (!ret) { // install failed for some reason, error message is already displayed to the user - e.Result = new KeyValuePair>>(false, - opts.Key); + e.Result = new KeyValuePair(false,opts.Key); return; } resolvedAllProvidedMods = true; } - e.Result = new KeyValuePair>>(true, opts.Key); + e.Result = new KeyValuePair(true, opts.Key); } /// @@ -355,7 +354,7 @@ private void PostInstallMods(object sender, RunWorkerCompletedEventArgs e) UpdateModsList(); m_TabController.SetTabLock(false); - var result = (KeyValuePair>>) e.Result; + var result = (KeyValuePair) e.Result; if (result.Key) {