internal void CheckIfTypeNeedsVerifcation(DataContract declaredContract, DataContract runtimeContract)
{
bool verifyType = true;
CollectionDataContract collectionContract = declaredContract as CollectionDataContract;
if (collectionContract != null && collectionContract.UnderlyingType.GetTypeInfo().IsInterface)
{
switch (collectionContract.Kind)
{
case CollectionKind.Dictionary:
case CollectionKind.GenericDictionary:
verifyType = declaredContract.Name == runtimeContract.Name;
break;
default:
Type t = collectionContract.ItemType.MakeArrayType();
verifyType = (t != runtimeContract.UnderlyingType);
break;
}
}
if (verifyType)
{
this.PushKnownTypes(declaredContract);
VerifyType(runtimeContract);
this.PopKnownTypes(declaredContract);
}
}