public void Remove(ToolStripSettingElement item)
 {
     if (this.BaseIndexOf(item) >= 0)
     {
         this.BaseRemove(item.Name);
     }
 }
 public int IndexOf(ToolStripSettingElement item)
 {
     return(this.BaseIndexOf(item));
 }
 public void Add(ToolStripSettingElement item)
 {
     this.BaseAdd(item);
 }
 public void Add(ToolStripSettingElement item)
 {
     this.BaseAdd(item);
 }
 public void Remove(ToolStripSettingElement item)
 {
     if (this.BaseIndexOf(item) >= 0)
         this.BaseRemove(item.Name);
 }
 private ToolStripPanel GetToolStripPanelToJoin(ToolStripSettingElement setting)
 {
     switch (setting.Dock)
     {
         case "Left":
             return this.LeftToolStripPanel;
         case "Right":
             return this.RightToolStripPanel;
         case "Bottom":
             return this.BottomToolStripPanel;
         default: // defensive position
             return this.TopToolStripPanel;
     }
 }
 public int IndexOf(ToolStripSettingElement item)
 {
     return this.BaseIndexOf(item);
 }
 private static void ApplyLastPosition(ToolStripSettingElement setting, ToolStrip strip)
 {
     strip.Left = setting.Left;
     strip.Top = setting.Top;
 }
 private void JoinPanelOnLastPosition(ToolStrip strip, ToolStripSettingElement setting)
 {
     ToolStripPanel toolStripPanel = this.GetToolStripPanelToJoin(setting);
     if (!toolStripPanel.Controls.Contains(strip))
     {
         Point lastPosition = new Point(setting.Left, setting.Top);
         toolStripPanel.Join(strip, lastPosition);
     }
     else // set position only when comming from fullscreen
     {
         ApplyLastPosition(setting, strip);
     }
 }
        private ToolStrip FindToolStripForSetting(ToolStripSettingElement setting)
        {
            if (setting.Name == this.toolbarStd.Name)
                return this.toolbarStd;

            if (setting.Name == this.favoriteToolBar.Name)
                return this.favoriteToolBar;

            if (setting.Name == this.SpecialCommandsToolStrip.Name)
                return this.SpecialCommandsToolStrip;

            if (setting.Name == this.menuStrip.Name)
                return this.menuStrip;

            return null;
        }
        private ToolStripMenuItem FindMenuForSetting(ToolStripSettingElement setting)
        {
            if (setting.Name == this.toolbarStd.Name)
                return this.standardToolbarToolStripMenuItem;

            if (setting.Name == this.favoriteToolBar.Name)
                return this.toolStripMenuItemShowHideFavoriteToolbar;

            if (setting.Name == this.SpecialCommandsToolStrip.Name)
                return this.shortcutsToolStripMenuItem;

            return null;
        }
 private void RestoreStripLayout(ToolStripSettingElement setting, ToolStrip strip)
 {
     if (strip != null)
     {
         strip.Visible = setting.Visible;
         this.JoinPanelOnLastPosition(strip, setting);
     }
 }