public PerformConversion ( IConfiguration configuration, |
||
configuration | IConfiguration | |
targetType | ||
return | object |
public override object PerformConversion(IConfiguration configuration, Type targetType)
{
System.Diagnostics.Debug.Assert(targetType.IsArray);
int count = configuration.Children.Count;
Type itemType = targetType.GetElementType();
Array array = Array.CreateInstance(itemType, count);
int index = 0;
foreach(IConfiguration itemConfig in configuration.Children)
{
object value = Context.Composition.PerformConversion(itemConfig, itemType);
array.SetValue(value, index++);
}
return array;
}
}
ArrayConverter::PerformConversion ( String value, |