private void btnConnections_DropDownOpening(object sender, EventArgs e) { btnConnections.DropDownItems.Clear(); var menuItemsConverter = new ConnectionsTreeToMenuItemsConverter { MouseUpEventHandler = ConnectionsMenuItem_MouseUp }; ToolStripItem[] rootMenuItems = menuItemsConverter.CreateToolStripDropDownItems(Runtime.ConnectionTreeModel).ToArray(); btnConnections.DropDownItems.AddRange(rootMenuItems); }
private void btnConnections_DropDownOpening(object sender, EventArgs e) { _btnConnections.DropDownItems.Clear(); var menuItemsConverter = new ConnectionsTreeToMenuItemsConverter { MouseUpEventHandler = ConnectionsMenuItem_MouseUp }; // ReSharper disable once CoVariantArrayConversion ToolStripItem[] rootMenuItems = menuItemsConverter.CreateToolStripDropDownItems(Runtime.ConnectionsService.ConnectionTreeModel).ToArray(); _btnConnections.DropDownItems.AddRange(rootMenuItems); }