Exemplo n.º 1
0
 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;
 }
Exemplo n.º 2
0
 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;
 }
Exemplo n.º 3
0
 internal static SecretTheme ToSecretTheme(SecretThemDTO dto) =>
 SecretTheme.FromColors
     (dto.ForegroundColor, dto.BackgroundColor, dto.ButtonBackgroundColor);