public void Delete(ExecutedCommand executedCommand)
        {
            _history?.RemoveAll(c => string.Equals(c.Value, executedCommand.Value, StringComparison.OrdinalIgnoreCase));

            _historyContainer.Delete(GetHash(executedCommand.Value));

            Messenger.Default.Send(new CommandHistoryChangedMessage());
        }
Esempio n. 2
0
        private bool TryGetCommandPrivate(string value, out ExecutedCommand executedCommand)
        {
            var key = GetHash(value);

            executedCommand = null;

            if (!_historyContainer.TryGetValue(key, out var cmd))
            {
                return(false);
            }

            if (cmd is string cmdStr)
            {
                try
                {
                    executedCommand = JsonConvert.DeserializeObject <ExecutedCommand>(cmdStr);

                    return(true);
                }
                catch
                {
                    // ignored
                }
            }
            else if (cmd is ExecutedCommand execCmd)
            {
                executedCommand = execCmd;

                return(true);
            }

            // Not a valid command, so delete it:
            _historyContainer.Delete(key);

            return(false);
        }
Esempio n. 3
0
        public void DeleteTheme(Guid id)
        {
            _themes.Delete(id.ToString());

            foreach (var profile in GetShellProfiles())
            {
                if (profile.TerminalThemeId == id)
                {
                    profile.TerminalThemeId = Guid.Empty;
                    SaveShellProfile(profile);
                }
            }

            Messenger.Default.Send(new ThemeDeletedMessage(id));
        }
Esempio n. 4
0
        public void DeleteTheme(Guid id)
        {
            _themes.Delete(id.ToString());

            foreach (var profile in GetShellProfiles())
            {
                if (profile.TerminalThemeId == id)
                {
                    profile.TerminalThemeId = Guid.Empty;
                    SaveShellProfile(profile);
                }
            }

            ThemeDeleted?.Invoke(this, id);
        }
Esempio n. 5
0
 public void DeleteTheme(Guid id)
 {
     _themes.Delete(id.ToString());
 }
Esempio n. 6
0
 public void DeleteShellProfile(Guid id)
 {
     _shellProfiles.Delete(id.ToString());
 }
Esempio n. 7
0
 public void DeleteSshProfile(Guid id)
 {
     _sshProfiles.Delete(id.ToString());
     Messenger.Default.Send(new ShellProfileDeletedMessage(id));
     Messenger.Default.Send(new KeyBindingsChangedMessage());
 }
Esempio n. 8
0
 public void DeleteShellProfile(Guid id)
 {
     _shellProfiles.Delete(id.ToString());
     Messenger.Default.Send(new ShellProfileDeletedMessage(id));
 }
Esempio n. 9
0
 public void DeleteShellProfile(Guid id)
 {
     _shellProfiles.Delete(id.ToString());
     ShellProfileDeleted?.Invoke(this, id);
 }