Пример #1
0
        /// <summary>
        /// Gets the name of the given method
        /// </summary>
        public override void ModifyMethodName(ImportJarLib.Model.NetMethodDefinition method, MethodRenamer renamer)
        {
            base.ModifyMethodName(method, renamer);
            switch (method.Name)
            {
            case "Format":
                renamer.RenameMethodOnly(method, "JavaFormat");
                method.EditorBrowsableState = EditorBrowsableState.Advanced;
                break;

            case "Substring":
                renamer.Rename(method, "JavaSubstring");
                method.EditorBrowsableState = EditorBrowsableState.Advanced;
                break;

            case "ToLowerCase":
                renamer.Rename(method, "ToLower");
                break;

            case "Length":
                method.SetExplicitImplementation(method.Overrides.First(), method.Overrides.First().DeclaringType);
                break;

            case "CharAt":
                method.SetExplicitImplementation(method.Overrides.First(), method.Overrides.First().DeclaringType);
                break;

            case "ToUpperCase":
                renamer.Rename(method, "ToUpper");
                break;
            }
        }
Пример #2
0
 /// <summary>
 /// Gets the name of the given method
 /// </summary>
 public override void ModifyMethodName(ImportJarLib.Model.NetMethodDefinition method, MethodRenamer renamer)
 {
     base.ModifyMethodName(method, renamer);
     if (method.Name == "ParseInt")
     {
         renamer.Rename(method, "JavaParse");
     }
 }
 /// <summary>
 /// Modify the name of the given method to another name.
 /// By calling renamer.Rename, all methods in the same group are also updated.
 /// </summary>
 public override void ModifyMethodName(ImportJarLib.Model.NetMethodDefinition method, MethodRenamer renamer)
 {
     base.ModifyMethodName(method, renamer);
     if (method.OriginalJavaName == "get")
     {
         renamer.Rename(method, "GetValue");
     }
 }
Пример #4
0
 /// <summary>
 /// Should the given interface implementation method be left out?
 /// </summary>
 protected override bool IgnoreInterfaceMethod(ImportJarLib.Model.NetMethodDefinition method, ImportJarLib.Model.NetMethodDefinition interfaceMethod)
 {
     if (method.Name == "GetTypeParameters")
     {
         return(true);
     }
     return(base.IgnoreInterfaceMethod(method, interfaceMethod));
 }
Пример #5
0
 /// <summary>
 /// Gets the name of the given method
 /// </summary>
 public override void ModifyMethodName(ImportJarLib.Model.NetMethodDefinition method, MethodRenamer renamer)
 {
     base.ModifyMethodName(method, renamer);
     if (method.Name == "Ceil")
     {
         renamer.Rename(method, "Ceiling");
     }
 }
Пример #6
0
 /// <summary>
 /// Gets the name of the given method
 /// </summary>
 public override void ModifyMethodName(ImportJarLib.Model.NetMethodDefinition method, MethodRenamer renamer)
 {
     base.ModifyMethodName(method, renamer);
     if ((method.Name == "Next") && (method.Parameters.Count == 1))
     {
         renamer.Rename(method, "JavaNext");
         method.EditorBrowsableState = EditorBrowsableState.Never;
     }
 }
        /// <summary>
        /// Gets the name of the given method
        /// </summary>
        public override void ModifyMethodName(ImportJarLib.Model.NetMethodDefinition method, MethodRenamer renamer)
        {
            base.ModifyMethodName(method, renamer);
            switch (method.Name)
            {
            case "Append":
                if (method.JavaDescriptor == "(Ljava/lang/CharSequence;II)Ljava/lang/StringBuilder;")
                {
                    renamer.Rename(method, "JavaAppend");
                    method.EditorBrowsableState = EditorBrowsableState.Advanced;
                }
                break;

            case "Delete":
                if (method.JavaDescriptor == "(II)Ljava/lang/StringBuilder;")
                {
                    renamer.Rename(method, "JavaDelete");
                    method.EditorBrowsableState = EditorBrowsableState.Advanced;
                }
                break;

            case "Insert":
                if (method.JavaDescriptor == "(ILjava/lang/CharSequence;II)Ljava/lang/StringBuilder;")
                {
                    renamer.Rename(method, "JavaInsert");
                    method.EditorBrowsableState = EditorBrowsableState.Advanced;
                }
                break;

            case "Substring":
                if (method.JavaDescriptor == "(II)Ljava/lang/String;")
                {
                    renamer.Rename(method, "JavaSubstring");
                    method.EditorBrowsableState = EditorBrowsableState.Advanced;
                }
                break;

            case "Length":
                method.SetExplicitImplementation(method.Overrides.First(), method.Overrides.First().DeclaringType);
                break;

            case "CharAt":
                method.SetExplicitImplementation(method.Overrides.First(), method.Overrides.First().DeclaringType);
                break;

            case "SetLength":
                renamer.RenameMethodOnly(method, "JavaSetLength");
                method.EditorBrowsableState = EditorBrowsableState.Advanced;
                break;
            }
        }
