當前位置: 首頁>>代碼示例>>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;未經允許,請勿轉載。