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); }
private List <ExecutedCommand> GetAllPrivate() { try { return(_historyContainer.GetAll() .Select(c => JsonConvert.DeserializeObject <ExecutedCommand>((string)c)).ToList()); } catch { // ignored } _historyContainer.Clear(); return(new List <ExecutedCommand>()); }