本文整理汇总了C#中Mono.Cecil.TypeDefinition.ImplementsIJavaObject方法的典型用法代码示例。如果您正苦于以下问题:C# TypeDefinition.ImplementsIJavaObject方法的具体用法?C# TypeDefinition.ImplementsIJavaObject怎么用?C# TypeDefinition.ImplementsIJavaObject使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Mono.Cecil.TypeDefinition
的用法示例。
在下文中一共展示了TypeDefinition.ImplementsIJavaObject方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: ProcessType
public override void ProcessType(TypeDefinition type)
{
// If this isn't a JLO or IJavaObject implementer,
// then we don't need to MarkJavaObjects
if (!type.ImplementsIJavaObject ())
return;
PreserveJavaObjectImplementation (type);
if (IsImplementor (type))
PreserveImplementor (type);
// If a user overrode a method, we need to preserve it,
// because it won't be referenced anywhere, but it will
// be called from Java
if (IsUserType (type) && type.HasMethods) {
foreach (var method in type.Methods.Where (m => m.Overrides != null))
PreserveMethod (type, method);
}
}
示例2: DoAdditionalTypeProcessing
protected override void DoAdditionalTypeProcessing(TypeDefinition type)
{
// If we are preserving a Mono.Android interface,
// preserve all members on the interface.
if (!type.IsInterface)
return;
// Mono.Android interfaces will always inherit IJavaObject
if (!type.ImplementsIJavaObject ())
return;
foreach (MethodReference method in type.Methods)
MarkMethod (method);
// We also need to preserve the interface adapter
string adapter;
if (!TryGetRegisterMember (type, out adapter))
return;
// This is a fast path for finding the adapter type
var adapter_type = type.DeclaringType.GetNestedType (adapter);
// It wasn't in the same containing type, look through the whole assembly
if (adapter_type == null)
adapter_type = type.Module.FindType (adapter);
if (adapter_type == null)
return;
MarkType (adapter_type);
// We also need to preserve every member on the interface adapter
foreach (MethodReference m in adapter_type.Methods)
MarkMethod (m);
}