Пример #1
0
 internal void OnMapNodeContextMenuOpening(SelectedNodes selectedNodes)
 {
     for (int i = 0; i < Plugins.Count; i++)
     {
         IPluginMapNodeContextMenu plugin = Plugins[i] as IPluginMapNodeContextMenu;
         if (plugin != null)
         {
             plugin.OnContextMenuOpening(selectedNodes);
         }
     }
 }
Пример #2
0
        public void InitializeContextMenu(NodeContextMenu nodeContextMenu)
        {
            foreach (IPlugin p in Plugins)
            {
                IPluginMapNodeContextMenu plugin = p as IPluginMapNodeContextMenu;
                if (plugin != null)
                {
                    var menu = plugin.CreateContextMenuItemsForNode();
                    if (menu != null)
                    {
                        InsertMenuItems(menu, nodeContextMenu);
                    }
                }
            }

            //register event to notify plugins on context menu opening
            nodeContextMenu.Opening +=
                (s, evt) => this.OnMapNodeContextMenuOpening(mainCtrl.CurrentMapCtrl.MapView.SelectedNodes);
        }