本文整理汇总了C#中Mono.Cecil.MethodDefinition.GetDexImportBaseInterfaceMethod方法的典型用法代码示例。如果您正苦于以下问题:C# MethodDefinition.GetDexImportBaseInterfaceMethod方法的具体用法?C# MethodDefinition.GetDexImportBaseInterfaceMethod怎么用?C# MethodDefinition.GetDexImportBaseInterfaceMethod使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Mono.Cecil.MethodDefinition
的用法示例。
在下文中一共展示了MethodDefinition.GetDexImportBaseInterfaceMethod方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: Include
/// <summary>
/// Should the given method be included in the APK?
/// </summary>
public bool Include(MethodDefinition method, ReachableContext context)
{
if (!method.IsVirtual)
return false;
if (method.GetDexImportBaseMethod() != null)
return true;
if (method.GetDexImportBaseInterfaceMethod() != null)
return true;
return false;
}
示例2: GetMethodName
/// <summary>
/// Perform name conversion
/// </summary>
protected virtual string GetMethodName(MethodDefinition method, DexTargetPackage targetPackage)
{
// Handle special names
switch (method.Name)
{
case ".ctor":
return "<init>";
case ".cctor":
return "<clinit>";
}
// Handle regular names
// Test for overrides of dex/java imported methods
var javaBaseMethod = method.GetDexImportBaseMethod() ?? method.GetJavaImportBaseMethod();
if (javaBaseMethod != null)
{
var javaMethodRef = javaBaseMethod.GetReference(targetPackage, compiler.Module);
return javaMethodRef.Name;
}
// Test for overrides of interface methods
var interfaceJavaBaseMethod = method.GetDexImportBaseInterfaceMethod() ?? method.GetJavaImportBaseInterfaceMethod();
if (interfaceJavaBaseMethod != null)
{
var javaMethodRef = interfaceJavaBaseMethod.GetReference(targetPackage, compiler.Module);
return javaMethodRef.Name;
}
// If a dex name is specified, use that
var dexName = method.GetDexNameAttribute();
if (dexName != null)
{
return (string) dexName.ConstructorArguments[0].Value;
}
return NameConverter.GetConvertedName(xMethod);
}