protected override void OnExecute(object param)
{
Window1 appwindow = LifetimeService.Instance.Container.Resolve<Window1>();
try
{
appwindow.setLMsgInStatusBar("Please wait ... Installing package(s) from CRAN ...");
PackageHelperMethods phm = new PackageHelperMethods();
UAReturn r = phm.InstallCRANPackage();// InstallCRANPackage();
if (r != null)
{
if (r.Success)
{
SendToOutputWindow("Install Package from CRAN", r.CommandString);
}
else if (!r.Success)
{
SendToOutputWindow("Install Package from CRAN", r.Error);
}
}
else
{
if(r != null) // if user didn't press 'Cancel'
SendToOutputWindow("Error Installing CRAN Package", "Package names are case sensitive. Please check your packgename.", false);
}
}
catch (Exception ex)
{
MessageBox.Show("Error while loading package.", "Error Occurred!");
logService.WriteToLogLevel("Error:", LogLevelEnum.Error, ex);
}
appwindow.setLMsgInStatusBar("");
}