static void Main() { Application.EnableVisualStyles(); Application.SetCompatibleTextRenderingDefault(false); CONTROLADORA.cINICIO cINICIO = CONTROLADORA.cINICIO.OBTENER_INSTANCIA(); cINICIO.INICIA_USUARIOS(); cINICIO.INICIA_PARAMETROS(); Application.Run(new Inicio.MENU_PRINCIPAL()); }
public MENU_PRINCIPAL() { InitializeComponent(); cAUDITORIA = CONTROLADORA.cAUDITORIA.Obtener_Instancia(); oAUDITORIA = new MODELO.AUDITORIA(); cINICIO = CONTROLADORA.cINICIO.OBTENER_INSTANCIA(); var namespaces = (from type in Assembly.GetExecutingAssembly().GetTypes() where !string.IsNullOrEmpty(type.Namespace) && type.Namespace.IndexOf('.') > 0 let dotIndex = type.Namespace.IndexOf('.') + 1 let topLevel = dotIndex < 0 ? type.Namespace : type.Namespace.Substring(dotIndex, (type.Namespace.Length - dotIndex)) orderby topLevel select topLevel).Distinct(); foreach (var nsp in namespaces) { if (nsp != "Inicio" && nsp != "Properties") { cINICIO.ACTUALIZA_MODULO(nsp); } } foreach (System.Type type in Assembly.GetExecutingAssembly().GetTypes()) { //pregunto si es de tipo Formulario if (type.IsSubclassOf(typeof(Form))) { object[] attrs = type.GetCustomAttributes(typeof(MODELO.formulario), true); foreach (MODELO.formulario a in attrs) { //MessageBox.Show(a.DESCRIPCION + ", " + a.CLASE); cINICIO.ACTUALIZA_FORMULARIOS(a); } object[] acciones = type.GetCustomAttributes(typeof(MODELO.accion), true); foreach (MODELO.accion ac in acciones) { //MessageBox.Show(ac.FORMULARIO + " - " + ac.CONTROL + " - " + ac.DESCRIPCION); cINICIO.ACTUALIZA_ACCIONES(ac); } } } }