public AdminModePage GetPage(string lPageName)
        {
            AdminModePage lResult = null;

            if (!iAdminModePages.TryGetValue(lPageName, out lResult))
            {
                lResult = iAdminModePages["Null"];
            }

            return(lResult);
        }
        private void treeView1_AfterSelect(object sender, TreeViewEventArgs e)
        {
            string lPageName = String.Empty;

            if (trvPageNames.SelectedNode != null)
            {
                lPageName = trvPageNames.SelectedNode.Text;
               
            }
            AdminModePage lPage = this.iFactory.GetPage(lPageName);
            this.PageName = lPageName;
            this.SelectedPage = lPage;
            

            // AdminModePage lPage = AdminModePagesFactory.Instance.GetAdminModePage(lPageName);
            // TODO: Pagina Nula


        }
        public AdminModePagesFactory(IControllerFactory pFactory)
        {
            this.iFactory   = pFactory;
            iAdminModePages = new Dictionary <string, AdminModePage>();

            iNameList = new List <String>();

            foreach (Type t in this.GetType().Assembly.GetTypes())
            {
                Attribute[] attrs = Attribute.GetCustomAttributes(t);

                foreach (Attribute attr in attrs)
                {
                    if (attr is AdminModePageInfo)
                    {
                        string lName = ((AdminModePageInfo)attr).Name;
                        iNameList.Add(lName);
                        AdminModePage lPage = (AdminModePage)Activator.CreateInstance(t, new object[] { this.iFactory });
                        //TODO Ajustar esto, no deberia ser publica?
                        //TODO Ajustar y usar lazy Init
                        //TODO revisar tema excepcion de reflection
                        iAdminModePages.Add(lName, lPage.GetAsPage());
                    }
                }
            }

            /* StringBuilder sb = new StringBuilder();
             * foreach (Exception exSub in ex.LoaderExceptions)
             * {
             *   sb.AppendLine(exSub.Message);
             *   FileNotFoundException exFileNotFound = exSub as FileNotFoundException;
             *   if (exFileNotFound != null)
             *   {
             *       if (!string.IsNullOrEmpty(exFileNotFound.FusionLog))
             *       {
             *           sb.AppendLine("Fusion Log:");
             *           sb.AppendLine(exFileNotFound.FusionLog);
             *       }
             *   }
             *   sb.AppendLine();
             * }
             * string errorMessage = sb.ToString();*/
        }