internal ChangeToolStripParentVerb(string text, ToolStripDesigner designer) { this._designer = designer; this._provider = designer.Component.Site; this._host = (IDesignerHost) this._provider.GetService(typeof(IDesignerHost)); this.componentChangeSvc = (IComponentChangeService) this._provider.GetService(typeof(IComponentChangeService)); }
public ToolStripActionList(ToolStripDesigner designer) : base(designer.Component) { this._toolStrip = (ToolStrip) designer.Component; this.designer = designer; this.changeParentVerb = new ChangeToolStripParentVerb(System.Design.SR.GetString("ToolStripDesignerEmbedVerb"), designer); if (!(this._toolStrip is StatusStrip)) { this.standardItemsVerb = new StandardMenuStripVerb(System.Design.SR.GetString("ToolStripDesignerStandardItemsVerb"), designer); } }
internal StandardMenuStripVerb(string text, ToolStripDesigner designer) { this._designer = designer; this._provider = designer.Component.Site; this._host = (IDesignerHost) this._provider.GetService(typeof(IDesignerHost)); this.componentChangeSvc = (IComponentChangeService) this._provider.GetService(typeof(IComponentChangeService)); if (text == null) { text = System.Design.SR.GetString("ToolStripDesignerStandardItemsVerb"); } }
public void Dispose() { if (this.toolDesigner != null) { this.toolDesigner.Dispose(); this.toolDesigner = null; } if (this.toolItemDesigner != null) { this.toolItemDesigner.Dispose(); this.toolItemDesigner = null; } if (this.componentChangeSvc != null) { this.componentChangeSvc.ComponentRemoved -= new ComponentEventHandler(this.OnComponentRemoved); this.componentChangeSvc = null; } }
internal void SetItemVisible(bool toolStripSelected, ToolStripDesigner designer) { if (toolStripSelected) { if (!this.currentVisible) { this.ToolStripItem.Visible = true; if ((designer != null) && !designer.FireSyncSelection) { designer.FireSyncSelection = true; } } } else if (!this.currentVisible) { this.ToolStripItem.Visible = this.currentVisible; } }
internal void SelectNextItem(ISelectionService service, bool enterKeyPressed, ToolStripDesigner designer) { if (this.ToolStripItem is ToolStripDropDownItem) { this.SetSelection(enterKeyPressed); } else { ToolStrip immediateParent = (ToolStrip) this.ImmediateParent; if (immediateParent is ToolStripOverflow) { immediateParent = this.ToolStripItem.Owner; } int index = immediateParent.Items.IndexOf(this.ToolStripItem); System.Windows.Forms.ToolStripItem item2 = immediateParent.Items[index + 1]; ToolStripKeyboardHandlingService service2 = (ToolStripKeyboardHandlingService) this.GetService(typeof(ToolStripKeyboardHandlingService)); if (service2 != null) { if (item2 == designer.EditorNode) { service2.SelectedDesignerControl = item2; this.selSvc.SetSelectedComponents(null, SelectionTypes.Replace); } else { service2.SelectedDesignerControl = null; this.selSvc.SetSelectedComponents(new object[] { item2 }); } } } }