Exemplo n.º 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());
        }
Exemplo n.º 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);
        }
Exemplo n.º 3
0
 public static ConfigurationEntry getDatabaseConfig(ConfigurationRoot root, string configKey)
 {
     return(root.getBlock(ConfigurationBlocksEnum.Databases.ToString()).getEntry(configKey));
 }
Exemplo n.º 4
0
 public static ConfigurationEntry getManagerConfig(ConfigurationRoot root, string configKey)
 {
     return(root.getBlock(ConfigurationBlocksEnum.Managers.ToString()).getEntry(configKey));
 }
Exemplo n.º 5
0
 public static ConfigurationEntry getUIMenuConfig(ConfigurationRoot root, int index)
 {
     return(root.getBlock(ConfigurationBlocksEnum.UIMenus.ToString()).getEntry(index));
 }
Exemplo n.º 6
0
 public static ConfigurationEntry getUIMenuRootConfig(ConfigurationRoot root)
 {
     return(root.getBlock(ConfigurationBlocksEnum.UIMenus.ToString()).getEntry(ConfigurationStatics.BLOCK_KEY_UIMENUROOT_SETTINGS));
 }
Exemplo n.º 7
0
 public static ConfigurationEntry getServiceClientConfig(ConfigurationRoot root, int clientIndex)
 {
     return(root.getBlock(ConfigurationBlocksEnum.ServiceClients.ToString()).getEntry(clientIndex));
 }
Exemplo n.º 8
0
 public static ConfigurationEntry getServiceClientConfig(ConfigurationRoot root, string configKey)
 {
     return(root.getBlock(ConfigurationBlocksEnum.ServiceClients.ToString()).getEntry(configKey));
 }
Exemplo n.º 9
0
 public static ConfigurationEntry getServerHostConfig(ConfigurationRoot root, int serverHostIndex)
 {
     return(root.getBlock(ConfigurationBlocksEnum.ServerHosts.ToString()).getEntry(serverHostIndex));
 }