protected override void RegisterActionLists(System.ComponentModel.Design.DesignerActionListCollection list) { base.RegisterActionLists(list); list.Add(new XRDataContainerDesignerDataActionList(this)); list.Add(new XRDataContainerDesignerSortActionList(this)); list.Add(CreateColumnActionList()); }
protected override void GetComponentDesignerActions(IComponent component, DesignerActionListCollection actionLists) { if (component == null) { throw new ArgumentNullException("component"); } if (actionLists == null) { throw new ArgumentNullException("actionLists"); } IServiceContainer site = component.Site as IServiceContainer; if (site != null) { DesignerCommandSet service = (DesignerCommandSet) site.GetService(typeof(DesignerCommandSet)); if (service != null) { DesignerActionListCollection lists = service.ActionLists; if (lists != null) { actionLists.AddRange(lists); } } if ((actionLists.Count == 0) || ((actionLists.Count == 1) && (actionLists[0] is ControlDesigner.ControlDesignerActionList))) { DesignerVerbCollection verbs = service.Verbs; if ((verbs != null) && (verbs.Count != 0)) { DesignerVerb[] array = new DesignerVerb[verbs.Count]; verbs.CopyTo(array, 0); actionLists.Add(new DesignerActionVerbList(array)); } } } }
protected virtual void GetComponentDesignerActions(IComponent component, DesignerActionListCollection actionLists) { if (component == null) { throw new ArgumentNullException("component"); } if (actionLists == null) { throw new ArgumentNullException("actionLists"); } IServiceContainer site = component.Site as IServiceContainer; if (site != null) { DesignerCommandSet service = (DesignerCommandSet) site.GetService(typeof(DesignerCommandSet)); if (service != null) { DesignerActionListCollection lists = service.ActionLists; if (lists != null) { actionLists.AddRange(lists); } if (actionLists.Count == 0) { DesignerVerbCollection verbs = service.Verbs; if ((verbs != null) && (verbs.Count != 0)) { ArrayList list = new ArrayList(); bool flag = this.componentToVerbsEventHookedUp[component] == null; if (flag) { this.componentToVerbsEventHookedUp[component] = true; } foreach (DesignerVerb verb in verbs) { if (flag) { verb.CommandChanged += new EventHandler(this.OnVerbStatusChanged); } if (verb.Enabled && verb.Visible) { list.Add(verb); } } if (list.Count != 0) { DesignerActionVerbList list2 = new DesignerActionVerbList((DesignerVerb[]) list.ToArray(typeof(DesignerVerb))); actionLists.Add(list2); } } } if (lists != null) { foreach (DesignerActionList list3 in lists) { DesignerActionItemCollection sortedActionItems = list3.GetSortedActionItems(); if ((sortedActionItems == null) || (sortedActionItems.Count == 0)) { actionLists.Remove(list3); } } } } } }
protected virtual void GetComponentDesignerActions(IComponent component, DesignerActionListCollection actionLists) { if (component == null) { throw new ArgumentNullException("component"); } if (actionLists == null) { throw new ArgumentNullException("actionLists"); } IServiceContainer site = component.Site as IServiceContainer; if (site != null) { DesignerCommandSet service = (DesignerCommandSet)site.GetService(typeof(DesignerCommandSet)); if (service != null) { DesignerActionListCollection lists = service.ActionLists; if (lists != null) { actionLists.AddRange(lists); } if (actionLists.Count == 0) { DesignerVerbCollection verbs = service.Verbs; if ((verbs != null) && (verbs.Count != 0)) { ArrayList list = new ArrayList(); bool flag = this.componentToVerbsEventHookedUp[component] == null; if (flag) { this.componentToVerbsEventHookedUp[component] = true; } foreach (DesignerVerb verb in verbs) { if (flag) { verb.CommandChanged += new EventHandler(this.OnVerbStatusChanged); } if (verb.Enabled && verb.Visible) { list.Add(verb); } } if (list.Count != 0) { DesignerActionVerbList list2 = new DesignerActionVerbList((DesignerVerb[])list.ToArray(typeof(DesignerVerb))); actionLists.Add(list2); } } } if (lists != null) { foreach (DesignerActionList list3 in lists) { DesignerActionItemCollection sortedActionItems = list3.GetSortedActionItems(); if ((sortedActionItems == null) || (sortedActionItems.Count == 0)) { actionLists.Remove(list3); } } } } } }
protected override void RegisterActionLists(System.ComponentModel.Design.DesignerActionListCollection list) { base.RegisterActionLists(list); list.Add(new MyCustomLabelActionList(this)); }
protected virtual void GetComponentDesignerActions(IComponent component, DesignerActionListCollection actionLists) { if (component == null) { throw new ArgumentNullException(nameof(component)); } if (actionLists == null) { throw new ArgumentNullException(nameof(actionLists)); } if (component.Site is IServiceContainer sc) { DesignerCommandSet dcs = (DesignerCommandSet)sc.GetService(typeof(DesignerCommandSet)); if (dcs != null) { DesignerActionListCollection pullCollection = dcs.ActionLists; if (pullCollection != null) { actionLists.AddRange(pullCollection); } // if we don't find any, add the verbs for this component there... if (actionLists.Count == 0) { DesignerVerbCollection verbs = dcs.Verbs; if (verbs != null && verbs.Count != 0) { ArrayList verbsArray = new ArrayList(); bool hookupEvents = _componentToVerbsEventHookedUp[component] == null; if (hookupEvents) { _componentToVerbsEventHookedUp[component] = true; } foreach (DesignerVerb verb in verbs) { if (hookupEvents) { //Debug.WriteLine("hooking up change event for verb " + verb.Text); verb.CommandChanged += new EventHandler(OnVerbStatusChanged); } if (verb.Enabled && verb.Visible) { //Debug.WriteLine("adding verb to collection for panel... " + verb.Text); verbsArray.Add(verb); } } if (verbsArray.Count != 0) { DesignerActionVerbList davl = new DesignerActionVerbList((DesignerVerb[])verbsArray.ToArray(typeof(DesignerVerb))); actionLists.Add(davl); } } } // remove all the ones that are empty... ie GetSortedActionList returns nothing we might waste some time doing this twice but don't have much of a choice here... the panel is not yet displayed and we want to know if a non empty panel is present... // NOTE: We do this AFTER the verb check that way to disable auto verb upgrading you can just return an empty actionlist collection if (pullCollection != null) { foreach (DesignerActionList actionList in pullCollection) { DesignerActionItemCollection collection = actionList.GetSortedActionItems(); if (collection == null || collection.Count == 0) { actionLists.Remove(actionList); } } } } } }
void BuildActionLists() { m_actionLists = new DesignerActionListCollection(); m_actionLists.Add(new DataGridViewChooseDataSourceActionList(this)); m_actionLists.Add(new DataGridViewColumnEditingActionList(this)); m_actionLists.Add(new DataGridViewPropertiesActionList(this)); }
protected override void RegisterActionLists(System.ComponentModel.Design.DesignerActionListCollection list) { base.RegisterActionLists(list); list.Add(new XRTreeListDesignerDataActionList(this, this.Component as XRTreeList)); }