private void navBarControl1_LinkClicked(object sender, DevExpress.XtraNavBar.NavBarLinkEventArgs e) { try { currontSecurityControlBase = ControlsFactory.Show(e.Link, this.panelControl1); //Esto se hace de esta manera ya que el tree listo no se carga correctamente la primera vez que se levanta el control if (currontSecurityControlBase.GetType() == typeof(RulesEditControl)) ((RulesEditControl)currontSecurityControlBase).PopulateAsync(); } catch (Exception ex) { base.MessageViewInfo.Show(Fwk.Exceptions.ExceptionHelper.GetAllMessageException(ex)); } }
internal static SecurityControlBase Show(NavBarItemLink pItem, Control pContainer) { SecurityControlBase wSecurityControl = Get(pItem); AddtoPanel(wSecurityControl, pContainer); try { wSecurityControl.Initialize(); } catch (Exception ex) { pContainer.Controls.Clear(); throw ex; } return(wSecurityControl); }