/// ----------------------------------------------------------------------------- /// <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); }
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; }
/// ----------------------------------------------------------------------------- /// <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); } }
/// ----------------------------------------------------------------------------- /// <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)); }
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); } } }