예제 #1
0
 internal static CollectionType GetCollectionType(FieldInfo thatField)
 {
     if (CollectionType.CanBeCreatedFrom(thatField.FieldType))
     {
         var created = new CollectionType(thatField.FieldType, javaName: thatField.Name, objCName: thatField.Name);
         compositeTypeCollection.TryAdd(created);
         return(created);
     }
     else
     {
         throw new ArgumentException(String.Format("Field type is not a legitimate collection we can create. Type: {0}", thatField.FieldType));
     }
 }
예제 #2
0
 public new bool Equals(object x, object y)
 {
     if (x.GetType().Equals(y.GetType()))
     {
         if (TypeRegistry.ScalarTypes.Contains(x.GetType()))
         {
             return(TypeRegistry.ScalarTypes[x.GetType()].SimplEquals(x, y));
         }
         else if (CollectionType.CanBeCreatedFrom(x.GetType()))
         {
             var collectionType = TypeRegistry.CollectionTypes.GetOrAdd(x.GetType());
             return(collectionType.SimplEquals(x, y));
         }
         else
         {
             var compositeType = TypeRegistry.CompositeTypes.GetOrAdd(x.GetType());
             return(compositeType.SimplEquals(x, y));
         }
     }
     else
     {
         return(false);
     }
 }
예제 #3
0
 /// <summary>
 /// Determines if a simpl Collection Type can be created for the given C# TYpe
 /// </summary>
 /// <param name="aType">The type to consider</param>
 /// <returns>True if a collection type can be made</returns>
 public static bool CanBeCreatedFrom(Type aType)
 {
     return(!CollectionType.CanBeCreatedFrom(aType));
 }