public SecretTheme SwitchTheme(SecretTheme oldTheme) { var currTheme = oldTheme == SecretTheme.Light ? SecretTheme.Dark : SecretTheme.Light; var json = JsonConvert.SerializeObject(SecretThemDTO.FromSecretTheme(currTheme)); StoreSecrets(json); return currTheme; }
public SecretTheme RetriveSecretTheme() { var json = RetriveSecrets(); if(string.IsNullOrWhiteSpace(json)) { return SecretTheme.Light; } var themDTO = JsonConvert.DeserializeObject<SecretThemDTO> (json); var currTheme = SecretThemDTO.ToSecretTheme(themDTO); return currTheme; }
internal static SecretTheme ToSecretTheme(SecretThemDTO dto) => SecretTheme.FromColors (dto.ForegroundColor, dto.BackgroundColor, dto.ButtonBackgroundColor);