当前位置: 首页>>代码示例>>C#>>正文


C# TypeDefinition.ImplementsIJavaObject方法代码示例

本文整理汇总了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);
            }
        }
开发者ID:yudhitech,项目名称:xamarin-android,代码行数:20,代码来源:MarkJavaObjects.cs

示例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);
        }
开发者ID:yudhitech,项目名称:xamarin-android,代码行数:36,代码来源:MonoDroidMarkStep.cs


注:本文中的Mono.Cecil.TypeDefinition.ImplementsIJavaObject方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。