Exemplo n.º 1
0
 public override void Execute(Cmdline cmd)
 {
     try
     {
         var exec = new CmdExecutor();
         if (exec.IsConfiguration(cmd.Parameters))
         {
             exec.Configure(cmd.Parameters);
         }
         if (exec.IsList(cmd.Parameters))
         {
             var resul = exec.List();
         }
         else
         {
             exec.Execute(cmd);
             Notifyer.NotifyInfo($"Evernote: note created.");
         }
     }
     catch (Exception ex)
     {
         Logger.Error($"Cannot execute EN plugin: {ex.Message}", ex);
         Notifyer.NotifyError($"Cannot execute EN plugin: {ex.Message}");
     }
 }
Exemplo n.º 2
0
        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);
            }
        }
Exemplo n.º 3
0
        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");
            }
        }