public Guid GetCurrentThemeId() { if (_roamingSettings.TryGetValue(CurrentThemeKey, out object value)) { return((Guid)value); } return(_defaultValueProvider.GetDefaultThemeId()); }
public Guid GetDefaultShellProfileId() { if (_localSettings.TryGetValue(DefaultShellProfileKey, out object value)) { return((Guid)value); } return(_defaultValueProvider.GetDefaultShellProfileId()); }
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); }