コード例 #1
0
ファイル: ToolBarSettings.cs プロジェクト: ridgew/OpenAPI.Net
        public bool Equals(ToolBarSettings other)
        {
            if (other == null)
            {
                return(false);
            }

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