Пример #8
0
        /// <summary>
        /// Gets the name of the given method
        /// </summary>
        public override void ModifyMethodName(ImportJarLib.Model.NetMethodDefinition method, MethodRenamer renamer)
        {
            base.ModifyMethodName(method, renamer);
            switch (method.Name)
            {
            case "GetConstructor":
                renamer.Rename(method, "JavaGetConstructor");
                method.EditorBrowsableState = EditorBrowsableState.Never;
                break;

            case "GetConstructors":
                renamer.Rename(method, "JavaGetConstructors");
                method.EditorBrowsableState = EditorBrowsableState.Never;
                break;

            case "GetField":
                renamer.Rename(method, "JavaGetField");
                method.EditorBrowsableState = EditorBrowsableState.Never;
                break;

            case "GetFields":
                renamer.Rename(method, "JavaGetFields");
                method.EditorBrowsableState = EditorBrowsableState.Never;
                break;

            case "GetInterfaces":
                renamer.Rename(method, "JavaGetInterfaces");
                method.EditorBrowsableState = EditorBrowsableState.Never;
                break;

            case "GetMethod":
                renamer.Rename(method, "JavaGetMethod");
                method.EditorBrowsableState = EditorBrowsableState.Never;
                break;

            case "GetMethods":
                renamer.Rename(method, "JavaGetMethods");
                method.EditorBrowsableState = EditorBrowsableState.Never;
                break;

            case "GetName":
                renamer.Rename(method, "JavaGetName");
                method.EditorBrowsableState = EditorBrowsableState.Never;
                break;

            case "GetComponentType":
                renamer.Rename(method, "GetElementType");
                break;
            }
        }
Пример #9
0
        /// <summary>
        /// Gets the name of the given method
        /// </summary>
        public override void ModifyMethodName(ImportJarLib.Model.NetMethodDefinition method, MethodRenamer renamer)
        {
            base.ModifyMethodName(method, renamer);

            if (method.Name == "IsLowerCase")
            {
                renamer.Rename(method, "IsLower");
            }

            if (method.Name == "IsUpperCase")
            {
                renamer.Rename(method, "IsUpper");
            }
        }
Пример #10
0
        public override void ModifyMethodName(ImportJarLib.Model.NetMethodDefinition method, MethodRenamer renamer)
        {
            base.ModifyMethodName(method, renamer);
            switch (method.Name)
            {
            case "Wait":
                renamer.Rename(method, "JavaWait");
                break;

            case "GetClass":
                renamer.Rename(method, "GetType");
                break;
            }
        }
Пример #11
0
        /// <summary>
        /// Gets the name of the given method
        /// </summary>
        public override void ModifyMethodName(ImportJarLib.Model.NetMethodDefinition method, MethodRenamer renamer)
        {
            base.ModifyMethodName(method, renamer);
            switch (method.Name)
            {
            case "ParseDouble":
                renamer.Rename(method, "Parse");
                break;

            case "IsInfinite":
                if (method.IsStatic)
                {
                    renamer.Rename(method, "IsInfinity");
                }
                break;
            }
        }
        /// <summary>
        /// Gets the name of the given method
        /// </summary>
        public override void ModifyMethodName(ImportJarLib.Model.NetMethodDefinition method, MethodRenamer renamer)
        {
            base.ModifyMethodName(method, renamer);
            switch (method.Name)
            {
            case "Append":
                if (method.JavaDescriptor == "(Ljava/lang/CharSequence;II)Ljava/lang/StringBuilder;")
                {
                    renamer.Rename(method, "JavaAppend");
                    method.EditorBrowsableState = EditorBrowsableState.Advanced;
                }
                break;

            case "Delete":
                if (method.JavaDescriptor == "(II)Ljava/lang/StringBuilder;")
                {
                    renamer.Rename(method, "JavaDelete");
                    method.EditorBrowsableState = EditorBrowsableState.Advanced;
                }
                break;

            case "Insert":
                if (method.JavaDescriptor == "(ILjava/lang/CharSequence;II)Ljava/lang/StringBuilder;")
                {
                    renamer.Rename(method, "JavaInsert");
                    method.EditorBrowsableState = EditorBrowsableState.Advanced;
                }
                break;

            case "Substring":
                if (method.JavaDescriptor == "(II)Ljava/lang/String;")
                {
                    renamer.Rename(method, "JavaSubstring");
                    method.EditorBrowsableState = EditorBrowsableState.Advanced;
                }
                break;
            }
        }
