//=------------------------------------------------------------------= //=------------------------------------------------------------------= //=------------------------------------------------------------------= //=------------------------------------------------------------------= // Private/Protected Methods/Functions/Properties //=------------------------------------------------------------------= //=------------------------------------------------------------------= //=------------------------------------------------------------------= //=------------------------------------------------------------------= //=------------------------------------------------------------------= // OnSelectedToolStripChanged //=------------------------------------------------------------------= /// <summary> /// A method to invoke the SelectedToolStripChanged event. The pattern /// of having an overridable protected OnXXX method to actually do /// the event raising is followed here to encourage people /// subclassing this control to not hook up events on themselves. /// </summary> /// /// <param name="in_ctsaea"> /// Event details with the ToolStrip affected as well as a place to /// put the resulting available items. /// </param> /// protected void OnSelectedToolStripChanged ( CustomizeToolStripAvailableEventArgs in_ctsaea ) { if (SelectedToolStripChanged != null) { SelectedToolStripChanged(this, in_ctsaea); } }
//=------------------------------------------------------------------= // GetItemsForStrip //=------------------------------------------------------------------= /// <summary> /// The user has changed the selected Toolbar or Menu in the /// CustomizeToolStripForm form. We need to get the list of /// available items for this strip from the user now. We'll raise /// an event to get them to tell us. /// </summary> /// /// <param name="in_strip"> /// The ToolStrip (or MenuStrip) that was newly selected. /// </param> /// /// <returns> /// An array of ToolStripItems that should be considered available /// to this ToolStrip. /// </returns> /// internal ToolStripItem[] GetItemsForStrip(ToolStrip in_strip) { CustomizeToolStripAvailableEventArgs ctsaea; ctsaea = new CustomizeToolStripAvailableEventArgs(in_strip); // // fire the event with the user in the normal overridable // fashion and then return the list of available items // for this strip. // OnSelectedToolStripChanged(ctsaea); return(ctsaea.AvailableItems); }