/// <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)); }
/// <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; }
/// <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); } }
/// <summary> /// Default ctor /// </summary> internal XPrimitiveType(XModule module, XTypeReferenceKind kind, string name) : base(module, true, null) { this.kind = kind; this.name = name; }
/// <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))); }
/// <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)); }
/// <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; } }
/// <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); }
/// <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); }
/// <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)); }
/// <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); }