Пример #13
0
        /// <summary>
        /// Gets the name of the given method
        /// </summary>
        public override void ModifyMethodName(ImportJarLib.Model.NetMethodDefinition method, MethodRenamer renamer)
        {
            base.ModifyMethodName(method, renamer);
            switch (method.Name)
            {
            case "Format":
                renamer.RenameMethodOnly(method, "JavaFormat");
                method.EditorBrowsableState = EditorBrowsableState.Advanced;
                break;

            case "Substring":
                renamer.Rename(method, "JavaSubstring");
                method.EditorBrowsableState = EditorBrowsableState.Advanced;
                break;

            case "ToLowerCase":
                renamer.Rename(method, "ToLower");
                break;

            case "ToUpperCase":
                renamer.Rename(method, "ToUpper");
                break;
            }
        }
Пример #14
0
 /// <summary>
 /// Gets the name of the given method
 /// </summary>
 public override void ModifyMethodName(ImportJarLib.Model.NetMethodDefinition method, MethodRenamer renamer)
 {
     base.ModifyMethodName(method, renamer);
     if (method.Name == "Ceil")
     {
         renamer.Rename(method, "Ceiling");
     }
     else if (method.Name == "IEEEremainder")
     {
         renamer.Rename(method, "IEEERemainder");
     }
     else if (method.Name == "Abs")
     {
         renamer.Rename(method, "JavaAbs");
     }
     else if (method.Name == "Round")
     {
         renamer.Rename(method, "JavaRound");
     }
     else if (method.Name == "Pow")
     {
         renamer.Rename(method, "JavaPow");
     }
 }
Пример #15
0
        /// <summary>
        /// Gets the name of the given method
        /// </summary>
        public override void ModifyMethodName(ImportJarLib.Model.NetMethodDefinition method, MethodRenamer renamer)
        {
            base.ModifyMethodName(method, renamer);
            switch (method.Name)
            {
            case "GetConstructor":
                renamer.Rename(method, "JavaGetConstructor");
                method.EditorBrowsableState = EditorBrowsableState.Never;
                break;

            case "GetConstructors":
                renamer.Rename(method, "JavaGetConstructors");
                method.EditorBrowsableState = EditorBrowsableState.Never;
                break;

            case "GetField":
                renamer.Rename(method, "JavaGetField");
                method.EditorBrowsableState = EditorBrowsableState.Never;
                break;

            case "GetFields":
                renamer.Rename(method, "JavaGetFields");
                method.EditorBrowsableState = EditorBrowsableState.Never;
                break;

            case "GetInterfaces":
                renamer.Rename(method, "JavaGetInterfaces");
                method.EditorBrowsableState = EditorBrowsableState.Never;
                break;

            case "GetMethod":
                renamer.Rename(method, "JavaGetMethod");
                method.EditorBrowsableState = EditorBrowsableState.Never;
                break;

            case "GetMethods":
                renamer.Rename(method, "JavaGetMethods");
                method.EditorBrowsableState = EditorBrowsableState.Never;
                break;

            case "GetDeclaredConstructor":
                renamer.Rename(method, "JavaGetDeclaredConstructor");
                method.EditorBrowsableState = EditorBrowsableState.Never;
                break;

            case "GetDeclaredConstructors":
                renamer.Rename(method, "JavaGetDeclaredConstructors");
                method.EditorBrowsableState = EditorBrowsableState.Never;
                break;

            case "GetDeclaredField":
                renamer.Rename(method, "JavaGetDeclaredField");
                method.EditorBrowsableState = EditorBrowsableState.Never;
                break;

            case "GetDeclaredFields":
                renamer.Rename(method, "JavaGetDeclaredFields");
                method.EditorBrowsableState = EditorBrowsableState.Never;
                break;

            case "GetDeclaredInterfaces":
                renamer.Rename(method, "JavaGetDeclaredInterfaces");
                method.EditorBrowsableState = EditorBrowsableState.Never;
                break;

            case "GetDeclaredMethod":
                renamer.Rename(method, "JavaGetDeclaredMethod");
                method.EditorBrowsableState = EditorBrowsableState.Never;
                break;

            case "GetDeclaredMethods":
                renamer.Rename(method, "JavaGetDeclaredMethods");
                method.EditorBrowsableState = EditorBrowsableState.Never;
                break;

            case "GetName":
                renamer.Rename(method, "JavaGetName");
                method.EditorBrowsableState = EditorBrowsableState.Never;
                break;

            case "IsEnum":
                renamer.Rename(method, "JavaGetIsEnum");
                method.EditorBrowsableState = EditorBrowsableState.Never;
                break;

            case "GetComponentType":
                renamer.Rename(method, "JavaGetComponentType");
                method.EditorBrowsableState = EditorBrowsableState.Never;
                break;

            case "IsAssignableFrom":
                renamer.Rename(method, "JavaIsAssignableFrom");
                method.EditorBrowsableState = EditorBrowsableState.Never;
                break;

            case "IsInterface":
                renamer.Rename(method, "JavaIsInterface");
                method.EditorBrowsableState = EditorBrowsableState.Never;
                break;

            case "IsInstance":
                renamer.Rename(method, "JavaIsInstance");
                method.EditorBrowsableState = EditorBrowsableState.Never;
                break;
            }
        }