private ToolStrip FindToolStripForSetting(ToolStripSetting 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); } if (setting.Name == this.TsRemoteToolbar.Name) { return(this.TsRemoteToolbar); } return(null); }
private void RestoreStripLayout(ToolStripSetting setting, ToolStrip strip) { if (strip != null) { strip.Visible = setting.Visible; this.JoinPanelOnLastPosition(strip, setting); } }
private static void SaveToolStripRow(ToolStripPanelRow row, ToolStripSettings newSettings, String position, int rowIndex) { foreach (ToolStrip strip in row.Controls) { ToolStripSetting setting = new ToolStripSetting(); setting.Dock = position; setting.Row = rowIndex; setting.Left = strip.Left; setting.Top = strip.Top; setting.Name = strip.Name; setting.Visible = strip.Visible; newSettings.Add(newSettings.Count, setting); } }
private void JoinPanelOnLastPosition(ToolStrip strip, ToolStripSetting setting) { ToolStripPanel toolStripPanel = 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 ToolStripMenuItem FindMenuForSetting(ToolStripSetting setting) { if (setting.Name == this.ToolbarStd.Name) { return(this.StandardToolbarToolStripMenuItem); } if (setting.Name == this.FavoriteToolBar.Name) { return(this.ToolStripMenuItemShowHideFavoriteToolbar); } return(null); }
private ToolStripPanel GetToolStripPanelToJoin(ToolStripSetting 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); } }
private static void ApplyLastPosition(ToolStripSetting setting, ToolStrip strip) { strip.Left = setting.Left; strip.Top = setting.Top; }
private ToolStripPanel GetToolStripPanelToJoin(ToolStripSetting 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; } }
private ToolStrip FindToolStripForSetting(ToolStripSetting 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; if (setting.Name == this.TsRemoteToolbar.Name) return this.TsRemoteToolbar; return null; }
private ToolStripMenuItem FindMenuForSetting(ToolStripSetting 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; }