/// <summary> /// Sets the custom theme. /// </summary> /// <param name="manager">The manager.</param> /// <param name="palette">The palette.</param> /// <param name="paletteFileName">Name of the palette file.</param> public static void SetCustomTheme(KryptonManager manager, KryptonPalette palette, string paletteFileName) { PaletteThemeSettingsManager paletteThemeSettingsManager = new PaletteThemeSettingsManager(); ThemeManager themeManager = new ThemeManager(); themeManager.SetTheme(PaletteModeManager.Custom, manager); palette.Import(paletteFileName); paletteThemeSettingsManager.SetCustomThemeFilePath(paletteFileName); }
public void ChangeTheme(PaletteMode paletteMode) { SetPaletteMode(paletteMode); switch (paletteMode) { case PaletteMode.Global: _themeOptions.KryptonManager.GlobalPaletteMode = PaletteModeManager.Custom; break; case PaletteMode.ProfessionalSystem: _themeOptions.KryptonManager.GlobalPaletteMode = PaletteModeManager.ProfessionalSystem; break; case PaletteMode.ProfessionalOffice2003: _themeOptions.KryptonManager.GlobalPaletteMode = PaletteModeManager.ProfessionalOffice2003; break; case PaletteMode.Office2007Blue: _themeOptions.KryptonManager.GlobalPaletteMode = PaletteModeManager.Office2007Blue; break; case PaletteMode.Office2007Silver: _themeOptions.KryptonManager.GlobalPaletteMode = PaletteModeManager.Office2007Silver; break; case PaletteMode.Office2007Black: _themeOptions.KryptonManager.GlobalPaletteMode = PaletteModeManager.Office2007Black; break; case PaletteMode.Office2010Blue: _themeOptions.KryptonManager.GlobalPaletteMode = PaletteModeManager.Office2010Blue; break; case PaletteMode.Office2010Silver: _themeOptions.KryptonManager.GlobalPaletteMode = PaletteModeManager.Office2010Silver; break; case PaletteMode.Office2010Black: _themeOptions.KryptonManager.GlobalPaletteMode = PaletteModeManager.Office2010Black; break; case PaletteMode.Office2013: _themeOptions.KryptonManager.GlobalPaletteMode = PaletteModeManager.Office2013; break; case PaletteMode.Office2013White: _themeOptions.KryptonManager.GlobalPaletteMode = PaletteModeManager.Office2013White; break; case PaletteMode.SparkleBlue: _themeOptions.KryptonManager.GlobalPaletteMode = PaletteModeManager.SparkleBlue; break; case PaletteMode.SparkleOrange: _themeOptions.KryptonManager.GlobalPaletteMode = PaletteModeManager.SparkleOrange; break; case PaletteMode.SparklePurple: _themeOptions.KryptonManager.GlobalPaletteMode = PaletteModeManager.SparklePurple; break; case PaletteMode.Custom: _themeOptions.KryptonManager.GlobalPaletteMode = PaletteModeManager.Custom; _paletteThemeSettingsManager.SetCustomThemeFilePath(_themeOptions.PaletteFilePathControl.Text); break; default: break; } EnableApplyButton(true); EnableRestoreToDefaultsButton(true); }