Exemplo n.º 1
0
 /// -----------------------------------------------------------------------------
 /// <summary>
 /// OnInit runs during the controls initialisation phase
 /// </summary>
 /// -----------------------------------------------------------------------------
 protected override void OnInit(EventArgs e)
 {
     _ProviderControl = NavigationProvider.Instance(ProviderName);
     ProviderControl.PopulateOnDemand += ProviderControl_PopulateOnDemand;
     base.OnInit(e);
     ProviderControl.ControlID = "ctl" + ID;
     ProviderControl.Initialize();
     Controls.Add(ProviderControl.NavigationControl);
 }
Exemplo n.º 2
0
 public Main(ProviderControl providerControl, InvoiceControl invoiceControl, RequestControl requestControl, UsersControl usersControl, ReportControl reportsControl, ProductControl productControl, PersonalDataControl personalDataControl)
 {
     _logger = LogManager.GetCurrentClassLogger();
     _logger.Debug("Iniciando Menu Principal");
     InitializeComponent();
     _providerControl     = providerControl;
     _invoiceControl      = invoiceControl;
     _requestControl      = requestControl;
     _productControl      = productControl;
     _usersControl        = usersControl;
     _reportsControl      = reportsControl;
     _personalDataControl = personalDataControl;
 }
Exemplo n.º 3
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);
     }
 }
Exemplo n.º 4
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));
        }
Exemplo n.º 5
0
        protected void Page_Load(object sender, EventArgs e)
        {
            pageId     = Utility.GetIntParameter("pageId");
            regionId   = Utility.GetIntParameter("regionId");
            providerId = Utility.GetIntParameter("providerId");

            Content.Page _selectedPage = new Content.Page(pageId);
            Provider     provider      = new Provider(providerId);

            if (provider.EditControl != null)
            {
                if (provider.EditControl.Length > 0)
                {
                    ProviderControl editControl = Page.LoadControl(provider.EditControl) as ProviderControl;
                    editControl.PageId     = pageId;
                    editControl.RegionId   = regionId;
                    editControl.ProviderId = providerId;
                    providerContent.Controls.Add(editControl);
                }
            }
        }