/// <summary>Loads the <see cref="Theme" /> from the file path.</summary> /// <param name="filePath">The file path.</param> public void Load(string filePath) { if (string.IsNullOrEmpty(filePath)) { throw new NoNullAllowedException(ExceptionMessenger.IsNullOrEmpty(filePath)); } if (!File.Exists(filePath)) { throw new FileNotFoundException(ExceptionMessenger.FileNotFound(filePath)); } try { if (File.Exists(filePath)) { Theme theme = ThemeSerialization.Deserialize(filePath); UpdateTheme(theme.Information, theme.ColorPalette); } else { ConsoleEx.WriteDebug(new FileNotFoundException(ExceptionMessenger.FileNotFound(filePath))); } } catch (Exception e) { ConsoleEx.WriteDebug(e); } }
/// <summary>Loads a <see cref="Theme" /> from resources.</summary> /// <param name="themes">The theme.</param> private void LoadThemeFromResources(Themes themes) { try { Theme theme = ThemeSerialization.Deserialize(themes); UpdateTheme(theme.Information, theme.ColorPalette); } catch (Exception e) { ConsoleEx.WriteDebug(e); } }