public void RegisterGroup(string name, string submenuName, ListAnchor anchor) { if (_actionGroups.FindByKey(name) == null) { _actionGroups.Add(name, new MenuActionGroup(name, submenuName), anchor); } }
public void RegisterActionGroup(string groupId, ListAnchor anchor) { if (FindActionGroup(groupId) != null) { return; } ToolbarActionGroup newGroup = new ToolbarActionGroup(groupId); _actionGroups.Add(groupId, newGroup, anchor); int newGroupIndex = _actionGroups.IndexOf(newGroup); if (newGroupIndex == 0) { newGroup.StartIndex = 0; } else { newGroup.StartIndex = ((ToolbarActionGroup)_actionGroups [newGroupIndex - 1]).EndIndex; } ToolStripSeparator separator = new ToolStripSeparator(); _toolBar.Items.Insert(newGroup.StartIndex, separator); newGroup.Separator = separator; AdjustGroupIndices(newGroup, 1); }
public void RegisterContactEditBlock(string tabName, ListAnchor anchor, string blockID, ContactBlockCreator blockCreator) { #region Preconditions if (String.IsNullOrEmpty(tabName)) { throw new ArgumentException("Contact view Tab name must be non-null and not-empty string", "tabName"); } #endregion Preconditions AnchoredList list = _BlockCreatorsByTab.ContainsKey(tabName)? _BlockCreatorsByTab[tabName] : new AnchoredList();; list.Add(blockID, blockCreator, anchor); _BlockCreatorsByTab[tabName] = list; }
internal void Add(MenuAction action, ListAnchor anchor) { _actions.Add(action.Action.ToString(), action, anchor); }