public bool Equals(ToolBarSettings other) { if (other == null) { return(false); } return(Name.Equals(other.Name, StringComparison.InvariantCultureIgnoreCase)); }
private static void SaveSettings(ToolBarTray toolBarTray, ToolBarSettingsType settingsType) { var settings = GetSettings(toolBarTray.Name); settings.ToolBarSettings ??= new List <ToolBarSettings>(); foreach (var toolBar in toolBarTray.ToolBars) { var toolBarSettings = settings.ToolBarSettings.FirstOrDefault(iSettings => iSettings.Name.Equals( toolBar.Name, StringComparison.InvariantCultureIgnoreCase)); if (toolBarSettings != null) { switch (settingsType) { case ToolBarSettingsType.BandIndex: toolBarSettings.BandIndex = toolBar.BandIndex; break; case ToolBarSettingsType.Band: toolBarSettings.Band = toolBar.Band; break; case ToolBarSettingsType.Width: toolBarSettings.Width = toolBar.Width; break; } } else { toolBarSettings = new ToolBarSettings { Name = toolBar.Name, BandIndex = toolBar.BandIndex, Band = toolBar.Band, Width = toolBar.Width, }; settings.ToolBarSettings.Add(toolBarSettings); } } settings.Save(); }
private static void SetToolBarBand(ToolBar toolBar, ToolBarSettings settings) { toolBar.Band = settings.Band; }
private static void SetToolBarWidth(ToolBar toolBar, ToolBarSettings settings) { toolBar.Width = settings.Width; }
private static void SetToolBarBandIndex(ToolBar toolBar, ToolBarSettings settings) { toolBar.BandIndex = settings.BandIndex; }