예제 #1
0
        public static UIApplicationMenu[] getMenus(ConfigurationRoot menuConf)
        {
            ArrayList <UIApplicationMenu> menus = new ArrayList <UIApplicationMenu>();
            ConfigurationBlock            block = menuConf.getBlock(ConfigurationBlocksEnum.UIMenus.ToString());

            for (int i = 0; i < block.BlockEntries.Length; i++)
            {
                ConfigurationEntry entry = block.getEntry(i);
                if (entry.Key == ConfigurationStatics.BLOCK_KEY_UIMENUROOT_SETTINGS)
                {
                    continue;
                }

                string s = block.getEntryDetail(entry.Key, MenuConfigurationParamsEnum.Name.ToString()).KeyValue;

                UIApplicationMenu menuObj = new UIApplicationMenu();
                menuObj.Code        = entry.Key;
                menuObj.DisplayName = entry.get(MenuConfigurationParamsEnum.Name.ToString()).KeyValue;
                menuObj.MenuType    = EnumHelper.toEnum <ApplicationMenuTypeEnum>(entry.get(MenuConfigurationParamsEnum.MenuType.ToString(), ApplicationMenuTypeEnum.Title.ToString()).KeyValue);
                menuObj.ObjectUrl   = entry.get(MenuConfigurationParamsEnum.TargetUri.ToString(), "").KeyValue;
                menuObj.ParentCode  = entry.get(MenuConfigurationParamsEnum.ParentKey.ToString(), "").KeyValue;

                menus.put(menuObj);
            }

            return(menus.toArray());
        }
예제 #2
0
        private BaseLogger getLogger()
        {
            ConfigurationRoot  tmp   = this.ConfigurationManager.iParseConfiguratation(this.Config.get(ConfigurationParamsEnum.ConfigurationPath.ToString()).KeyValue);
            ConfigurationBlock block = tmp.getBlock(ConfigurationBlocksEnum.Loggers.ToString());

            for (int i = 0; i < block.BlockEntries.Length; i++)
            {
                ConfigurationEntry entry = block.BlockEntries[i];
                if (!entry.Key.Equals(this.Config.get(LoggerParamsEnum.DefaultLogger.ToString()).KeyValue))
                {
                    continue;
                }

                string     impl   = entry.get(ConfigurationParamsEnum.ImplementationClass.ToString()).KeyValue;
                BaseLogger result = this.ClassFactory.createInstance <BaseLogger>(impl, new object[] { entry.Key, entry });
                result.Initialize();

                return(result);
            }

            return(null);
        }