private void AddCollectionItemTypeToKnownTypes(Type knownType)
{
Type itemType;
Type typeToCheck = knownType;
while (CollectionDataContract.IsCollection(typeToCheck, out itemType))
{
if (itemType.GetTypeInfo().IsGenericType && (itemType.GetGenericTypeDefinition() == Globals.TypeOfKeyValue))
{
itemType = Globals.TypeOfKeyValuePair.MakeGenericType(itemType.GetTypeInfo().GenericTypeArguments);
}
this.knownTypeList.Add(itemType);
typeToCheck = itemType;
}
}