本文整理汇总了C#中System.Windows.Forms.ToolStripItemCollection.AddRange方法的典型用法代码示例。如果您正苦于以下问题:C# ToolStripItemCollection.AddRange方法的具体用法?C# ToolStripItemCollection.AddRange怎么用?C# ToolStripItemCollection.AddRange使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类System.Windows.Forms.ToolStripItemCollection
的用法示例。
在下文中一共展示了ToolStripItemCollection.AddRange方法的11个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: AssignPayPalMenuItems
private void AssignPayPalMenuItems(ToolStripItemCollection dropDownItems)
{
dropDownItems.AddRange(new ToolStripItem[]
{
donateInUSDollarsToolStripMenuItem,
donateInEuroToolStripMenuItem,
donateInGBPToolStripMenuItem
});
}
示例2: ToolStrip
public ToolStrip(ToolStripItem[] items)
{
_items = new ToolStripItemCollection(this, items);
_items.AddRange(items);
BackColor = Color.FromArgb(246, 246, 246);
BorderColor = Color.FromArgb(204, 206, 219);
Orientation = Forms.Orientation.Vertical;
Owner.UpClick += Application_UpClick;
}
示例3: AddItemsToMenu
static void AddItemsToMenu(ToolStripItemCollection collection, List<MenuItemDescriptor> descriptors)
{
foreach (MenuItemDescriptor descriptor in descriptors) {
object item = CreateMenuItemFromDescriptor(descriptor);
if (item is ToolStripItem) {
collection.Add((ToolStripItem)item);
if (item is IStatusUpdate)
((IStatusUpdate)item).UpdateStatus();
} else {
ISubmenuBuilder submenuBuilder = (ISubmenuBuilder)item;
collection.AddRange(submenuBuilder.BuildSubmenu(descriptor.Codon, descriptor.Caller));
}
}
}
示例4: AddItemsToMenu
public static void AddItemsToMenu(ToolStripItemCollection collection, object owner, string addInTreePath)
{
ArrayList buildItems = AddInTree.GetTreeNode(addInTreePath).BuildChildItems(owner);
foreach (object item in buildItems) {
if (item is ToolStripItem) {
collection.Add((ToolStripItem)item);
if (item is IStatusUpdate)
((IStatusUpdate)item).UpdateStatus();
} else {
ISubmenuBuilder submenuBuilder = (ISubmenuBuilder)item;
collection.AddRange(submenuBuilder.BuildSubmenu(null, owner));
}
}
}
示例5: AddItemsToMenu
static void AddItemsToMenu(ToolStripItemCollection collection, IEnumerable<MenuItemDescriptor> descriptors)
{
foreach (MenuItemDescriptor descriptor in descriptors) {
object item = CreateMenuItemFromDescriptor(descriptor);
if (item is ToolStripItem) {
collection.Add((ToolStripItem)item);
if (item is IStatusUpdate)
((IStatusUpdate)item).UpdateStatus();
} else {
IMenuItemBuilder submenuBuilder = (IMenuItemBuilder)item;
collection.AddRange(submenuBuilder.BuildItems(descriptor.Codon, descriptor.Parameter).Cast<ToolStripItem>().ToArray());
}
}
}
示例6: AddItemsToMenu
public static void AddItemsToMenu(ToolStripItemCollection collection, object owner, string addInTreePath)
{
ArrayList list = AddInTree.GetTreeNode(addInTreePath).BuildChildItems(owner);
foreach (object obj2 in list)
{
if (obj2 is ToolStripItem)
{
collection.Add((ToolStripItem) obj2);
if (obj2 is IStatusUpdate)
{
((IStatusUpdate) obj2).UpdateStatus();
}
}
else
{
ISubmenuBuilder builder = (ISubmenuBuilder) obj2;
collection.AddRange(builder.BuildSubmenu(null, owner));
}
}
}
示例7: AssignHelpMenuItems
private void AssignHelpMenuItems(ToolStripItemCollection dropDownItems)
{
dropDownItems.AddRange(new ToolStripItem[] {
displayXrmToolBoxHelpToolStripMenuItem});
}
示例8: AssignCodePlexMenuItems
private void AssignCodePlexMenuItems(ToolStripItemCollection dropDownItems)
{
dropDownItems.AddRange(new ToolStripItem[] {
startADiscussionToolStripMenuItem});
}
示例9: getSessionMenuItems
/// <summary>
/// Add the array of menu items to the system tray
/// </summary>
/// <param name="cms">The menu</param>
/// <param name="parent">The root of the systray menu</param>
public override void getSessionMenuItems(ContextMenuStrip cms, ToolStripItemCollection parent)
{
// Suspend the layout before modification
cms.SuspendLayout();
parent.Clear();
// Setup the System tray array of menu items
ToolStripMenuItem[] tsmiArray = new ToolStripMenuItem[getSessionController().getSessionList().Count];
int i = 0;
foreach (Session s in getSessionController().getSessionList())
{
tsmiArray[i] = new ToolStripMenuItem(s.SessionDisplayText, null, listBox1_DoubleClick);
// Make sure the menu item is tagged with the session
tsmiArray[i].Tag = s;
i++;
}
if ( tsmiArray != null )
parent.AddRange(tsmiArray);
// Now resume the layout
cms.ResumeLayout();
}
示例10: SortItems
public void SortItems(ToolStripItemCollection items)
{
if(items == null)
throw new ArgumentNullException("items");
ArrayList list = new ArrayList();
foreach(object o in items)
list.Add(o);
list.Sort(new ToolStripCustomIComparer());
items.Clear();
items.AddRange((ToolStripItem[])list.ToArray(typeof(ToolStripItem)));
}
示例11: MoveToolStripItems
private static void MoveToolStripItems(ToolStripItemCollection from, ToolStripItemCollection to)
{
ToolStripItem[] arr = new ToolStripItem[from.Count];
from.CopyTo(arr, 0);
to.AddRange(arr);
}