Example #1
0
        internal static MonoPropertyInfo Create(IMonoStructType klass, int index,
                                                Cecil.PropertyDefinition pinfo)
        {
            TargetType type = klass.File.MonoLanguage.LookupMonoType(pinfo.PropertyType);

            bool                      is_static = false;
            MonoFunctionType          getter, setter;
            TargetMemberAccessibility accessibility = TargetMemberAccessibility.Private;

            if (pinfo.SetMethod != null)
            {
                setter        = klass.LookupFunction(pinfo.SetMethod);
                is_static     = pinfo.SetMethod.IsStatic;
                accessibility = MonoMethodInfo.GetAccessibility(pinfo.SetMethod);
            }
            else
            {
                setter = null;
            }

            if (pinfo.GetMethod != null)
            {
                getter        = klass.LookupFunction(pinfo.GetMethod);
                is_static     = pinfo.GetMethod.IsStatic;
                accessibility = MonoMethodInfo.GetAccessibility(pinfo.GetMethod);
            }
            else
            {
                getter = null;
            }

            return(new MonoPropertyInfo(
                       type, klass, index, is_static, pinfo, accessibility, getter, setter));
        }
Example #2
0
        internal static MonoMethodInfo Create(IMonoStructType klass, int index,
                                              Cecil.MethodDefinition minfo)
        {
            MonoFunctionType type = klass.LookupFunction(minfo);

            return(new MonoMethodInfo(klass, index, minfo, type));
        }
Example #3
0
        internal static MonoEventInfo Create(IMonoStructType klass, int index,
                                             Cecil.EventDefinition einfo)
        {
            TargetType type = klass.File.MonoLanguage.LookupMonoType(einfo.EventType);

            bool             is_static = false;
            MonoFunctionType add, remove, raise;

            TargetMemberAccessibility accessibility = TargetMemberAccessibility.Private;

            if (einfo.AddMethod != null)
            {
                add           = klass.LookupFunction(einfo.AddMethod);
                is_static     = einfo.AddMethod.IsStatic;
                accessibility = MonoMethodInfo.GetAccessibility(einfo.AddMethod);
            }
            else
            {
                add = null;
            }

            if (einfo.RemoveMethod != null)
            {
                remove        = klass.LookupFunction(einfo.RemoveMethod);
                is_static     = einfo.RemoveMethod.IsStatic;
                accessibility = MonoMethodInfo.GetAccessibility(einfo.RemoveMethod);
            }
            else
            {
                remove = null;
            }

            if (einfo.InvokeMethod != null)
            {
                raise         = klass.LookupFunction(einfo.InvokeMethod);
                is_static     = einfo.InvokeMethod.IsStatic;
                accessibility = MonoMethodInfo.GetAccessibility(einfo.InvokeMethod);
            }
            else
            {
                raise = null;
            }

            return(new MonoEventInfo(
                       klass, index, einfo, type, is_static, accessibility, add, remove, raise));
        }
Example #4
0
        internal static MonoEventInfo Create(IMonoStructType klass, int index,
						      Cecil.EventDefinition einfo)
        {
            TargetType type = klass.File.MonoLanguage.LookupMonoType (einfo.EventType);

            bool is_static = false;
            MonoFunctionType add, remove, raise;

            TargetMemberAccessibility accessibility = TargetMemberAccessibility.Private;
            if (einfo.AddMethod != null) {
                add = klass.LookupFunction (einfo.AddMethod);
                is_static = einfo.AddMethod.IsStatic;
                accessibility = MonoMethodInfo.GetAccessibility (einfo.AddMethod);
            } else
                add = null;

            if (einfo.RemoveMethod != null) {
                remove = klass.LookupFunction (einfo.RemoveMethod);
                is_static = einfo.RemoveMethod.IsStatic;
                accessibility = MonoMethodInfo.GetAccessibility (einfo.RemoveMethod);
            } else
                remove = null;

            if (einfo.InvokeMethod != null) {
                raise = klass.LookupFunction (einfo.InvokeMethod);
                is_static = einfo.InvokeMethod.IsStatic;
                accessibility = MonoMethodInfo.GetAccessibility (einfo.InvokeMethod);
            } else
                raise = null;

            return new MonoEventInfo (
                klass, index, einfo, type, is_static, accessibility, add, remove, raise);
        }
Example #5
0
        internal static MonoPropertyInfo Create(IMonoStructType klass, int index,
							 Cecil.PropertyDefinition pinfo)
        {
            TargetType type = klass.File.MonoLanguage.LookupMonoType (pinfo.PropertyType);

            bool is_static = false;
            MonoFunctionType getter, setter;
            TargetMemberAccessibility accessibility = TargetMemberAccessibility.Private;
            if (pinfo.SetMethod != null) {
                setter = klass.LookupFunction (pinfo.SetMethod);
                is_static = pinfo.SetMethod.IsStatic;
                accessibility = MonoMethodInfo.GetAccessibility (pinfo.SetMethod);
            } else
                setter = null;

            if (pinfo.GetMethod != null) {
                getter = klass.LookupFunction (pinfo.GetMethod);
                is_static = pinfo.GetMethod.IsStatic;
                accessibility = MonoMethodInfo.GetAccessibility (pinfo.GetMethod);
            } else
                getter = null;

            return new MonoPropertyInfo (
                type, klass, index, is_static, pinfo, accessibility, getter, setter);
        }
Example #6
0
        internal static MonoMethodInfo Create(IMonoStructType klass, int index,
						       Cecil.MethodDefinition minfo)
        {
            MonoFunctionType type = klass.LookupFunction (minfo);
            return new MonoMethodInfo (klass, index, minfo, type);
        }