private List <ExecutedCommand> LoadHistory()
        {
            List <ExecutedCommand> history = null;

            try
            {
                history = _historyContainer.GetAll()
                          .Select(c => JsonConvert.DeserializeObject <ExecutedCommand>((string)c)).ToList();
            }
            catch
            {
                // ignored
            }

            if (history == null)
            {
                // If there's an issue with getting history, we simply clear history as if the app haven't been used at all.
                // Not too useful fix, but it shouldn't happen ever anyway.
                _historyContainer.Clear();

                return(new List <ExecutedCommand>());
            }

            FixMoshBackwardCompatibility(history);

            return(history);
        }
Ejemplo n.º 2
0
        private List <ExecutedCommand> GetAllPrivate()
        {
            try
            {
                return(_historyContainer.GetAll()
                       .Select(c => JsonConvert.DeserializeObject <ExecutedCommand>((string)c)).ToList());
            }
            catch
            {
                // ignored
            }

            _historyContainer.Clear();

            return(new List <ExecutedCommand>());
        }
Ejemplo n.º 3
0
 public IEnumerable <TerminalTheme> GetThemes()
 {
     return(_themes.GetAll().Select(x => JsonConvert.DeserializeObject <TerminalTheme>((string)x)).ToList());
 }
Ejemplo n.º 4
0
 public IEnumerable <ShellProfile> GetShellProfiles()
 {
     return(_shellProfiles.GetAll().Select(x => JsonConvert.DeserializeObject <ShellProfile>((string)x)).ToList());
 }
Ejemplo n.º 5
0
 public IEnumerable <SshProfile> GetSshProfiles()
 {
     return(_sshProfiles.GetAll().Select(x => JsonConvert.DeserializeObject <SshProfile>((string)x))
            .Select(MoshBackwardCompatibilityFixProfile).Cast <SshProfile>());
 }