internal static void Load() { var values = Enum.GetValues(typeof(SchemeTarget)); foreach (SchemeTarget val in values) { try { _dict[val] = new ColorSchemeCollection(val, GetFilename(val)); } catch (Exception ex) { Logger.Current.Warn("Failed to load color schemes:", ex); } } }
public void UpdateItems() { if (_schemeList != null) { _schemeList.ListChanged -= OnListChanged; // unsubscribe from the previous list } _schemeList = ColorSchemeProvider.GetList(Target); if (_schemeList != null) { int index = SelectedIndex; _schemeList.ListChanged += OnListChanged; GenerateItems(); if (index >= 0 && index < Items.Count) { SelectedIndex = index; } } }
/// <summary> /// Initializes a new instance of the frmColorSchemes class /// </summary> internal ColorSchemesForm(IAppContext context, ColorSchemeCollection provider) : base(context) { if (context == null) { throw new ArgumentNullException("context"); } if (provider == null) { throw new ArgumentNullException("provider"); } _provider = provider; InitializeComponent(); Initialize(); _noEvents = true; RefreshControls(); _noEvents = false; }