Exemple #1
0
 static bool IsComplexType(this Type type)
 {
     type = type.GetNonNullableType();
     if (type.IsEnum)
     {
         type = EnumType;
     }
     return
         (!PrimitiveWriterMethods.ContainsKey(type) ||
          DictType.IsAssignableFrom(type) ||
          ListType.IsAssignableFrom(type));
 }
Exemple #2
0
 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));
     }
 }
Exemple #3
0
 static bool IsListType(this Type type)
 {
     return(ListType.IsAssignableFrom(type) || type.Name == "IList`1");
 }