public override void AddIntoMenu(ConnectionPointContainer container, PluginConfigItem theItem, PluginMenuPath thePath, ExecutePluginCallback callback)
 {
     if (container.Navigations != null && container.Navigations.Count > 0)
     {
         TreeView theTree = SelectNavigation(container, thePath);
         if (theTree != null)
         {
             AddTreeNodeIntoTree(container, theTree.Nodes, theItem, thePath, thePath.MenuPathParts, callback);
         }
     }
 }
 public override void AddIntoMenu(ConnectionPointContainer container, PluginConfigItem theItem, PluginMenuPath thePath, ExecutePluginCallback callback)
 {
     if (container.ToolStrips != null && container.ToolStrips.Count > 0)
     {
         ToolBar theToolbar = SelectToolStrip(container, thePath);
         if (theToolbar != null)
         {
             AddMenuItemIntoMenu(container, theToolbar.Items, theItem, thePath, thePath.MenuPathParts, callback);
         }
     }
 }
 public void AddConnectionPointItem(PluginConfigItem theItem, ExecutePluginCallback callback)
 {
     if (_proxy != null)
     {
         _proxy.AddConnectionPointItem(theItem, callback);
         return;
     }
     foreach (PluginMenuPath thePath in theItem.MenuPaths)
     {
         PluginMenuBuilder.MakeBuilder(thePath.LocateType).AddIntoMenu(
             this,
             theItem,
             thePath,
             callback
         );
     }
 }
 public void AddConnectionPointItem(PluginConfigItem theItem, ExecutePluginCallback callback)
 {
     if (_proxy != null)
     {
         _proxy.AddConnectionPointItem(theItem, callback);
         return;
     }
     foreach (PluginMenuPath thePath in theItem.MenuPaths)
     {
         PluginMenuBuilder.MakeBuilder(thePath.LocateType).AddIntoMenu(
             this,
             theItem,
             thePath,
             callback
             );
     }
 }
Example #5
0
 public override void AddIntoMenu(ConnectionPointContainer container,
                                  PluginConfigItem theItem,
                                  PluginMenuPath thePath, ExecutePluginCallback callback)
 {
     if (null != container.Menus && container.Menus.Count > 0)
     {
         Menu menu = SelectMenu(container, thePath);
         if (null != menu)
         {
             AddMenuItemIntoMenu(container,
                                 menu.Items,
                                 theItem,
                                 thePath,
                                 thePath.MenuPathParts, callback);
         }
     }
 }
 public override void AddIntoMenu(ConnectionPointContainer container, 
                                     PluginConfigItem theItem, 
                                     PluginMenuPath thePath, ExecutePluginCallback callback)
 {
     if (null != container.Menus && container.Menus.Count > 0)
     {
         Menu menu = SelectMenu(container, thePath);
         if (null != menu)
         {
             AddMenuItemIntoMenu(container,
                                 menu.Items,
                                 theItem,
                                 thePath,
                                 thePath.MenuPathParts, callback);
         }
     }
 }
        protected void AddTreeNodeIntoTree(ConnectionPointContainer container, TreeNodeCollection nodes, PluginConfigItem theItem, PluginMenuPath thePath, IList<PluginMenuItemPart> thePaths, ExecutePluginCallback callback)
        {
            if (thePaths.Count < 1) return;

            PluginMenuItemPart firstPart = thePaths[0];
            PluginMenuPartStruct menuStruct = GetMenuItemIndex(firstPart, nodes);
            IList<PluginMenuItemPart> otherParts = GetLeavesMenuItemParts(thePaths);

            if (!menuStruct.IsCreate)
            {
                AddTreeNodeIntoTree(container, nodes[menuStruct.Index].Nodes,
                       theItem, thePath, otherParts, callback);
            }
            else
            {
                TreeNode theMenuItem = new TreeNode(firstPart.TextStyle.Text);
                CreateMenuEndItem(firstPart, theMenuItem, GetImageList(container, thePath.MenuImageIndex));

                nodes.Insert(
                    menuStruct.Index,
                    theMenuItem
                );

                if (thePaths.Count > 1)
                {
                    AddTreeNodeIntoTree(container, theMenuItem.Nodes, theItem, thePath, otherParts, callback);
                }
                else
                {
                    theMenuItem.Name = theItem.Url;
                    theMenuItem.Tag = new object[] { theItem, callback };

                    theMenuItem.TreeView.NodeMouseClick -= new TreeNodeMouseClickEventHandler(TreeView_NodeMouseClick);
                    theMenuItem.TreeView.NodeMouseClick += new TreeNodeMouseClickEventHandler(TreeView_NodeMouseClick);

                    return;
                }
            }
        }
