Beispiel #1
0
 /// <summary>
 /// Is the given type of the given kind?
 /// </summary>
 public static bool Is(this XTypeReference type, XTypeReferenceKind kind1, XTypeReferenceKind kind2)
 {
     if (type == null)
     {
         return(false);
     }
     type = type.GetWithoutModifiers();
     return((type.Kind == kind1) || (type.Kind == kind2));
 }
Beispiel #2
0
 /// <summary>
 /// Default ctor
 /// </summary>
 private BoxInfo(XTypeReferenceKind metadataType, ClassReference boxedClass, PrimitiveType primitiveType,
                 string unboxMethodName, RCode convertAfterCode)
 {
     this.metadataType = metadataType;
     this.boxedClass = boxedClass;
     this.primitiveType = primitiveType;
     this.unboxMethodName = unboxMethodName;
     this.convertAfterCode = convertAfterCode;
 }
Beispiel #3
0
 /// <summary>
 /// Default ctor
 /// </summary>
 private BoxInfo(XTypeReferenceKind metadataType, ClassReference boxedClass, PrimitiveType primitiveType,
                 string unboxMethodName, RCode convertAfterCode)
 {
     this.metadataType     = metadataType;
     this.boxedClass       = boxedClass;
     this.primitiveType    = primitiveType;
     this.unboxMethodName  = unboxMethodName;
     this.convertAfterCode = convertAfterCode;
 }
Beispiel #4
0
        /// <summary>
        /// Change unsigned types to signed types as they are used on Android.
        /// </summary>
        private static XTypeReferenceKind NormalizeSigned(XTypeReferenceKind kind)
        {
            switch (kind)
            {
            case XTypeReferenceKind.Byte:
                return(XTypeReferenceKind.SByte);

            case XTypeReferenceKind.UShort:
                return(XTypeReferenceKind.Short);

            case XTypeReferenceKind.UInt:
                return(XTypeReferenceKind.Int);

            case XTypeReferenceKind.ULong:
                return(XTypeReferenceKind.Long);

            case XTypeReferenceKind.UIntPtr:
                return(XTypeReferenceKind.IntPtr);

            default:
                return(kind);
            }
        }
Beispiel #5
0
 /// <summary>
 /// Default ctor
 /// </summary>
 internal XPrimitiveType(XModule module, XTypeReferenceKind kind, string name)
     : base(module, true, null)
 {
     this.kind = kind;
     this.name = name;
 }
Beispiel #6
0
 /// <summary>
 /// Is the given type of the given kind?
 /// </summary>
 public static bool Is(this XTypeReference type, XTypeReferenceKind kind1, XTypeReferenceKind kind2)
 {
     return((type != null) &&
            ((type.Kind == kind1) || (type.Kind == kind2)));
 }
Beispiel #7
0
 /// <summary>
 /// Default ctor
 /// </summary>
 internal XPrimitiveType(XModule module, XTypeReferenceKind kind, string name)
     : base(module, true, null)
 {
     this.kind = kind;
     this.name = name;
 }
Beispiel #8
0
 /// <summary>
 /// Is the given type of the given kind?
 /// </summary>
 public static bool Is(this XTypeReference type, XTypeReferenceKind kind)
 {
     return((type != null) && (type.GetWithoutModifiers().Kind == kind));
 }
Beispiel #9
0
 /// <summary>
 /// Change unsigned types to signed types as they are used on Android.
 /// </summary>
 private static XTypeReferenceKind NormalizeSigned(XTypeReferenceKind kind)
 {
     switch (kind)
     {
         case XTypeReferenceKind.Byte:
             return XTypeReferenceKind.SByte;
         case XTypeReferenceKind.UShort:
             return XTypeReferenceKind.Short;
         case XTypeReferenceKind.UInt:
             return XTypeReferenceKind.Int;
         case XTypeReferenceKind.ULong:
             return XTypeReferenceKind.Long;
         case XTypeReferenceKind.UIntPtr:
             return XTypeReferenceKind.IntPtr;
         default:
             return kind;
     }
 }
Beispiel #10
0
 /// <summary>
 /// Is the given type of the given kind?
 /// </summary>
 public static bool Is(this XTypeReference type, XTypeReferenceKind kind1, XTypeReferenceKind kind2)
 {
     if (type == null) return false;
     type = type.GetWithoutModifiers();
     return (type.Kind == kind1) || (type.Kind == kind2);
 }
Beispiel #11
0
 /// <summary>
 /// Is the given type of the given kind?
 /// </summary>
 public static bool Is(this XTypeReference type, XTypeReferenceKind kind)
 {
     return (type != null) && (type.GetWithoutModifiers().Kind == kind);
 }
Beispiel #12
0
 /// <summary>
 /// Is the given type of the given kind?
 /// </summary>
 public static bool Is(this XTypeReference type, XTypeReferenceKind kind1, XTypeReferenceKind kind2)
 {
     return (type != null) && 
         ((type.Kind == kind1) || (type.Kind == kind2));
 }
Beispiel #13
0
 /// <summary>
 /// Is the given type of the given kind?
 /// </summary>
 public static bool Is(this XTypeReference type, XTypeReferenceKind kind)
 {
     return (type != null) && (type.Kind == kind);
 }