Beispiel #1
0
        public bool Equals(ToolBarSettings other)
        {
            if (other == null)
            {
                return(false);
            }

            return(Name.Equals(other.Name, StringComparison.InvariantCultureIgnoreCase));
        }
Beispiel #2
0
        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();
        }
Beispiel #3
0
 private static void SetToolBarBand(ToolBar toolBar, ToolBarSettings settings)
 {
     toolBar.Band = settings.Band;
 }
Beispiel #4
0
 private static void SetToolBarWidth(ToolBar toolBar, ToolBarSettings settings)
 {
     toolBar.Width = settings.Width;
 }
Beispiel #5
0
 private static void SetToolBarBandIndex(ToolBar toolBar, ToolBarSettings settings)
 {
     toolBar.BandIndex = settings.BandIndex;
 }