static Type ResolveIReadOnlyCollection(Type declaredType, Type t)
{
#if WINRT
if (CheckIsIReadOnlyCollectionExactly(declaredType.GetTypeInfo()))
{
return(declaredType);
}
foreach (Type intImplBasic in declaredType.GetTypeInfo().ImplementedInterfaces)
{
TypeInfo intImpl = intImplBasic.GetTypeInfo();
if (CheckIsIReadOnlyCollectionExactly(intImpl))
{
return(intImplBasic);
}
}
#else
if (CheckIsIReadOnlyCollectionExactly(declaredType))
{
return(declaredType);
}
foreach (Type intImpl in declaredType.GetInterfaces())
{
if (CheckIsIReadOnlyCollectionExactly(intImpl))
{
return(intImpl);
}
}
#endif
return(null);
}