示例#1
0
 /// -----------------------------------------------------------------------------
 /// <summary>
 /// BindMenu binds the Navigation Provider to the Node Collection
 /// </summary>
 /// <param name="objNodes">The Nodes collection to bind</param>
 /// -----------------------------------------------------------------------------
 private void BindMenu(DNNNodeCollection objNodes)
 {
     Visible = ActionManager.DisplayControl(objNodes);
     if (Visible)
     {
         //since we always bind we need to clear the nodes for providers that maintain their state
         ProviderControl.ClearNodes();
         foreach (DNNNode objNode in objNodes)
         {
             ProcessNodes(objNode);
         }
         ProviderControl.Bind(objNodes);
     }
 }
示例#2
0
        /// -----------------------------------------------------------------------------
        /// <summary>
        /// ProviderControl_PopulateOnDemand handles the Populate On Demand Event
        /// </summary>
        /// -----------------------------------------------------------------------------
        private void ProviderControl_PopulateOnDemand(NavigationEventArgs args)
        {
            SetMenuDefaults();
            ActionRoot.Actions.AddRange(ModuleControl.ModuleContext.Actions); //Modules how add custom actions in control lifecycle will not have those actions populated...

            ModuleAction objAction = ActionRoot;

            if (ActionRoot.ID != Convert.ToInt32(args.ID))
            {
                objAction = ModuleControl.ModuleContext.Actions.GetActionByID(Convert.ToInt32(args.ID));
            }
            if (args.Node == null)
            {
                args.Node = Navigation.GetActionNode(args.ID, ProviderControl.ID, objAction, this);
            }
            ProviderControl.ClearNodes(); //since we always bind we need to clear the nodes for providers that maintain their state
            BindMenu(Navigation.GetActionNodes(objAction, args.Node, this, ExpandDepth));
        }