示例#1
0
 private static string GetMethodName(MethodBase mb)
 {
     object[] attr = mb.GetCustomAttributes(typeof(NameSigAttribute), false);
     if (attr.Length == 1)
     {
         return(((NameSigAttribute)attr[0]).Name);
     }
     else if (mb.Name == ".ctor")
     {
         return("<init>");
     }
     else if (mb.Name == ".cctor")
     {
         return("<clinit>");
     }
     else if (mb.Name.StartsWith(NamePrefix.DefaultMethod, StringComparison.Ordinal))
     {
         return(mb.Name.Substring(NamePrefix.DefaultMethod.Length));
     }
     else if (mb.Name.StartsWith(NamePrefix.Bridge, StringComparison.Ordinal))
     {
         return(mb.Name.Substring(NamePrefix.Bridge.Length));
     }
     else if (mb.IsSpecialName)
     {
         return(UnicodeUtil.UnescapeInvalidSurrogates(mb.Name));
     }
     else
     {
         return(mb.Name);
     }
 }
示例#2
0
        private static object Unescape(object obj)
        {
            string str = obj as string;

            if (str != null)
            {
                obj = UnicodeUtil.UnescapeInvalidSurrogates(str);
            }
            return(obj);
        }
示例#3
0
        private static object EscapeOrUnescape(object obj, bool escape)
        {
            string str = obj as string;

            if (str != null)
            {
                return(escape
                                        ? UnicodeUtil.EscapeInvalidSurrogates(str)
                                        : UnicodeUtil.UnescapeInvalidSurrogates(str));
            }
            object[] arr = obj as object[];
            if (arr != null)
            {
                for (int i = 0; i < arr.Length; i++)
                {
                    arr[i] = EscapeOrUnescape(arr[i], escape);
                }
            }
            return(obj);
        }
示例#4
0
 public PackageListAttribute(string jar, string[] packages)
 {
     this.jar      = jar;
     this.packages = UnicodeUtil.UnescapeInvalidSurrogates(packages);
 }
示例#5
0
 public AnnotationAttributeAttribute(string attributeType)
 {
     this.attributeType = UnicodeUtil.UnescapeInvalidSurrogates(attributeType);
 }
示例#6
0
 public SignatureAttribute(string signature)
 {
     this.signature = UnicodeUtil.UnescapeInvalidSurrogates(signature);
 }
示例#7
0
 public EnclosingMethodAttribute(string className, string methodName, string methodSig)
 {
     this.className  = UnicodeUtil.UnescapeInvalidSurrogates(className);
     this.methodName = UnicodeUtil.UnescapeInvalidSurrogates(methodName);
     this.methodSig  = UnicodeUtil.UnescapeInvalidSurrogates(methodSig);
 }
示例#8
0
 public NonNestedInnerClassAttribute(string innerClassName)
 {
     this.innerClassName = UnicodeUtil.UnescapeInvalidSurrogates(innerClassName);
 }
示例#9
0
 public NonNestedOuterClassAttribute(string outerClassName)
 {
     this.outerClassName = UnicodeUtil.UnescapeInvalidSurrogates(outerClassName);
 }
示例#10
0
 public InnerClassAttribute(string innerClassName, Modifiers modifiers)
 {
     this.innerClassName = UnicodeUtil.UnescapeInvalidSurrogates(innerClassName);
     this.modifiers      = modifiers;
 }
示例#11
0
 // NOTE this is not CLS compliant, so maybe we should have a couple of overloads
 public ImplementsAttribute(string[] interfaces)
 {
     this.interfaces = UnicodeUtil.UnescapeInvalidSurrogates(interfaces);
 }
示例#12
0
 // this constructor is used by ikvmc, the other constructors are for use in other .NET languages
 public ThrowsAttribute(string[] classes)
 {
     this.classes = UnicodeUtil.UnescapeInvalidSurrogates(classes);
 }
示例#13
0
 public NameSigAttribute(string name, string sig)
 {
     this.name = UnicodeUtil.UnescapeInvalidSurrogates(name);
     this.sig  = UnicodeUtil.UnescapeInvalidSurrogates(sig);
 }
示例#14
0
 public JavaModuleAttribute(string[] classMap)
 {
     this.classMap = UnicodeUtil.UnescapeInvalidSurrogates(classMap);
 }