Beispiel #1
0
        /// <summary>
        /// Resolve the given java based type reference to a Cecil based type reference.
        /// </summary>
        private static bool TryResolveObjectType(ObjectTypeReference jRef, TargetFramework target, IBuilderGenericContext gcontext, out NetTypeReference result)
        {
            var objecType = jRef;

            switch (objecType.ClassName)
            {
            case "java/lang/Exception":
            case "java/lang/Throwable":
                result = target.TypeNameMap.GetByType(typeof(Exception));
                return(true);

            case "java/lang/Boolean":
            case "java/lang/Byte":
            case "java/lang/Character":
            case "java/lang/Double":
            case "java/lang/Float":
            case "java/lang/Integer":
            case "java/lang/Long":
            case "java/lang/Short":
                result = new NetNullableType(target.TypeNameMap.GetType(objecType, target, gcontext));
                return(true);

            default:
                return(target.TypeNameMap.TryGetType(objecType, target, gcontext, out result));
            }
        }
Beispiel #2
0
 /// <summary>
 /// Resolve the given java based type reference to a Cecil based type reference.
 /// </summary>
 private static bool TryResolveObjectType(ObjectTypeReference jRef, TargetFramework target, IBuilderGenericContext gcontext, out NetTypeReference result)
 {
     var objecType = jRef;
     switch (objecType.ClassName)
     {
         case "java/lang/Exception":
         case "java/lang/Throwable":
             result = target.TypeNameMap.GetByType(typeof(Exception));
             return true;
         case "java/lang/Boolean":
         case "java/lang/Byte":
         case "java/lang/Character":
         case "java/lang/Double":
         case "java/lang/Float":
         case "java/lang/Integer":
         case "java/lang/Long":
         case "java/lang/Short":
             result = new NetNullableType(target.TypeNameMap.GetType(objecType, target, gcontext));
             return true;
         default:
             return target.TypeNameMap.TryGetType(objecType, target, gcontext, out result);
     }
 }
Beispiel #3
0
 public bool Visit(NetNullableType item, INetMemberVisibility member)
 {
     return(item.ElementType.Accept(this, member));
 }
Beispiel #4
0
 public string Visit(NetNullableType item, bool addDummyGeneric)
 {
     return(item.ElementType.Accept(this, addDummyGeneric) + "?");
 }
Beispiel #5
0
 /// <summary>
 /// Resolve an unboxed type.
 /// </summary>
 public NetTypeReference Visit(NetNullableType item, int data)
 {
     return(new NetNullableType(item.ElementType.Accept(this, data)));
 }