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);
        }
示例#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>());
        }
 public IEnumerable <TerminalTheme> GetThemes()
 {
     return(_themes.GetAll().Select(x => JsonConvert.DeserializeObject <TerminalTheme>((string)x)).ToList());
 }
 public IEnumerable <ShellProfile> GetShellProfiles()
 {
     return(_shellProfiles.GetAll().Select(x => JsonConvert.DeserializeObject <ShellProfile>((string)x)).ToList());
 }
示例#5
0
 public IEnumerable <SshProfile> GetSshProfiles()
 {
     return(_sshProfiles.GetAll().Select(x => JsonConvert.DeserializeObject <SshProfile>((string)x))
            .Select(MoshBackwardCompatibilityFixProfile).Cast <SshProfile>());
 }