Ejemplo n.º 1
0
		static void InitializeConfig()
		{
			wcfServices = (WcfServiceConfigurationSection)ConfigurationManager.GetSection("wcfServices");
			foreach (WcfServiceConfigElement item in wcfServices.Services)
			{
				Type hostType = Type.GetType(item.HostTypeDeclaration);
				Type contractType = Type.GetType(item.ContractTypeDeclaration);
				var configItem = new ServiceConfig { Item = item, HostType = hostType, ContractType = contractType };
				
				if (hostType != null && !wcfServiceConfigByType.ContainsKey(hostType))
					wcfServiceConfigByType.Add(hostType, configItem);

				if (contractType != null && !wcfServiceConfigByType.ContainsKey(contractType))
					wcfServiceConfigByType.Add(contractType, configItem);

				if (!wcfServiceConfigByKey.ContainsKey(item.Key))
					wcfServiceConfigByKey.Add(item.Key, configItem);
			}
		}
Ejemplo n.º 2
0
	    public ServiceRunner(ServiceConfig[] runServices)
	    {
	        _runServices = runServices;
	    }