public bool IsCollectionType()
{
if ((AssociatedSystemType.GetTypeInfo().IsGenericType &&
(AssociatedSystemType.GetTypeInfo().GetGenericTypeDefinition() == typeof(IList<>) ||
AssociatedSystemType.GetTypeInfo().GetGenericTypeDefinition() == typeof(ICollection<>) ||
AssociatedSystemType.GetTypeInfo().GetGenericTypeDefinition() == typeof(IEnumerable<>) ||
AssociatedSystemType.GetTypeInfo().GetGenericTypeDefinition() == typeof(IReadOnlyList<>) ||
AssociatedSystemType.GetTypeInfo().GetGenericTypeDefinition() == typeof(IReadOnlyCollection<>) ||
AssociatedSystemType.GetTypeInfo().GetGenericTypeDefinition() == typeof(IDictionary<,>) ||
AssociatedSystemType.GetTypeInfo().GetGenericTypeDefinition() == typeof(IReadOnlyDictionary<,>))) ||
AssociatedSystemType == typeof(System.Collections.IList) ||
AssociatedSystemType == typeof(System.Collections.ICollection) ||
AssociatedSystemType == typeof(System.Collections.IEnumerable) ||
AssociatedSystemType == typeof(System.Collections.Specialized.INotifyCollectionChanged) ||
AssociatedSystemType == typeof(System.ComponentModel.INotifyPropertyChanged))
{
return true;
}
return false;
}