protected override ExecutionResult DoExecute(string arg) { if (string.IsNullOrWhiteSpace(arg)) { Notifyer.NotifyWarning($"Cannot switch to an empty session!"); return(ExecutionResult.SuccessHide); } else { var s = DataService.GetSession(arg); if (s != null) { var aps = SettingsService.Get(); aps.SessionId = s.Id; SettingsService.Save(aps); Log.Info($"Switched to Session '{s.Name}'"); Notifyer.NotifyInfo($"Switched to Session '{s.Name}'"); } else { Notifyer.NotifyWarning($"Session '{arg}' does not exist."); } return(ExecutionResult.SuccessHide); } }
public override void Execute(Cmdline cmd) { var list = new string[] { "list", "l" }; var parameters = cmd.Parameters.ToLower().Trim(); if (list.Contains(parameters)) { ShowHistory(); } else if (string.IsNullOrWhiteSpace(parameters)) { using (var s = new ClipboardManager()) { s.AddClipboardContent(); ShowHistory(); Notifyer.NotifyInfo("Clipboard content saved."); } } else { Notifyer.NotifyWarning($"Not supported argument '{parameters}'. Use no argument to save clipboard or 'l' or 'list' to see history"); } }