static bool IsComplexType(this Type type) { type = type.GetNonNullableType(); if (type.IsEnum) { type = EnumType; } return (!PrimitiveWriterMethods.ContainsKey(type) || DictType.IsAssignableFrom(type) || ListType.IsAssignableFrom(type)); }
public void SendFatherType(Type t) { FatherType = t; if (FatherType.GetGenericArguments().Length == 0) { ListType = typeof(object); } else { ListType = FatherType.GetGenericArguments()[0]; } if (!ListType.IsAssignableFrom(typeof(TItem))) { throw new NotSupportedException(string.Format( ControlsResources.NotCompatibleTypes, typeof(TItem).FullName, ListType.FullName)); } }
static bool IsListType(this Type type) { return(ListType.IsAssignableFrom(type) || type.Name == "IList`1"); }