Esempio n. 1
0
 public void RegisterGroup(string name, string submenuName, ListAnchor anchor)
 {
     if (_actionGroups.FindByKey(name) == null)
     {
         _actionGroups.Add(name, new MenuActionGroup(name, submenuName), anchor);
     }
 }
Esempio n. 2
0
        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);
        }
Esempio n. 3
0
        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;
        }
Esempio n. 4
0
 internal void Add(MenuAction action, ListAnchor anchor)
 {
     _actions.Add(action.Action.ToString(), action, anchor);
 }