protected override void Handle() { if (MessageButtons.No == VsAppShell.Current.ShowMessage(Resources.Warning_DeleteAllVariables, MessageButtons.YesNo)) { return; } try { RSession.ExecuteAsync("rm(list = ls(all = TRUE))").DoNotWait(); } catch (RException ex) { VsAppShell.Current.ShowErrorMessage( string.Format(CultureInfo.InvariantCulture, Resources.Error_UnableToDeleteVariable, ex.Message)); } catch (MessageTransportException) { } }
protected override void Handle() { var ui = _workflow.Services.UI(); if (MessageButtons.No == ui.ShowMessage(Resources.Warning_DeleteAllVariables, MessageButtons.YesNo)) { return; } try { RSession.ExecuteAsync("rm(list = ls(all = TRUE))").DoNotWait(); } catch (RException ex) { ui.ShowErrorMessage(Resources.Error_UnableToDeleteVariable.FormatInvariant(ex.Message)); } catch (ComponentBinaryMissingException ex) { ui.ShowErrorMessage(Resources.Error_UnableToDeleteVariable.FormatInvariant(ex.Message)); } catch (OperationCanceledException) { } }