Example #8
0
 public virtual void AddIntoMenu(ConnectionPointContainer container, PluginConfigItem theItem, PluginMenuPath thePath, ExecutePluginCallback callback)
 {
 }
Example #9
0
 public virtual void AddIntoMenu(ConnectionPointContainer container, PluginConfigItem theItem, PluginMenuPath thePath, ExecutePluginCallback callback)
 {
 }
        protected void AddTreeNodeIntoTree(ConnectionPointContainer container, TreeNodeCollection nodes, PluginConfigItem theItem, PluginMenuPath thePath, IList <PluginMenuItemPart> thePaths, ExecutePluginCallback callback)
        {
            if (thePaths.Count < 1)
            {
                return;
            }

            PluginMenuItemPart         firstPart  = thePaths[0];
            PluginMenuPartStruct       menuStruct = GetMenuItemIndex(firstPart, nodes);
            IList <PluginMenuItemPart> otherParts = GetLeavesMenuItemParts(thePaths);

            if (!menuStruct.IsCreate)
            {
                AddTreeNodeIntoTree(container, nodes[menuStruct.Index].Nodes,
                                    theItem, thePath, otherParts, callback);
            }
            else
            {
                TreeNode theMenuItem = new TreeNode(firstPart.TextStyle.Text);
                CreateMenuEndItem(firstPart, theMenuItem, GetImageList(container, thePath.MenuImageIndex));

                nodes.Insert(
                    menuStruct.Index,
                    theMenuItem
                    );

                if (thePaths.Count > 1)
                {
                    AddTreeNodeIntoTree(container, theMenuItem.Nodes, theItem, thePath, otherParts, callback);
                }
                else
                {
                    theMenuItem.Name = theItem.Url;
                    theMenuItem.Tag  = new object[] { theItem, callback };

                    theMenuItem.TreeView.NodeMouseClick -= new TreeNodeMouseClickEventHandler(TreeView_NodeMouseClick);
                    theMenuItem.TreeView.NodeMouseClick += new TreeNodeMouseClickEventHandler(TreeView_NodeMouseClick);

                    return;
                }
            }
        }
 public override void AddIntoMenu(ConnectionPointContainer container, PluginConfigItem theItem, PluginMenuPath thePath, ExecutePluginCallback callback)
 {
     if (container.Navigations != null && container.Navigations.Count > 0)
     {
         TreeView theTree = SelectNavigation(container, thePath);
         if (theTree != null)
         {
             AddTreeNodeIntoTree(container, theTree.Nodes, theItem, thePath, thePath.MenuPathParts, callback);
         }
     }
 }
 public override void AddIntoMenu(ConnectionPointContainer container, PluginConfigItem theItem, PluginMenuPath thePath, ExecutePluginCallback callback)
 {
     if (container.ToolStrips != null && container.ToolStrips.Count > 0)
     {
         ToolStrip theToolbar = SelectToolStrip(container, thePath);
         if (theToolbar != null)
         {
             AddMenuItemIntoMenu(container, theToolbar.Items, theItem, thePath, thePath.MenuPathParts, callback);
         }
     }
 }
