static bool IsCollection (Type type)
{
if (type.GetInterface ("System.Collections.IList", false) != null)
return true;
if (type.GetInterface ("System.Collections.Generic.IList`1", false) != null)
return true;
if (type.GetInterface ("System.Collections.Generic.ICollection`1", false) != null)
return true;
return false;
}