public override object PerformConversion(IConfiguration configuration, Type targetType)
		{
			ServerConfig config = new ServerConfig();
	
			foreach(IConfiguration childConfig in configuration.Children)
			{
				if (childConfig.Name == "host")
				{
					config.Host = (String) 
						Context.Composition.PerformConversion(childConfig, typeof(String));
				}
				else if (childConfig.Name == "port")
				{
					config.Port = (int) 
						Context.Composition.PerformConversion(childConfig, typeof(int));
				}
				else if (childConfig.Name == "accept")
				{
					config.Accept = (bool) 
						Context.Composition.PerformConversion(childConfig, typeof(bool));
				}
			}

			return config;
		}
Beispiel #2
0
		public ComplexIMServer(ServerConfig config)
		{
			this.config = config;
		}