예제 #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;
 }
예제 #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;
 }
예제 #3
0
 internal static SecretTheme ToSecretTheme(SecretThemDTO dto) =>
 SecretTheme.FromColors
     (dto.ForegroundColor, dto.BackgroundColor, dto.ButtonBackgroundColor);