protected override void OnExecute(object param)
{
try
{
//string packagename = Microsoft.VisualBasic.Interaction.InputBox("Enter package name that you want to uninstall.", "Load Library", "");
//if (string.IsNullOrEmpty(packagename))
//{
// //MessageBox.Show("Title/Command cannot be empty, Exiting Dialog install", "Info: Dialog Title Empty.");
// return;
//}
PackageHelperMethods phm = new PackageHelperMethods();
UAReturn rlst = phm.ShowInstalledPackages();
string[] strarr = phm.GetUAReturnStringResult(rlst);
//Create UI show list of installed packges so that user can select and load them
SelectPackagesWindow spw = new SelectPackagesWindow(strarr);
spw.header = "Uninstall Library(s)";
spw.ShowDialog();
IList<string> sel = spw.SelectedItems;
if (sel == null)
return;
string[] selectedpackages = new string[sel.Count];
int i = 0;
foreach (string s in sel)
{
selectedpackages[i] = s;
i++;
}
phm = new PackageHelperMethods();
UAReturn r = phm.PackageFileUninstall(selectedpackages);// PackageFileUninstall(packagename);
if (r != null && r.Success)
{
SendToOutputWindow("Uninstall Package", r.CommandString);
}
else
{
SendToOutputWindow("Error Uninstalling Package", "");
}
}
catch (Exception ex)
{
MessageBox.Show("Error while uninstalling package.", "Error Occurred!");
logService.WriteToLogLevel("Error:", LogLevelEnum.Error, ex);
}
}