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()); }
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); }
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)); }
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); }
public void DeleteTheme(Guid id) { _themes.Delete(id.ToString()); }
public void DeleteShellProfile(Guid id) { _shellProfiles.Delete(id.ToString()); }
public void DeleteSshProfile(Guid id) { _sshProfiles.Delete(id.ToString()); Messenger.Default.Send(new ShellProfileDeletedMessage(id)); Messenger.Default.Send(new KeyBindingsChangedMessage()); }
public void DeleteShellProfile(Guid id) { _shellProfiles.Delete(id.ToString()); Messenger.Default.Send(new ShellProfileDeletedMessage(id)); }
public void DeleteShellProfile(Guid id) { _shellProfiles.Delete(id.ToString()); ShellProfileDeleted?.Invoke(this, id); }