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); } }
private static object Unescape(object obj) { string str = obj as string; if (str != null) { obj = UnicodeUtil.UnescapeInvalidSurrogates(str); } return(obj); }
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); }
public PackageListAttribute(string jar, string[] packages) { this.jar = jar; this.packages = UnicodeUtil.UnescapeInvalidSurrogates(packages); }
public AnnotationAttributeAttribute(string attributeType) { this.attributeType = UnicodeUtil.UnescapeInvalidSurrogates(attributeType); }
public SignatureAttribute(string signature) { this.signature = UnicodeUtil.UnescapeInvalidSurrogates(signature); }
public EnclosingMethodAttribute(string className, string methodName, string methodSig) { this.className = UnicodeUtil.UnescapeInvalidSurrogates(className); this.methodName = UnicodeUtil.UnescapeInvalidSurrogates(methodName); this.methodSig = UnicodeUtil.UnescapeInvalidSurrogates(methodSig); }
public NonNestedInnerClassAttribute(string innerClassName) { this.innerClassName = UnicodeUtil.UnescapeInvalidSurrogates(innerClassName); }
public NonNestedOuterClassAttribute(string outerClassName) { this.outerClassName = UnicodeUtil.UnescapeInvalidSurrogates(outerClassName); }
public InnerClassAttribute(string innerClassName, Modifiers modifiers) { this.innerClassName = UnicodeUtil.UnescapeInvalidSurrogates(innerClassName); this.modifiers = modifiers; }
// NOTE this is not CLS compliant, so maybe we should have a couple of overloads public ImplementsAttribute(string[] interfaces) { this.interfaces = UnicodeUtil.UnescapeInvalidSurrogates(interfaces); }
// 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); }
public NameSigAttribute(string name, string sig) { this.name = UnicodeUtil.UnescapeInvalidSurrogates(name); this.sig = UnicodeUtil.UnescapeInvalidSurrogates(sig); }
public JavaModuleAttribute(string[] classMap) { this.classMap = UnicodeUtil.UnescapeInvalidSurrogates(classMap); }