Example #13
0
        protected void AddMenuItemIntoMenu(ConnectionPointContainer container,
                                           ItemCollection menuItemCollection,
                                           PluginConfigItem theItem,
                                           PluginMenuPath thePath,
                                           IList <PluginMenuItemPart> thePaths, ExecutePluginCallback callback)
        {
            if (thePaths.Count < 1)
            {
                return;
            }

            PluginMenuItemPart         firstPart  = thePaths[0];
            PluginMenuPartStruct       menuStruct = GetMenuItemIndex(firstPart, menuItemCollection);
            IList <PluginMenuItemPart> otherParts = GetLeavesMenuItemParts(thePaths);

            if (!menuStruct.IsCreate)
            {
                AddMenuItemIntoMenu(container,
                                    (menuItemCollection[menuStruct.Index] as MenuItem).Items,
                                    theItem,
                                    thePath,
                                    otherParts, callback);
            }
            else
            {
                if (firstPart.TextStyle.Text.Trim() == "-")
                {
                    menuItemCollection.Insert(menuStruct.Index, new Separator());
                    return;
                }

                MenuItem theMenuItem = new MenuItem()
                {
                    Header = firstPart.TextStyle.Text
                };

                CreateMenuEndItem(firstPart, theMenuItem, GetImageList(container, thePath.MenuImageIndex));
                menuItemCollection.Insert(menuStruct.Index, theMenuItem);

                if (thePaths.Count > 1)
                {
                    AddMenuItemIntoMenu(container, theMenuItem.Items, theItem, thePath, otherParts, callback);
                }
                else
                {
                    theMenuItem.Name = theItem.Url;
                    theMenuItem.Tag  = new object[] { theItem, callback };
                    string[] behaviors = theItem.Behavior.Split(new char[] { ';' }, StringSplitOptions.RemoveEmptyEntries);
                    foreach (string action in behaviors)
                    {
                        PluginConfigItemBehaviorMode theBehavior = (PluginConfigItemBehaviorMode)Enum.Parse(typeof(PluginConfigItemBehaviorMode), action, true);
                        switch (theBehavior)
                        {
                        case PluginConfigItemBehaviorMode.Click:
                            theMenuItem.Click -= TheMenuItem_Click;
                            theMenuItem.Click += TheMenuItem_Click;
                            break;

                        case PluginConfigItemBehaviorMode.MouseOver:
                            theMenuItem.MouseMove -= TheMenuItem_MouseMove;
                            theMenuItem.MouseMove += TheMenuItem_MouseMove;
                            break;
                        }
                    }
                    return;
                }
            }
        }
        protected void AddMenuItemIntoMenu(ConnectionPointContainer container, ToolStripItemCollection toolStripItemCollection, PluginConfigItem theItem, PluginMenuPath thePath, IList<PluginMenuItemPart> thePaths, ExecutePluginCallback callback)
        {
            if (thePaths.Count < 1) return;

            PluginMenuItemPart firstPart = thePaths[0];
            PluginMenuPartStruct menuStruct = GetMenuItemIndex(firstPart, toolStripItemCollection);
            IList<PluginMenuItemPart> otherParts = GetLeavesMenuItemParts(thePaths);

            if (!menuStruct.IsCreate)
            {
                AddMenuItemIntoMenu(container, (toolStripItemCollection[menuStruct.Index] as
                    ToolStripMenuItem).DropDownItems,
                    theItem, thePath, otherParts, callback);

            }
            else
            {
                if (firstPart.TextStyle.Text.Trim() == "-")
                {
                    toolStripItemCollection.Insert(
                        menuStruct.Index,
                        new ToolStripSeparator()
                    );
                    return;
                }
                ToolStripMenuItem theMenuItem = new ToolStripMenuItem(firstPart.TextStyle.Text);

                CreateMenuEndItem(firstPart, theMenuItem, GetImageList(container, thePath.MenuImageIndex));
                toolStripItemCollection.Insert(
                    menuStruct.Index,
                    theMenuItem
                );

                if (thePaths.Count > 1)
                {
                    AddMenuItemIntoMenu(container, theMenuItem.DropDownItems, theItem, thePath, otherParts, callback);
                }
                else
                {
                    theMenuItem.Name = theItem.Url;
                    theMenuItem.Tag = new object[] { theItem, callback };
                    string[] behaviors = theItem.Behavior.Split(new char[] { ';' }, StringSplitOptions.RemoveEmptyEntries);
                    foreach (string action in behaviors)
                    {
                        PluginConfigItemBehaviorMode theBehavior = (PluginConfigItemBehaviorMode)Enum.Parse(typeof(PluginConfigItemBehaviorMode), action, true);
                        switch (theBehavior)
                        {
                            case PluginConfigItemBehaviorMode.Click:
                                theMenuItem.Click -= TheMenuItem_Click;
                                theMenuItem.Click += TheMenuItem_Click;
                                break;
                            case PluginConfigItemBehaviorMode.MouseOver:
                                theMenuItem.MouseMove -= new MouseEventHandler(TheMenuItem_MouseMove);
                                theMenuItem.MouseMove += new MouseEventHandler(TheMenuItem_MouseMove);
                                break;
                        }
                    }
                    return;
                }
            }
        }