Example #1
0
        public static MethodInstance GetImplementedGetEntityMetaData(IClassVisitor cv, IEntityMetaData metaData)
        {
            MethodInstance method = MethodInstance.FindByTemplate(m_template_getEntityMetaData, true);

            if (method != null)
            {
                // already implemented
                return(method);
            }
            FieldInstance f_entityMetaData = cv.ImplementStaticAssignedField("sf__entityMetaData", metaData);

            return(cv.ImplementGetter(m_template_getEntityMetaData, f_entityMetaData));
        }
Example #2
0
        public virtual MethodInstance ImplementSetter(MethodInstance method, FieldInstance field)
        {
            ParamChecker.AssertParamNotNull(method, "method");
            ParamChecker.AssertParamNotNull(field, "field");
            IMethodVisitor mg = VisitMethod(method);

            mg.PutThisField(field, delegate(IMethodVisitor mg2)
            {
                mg2.LoadArg(0);
            });
            mg.ReturnVoidOrThis();
            mg.EndMethod();
            return(MethodInstance.FindByTemplate(method, false));
        }
Example #3
0
 public virtual void InvokeOnExactOwner(MethodInstance method)
 {
     if (method.Method == null)
     {
         method = MethodInstance.FindByTemplate(method, false);
     }
     if (method is ConstructorInstance)
     {
         gen.Emit(OpCodes.Call, (ConstructorInfo)method.Method);
     }
     else
     {
         gen.Emit(OpCodes.Call, (MethodInfo)method.Method);
     }
 }
Example #4
0
        protected void ImplementGetBaseType()
        {
            MethodInstance getBaseType = MethodInstance.FindByTemplate(template_m_getBaseType, true);

            if (getBaseType != null)
            {
                return;
            }
            IBytecodeBehaviorState state = State;
            IMethodVisitor         mg    = VisitMethod(template_m_getBaseType);

            mg.Push(state.OriginalType);
            mg.ReturnValue();
            mg.EndMethod();
        }
Example #5
0
        protected void ImplementHashCodeMethod(PropertyInstance p_entityEqualsTemplate)
        {
            MethodInstance methodTemplate = new MethodInstance(null, typeof(Object), typeof(int), "GetHashCode");
            MethodInstance method         = MethodInstance.FindByTemplate(methodTemplate, true);

            if (NewType.GetType(typeof(Object)).Equals(method.Owner) || method.Access.HasFlag(MethodAttributes.Abstract))
            {
                IMethodVisitor mg = VisitMethod(methodTemplate);
                mg.CallThisGetter(p_entityEqualsTemplate);
                mg.LoadThis();
                mg.LoadArgs();
                mg.InvokeVirtual(entityEquals_HashCode);
                mg.ReturnValue();
                mg.EndMethod();
            }
        }
Example #6
0
        protected void ImplementHashCode()
        {
            PropertyInstance p_objRefTemplate = GetObjRefTemplatePI(this);

            MethodInstance method = MethodInstance.FindByTemplate(template_m_hashCode, true);

            if (method == null || method.Access.HasFlag(MethodAttributes.Abstract))
            {
                IMethodVisitor mg = VisitMethod(template_m_hashCode);
                mg.CallThisGetter(p_objRefTemplate);
                mg.LoadThis();
                mg.LoadArgs();
                mg.InvokeVirtual(m_objRef_hashCode);
                mg.ReturnValue();
                mg.EndMethod();
            }
        }
Example #7
0
        protected void ImplementPropertyChanged(PropertyInstance p_propertyChangeTemplate)
        {
            MethodInstance m_propertyChanged_super = MethodInstance.FindByTemplate(template_m_PropertyChanged, true);
            IMethodVisitor mv = VisitMethod(template_m_PropertyChanged);

            if (m_propertyChanged_super != null)
            {
                mv.LoadThis();
                mv.LoadArgs();
                mv.InvokeSuperOfCurrentMethod();
            }
            mv.CallThisGetter(p_propertyChangeTemplate);
            mv.LoadThis();
            mv.LoadArgs();
            // call PCT.HandlePropertyChange(this, sender, arg)
            mv.InvokeVirtual(m_handlePropertyChange);
            mv.ReturnValue();
            mv.EndMethod();
        }
Example #8
0
        public virtual void CallThisGetter(MethodInstance method)
        {
            ParamChecker.AssertParamNotNull(method, "method");
            MethodInstance existingMethodInstance = MethodInstance.FindByTemplate(method, false);

            if (!existingMethodInstance.Owner.Equals(method.Owner))
            {
                CallThisGetter(existingMethodInstance);
                return;
            }
            if (!method.Access.HasFlag(MethodAttributes.Static))
            {
                LoadThis();
                InvokeVirtual(method);
            }
            else
            {
                InvokeStatic(method);
            }
        }
Example #9
0
        public override void VisitEnd()
        {
            MethodInstance m_get__Id = MethodInstance.FindByTemplate(GetIdMethodCreator.template_m_entityEquals_getId, true);

            if (m_get__Id != null)
            {
                base.VisitEnd();
                return;
            }
            MethodInstance m_getEntityMetaData = EntityMetaDataHolderVisitor.GetImplementedGetEntityMetaData(this, metaData);
            IMethodVisitor mg = VisitMethod(GetIdMethodCreator.template_m_entityEquals_getId);

            mg.CallThisGetter(m_getEntityMetaData);
            mg.InvokeInterface(new MethodInstance(null, typeof(IEntityMetaData), typeof(PrimitiveMember), "get_IdMember"));
            mg.LoadThis();
            mg.Push(false);
            mg.InvokeVirtual(EntityMetaDataMemberVisitor.template_m_getValueWithFlag);
            mg.ReturnValue();
            mg.EndMethod();

            base.VisitEnd();
        }
Example #10
0
        protected void ImplementToString()
        {
            PropertyInstance p_objRefTemplate = GetObjRefTemplatePI(this);

            MethodInstance methodSb;
            {
                methodSb = MethodInstance.FindByTemplate(template_m_toStringSb, true);
                if (methodSb == null || methodSb.Access.HasFlag(MethodAttributes.Abstract))
                {
                    IMethodVisitor mg = VisitMethod(template_m_toStringSb);
                    mg.CallThisGetter(p_objRefTemplate);
                    mg.LoadThis();
                    mg.LoadArgs();
                    mg.InvokeVirtual(m_objRef_toStringSb);
                    mg.ReturnValue();
                    mg.EndMethod();
                    methodSb = mg.Method;
                }
            }
            {
                MethodInstance method = MethodInstance.FindByTemplate(template_m_toString, true);
                if (method == null || NewType.GetType(typeof(Object)).Equals(method.Owner) || methodSb.Access.HasFlag(MethodAttributes.Abstract))
                {
                    IMethodVisitor    mg     = VisitMethod(template_m_toString);
                    LocalVariableInfo loc_sb = mg.NewLocal(typeof(StringBuilder));
                    mg.LoadThis();
                    mg.NewInstance(c_stringBuilder, null);
                    mg.StoreLocal(loc_sb);
                    mg.LoadLocal(loc_sb);
                    mg.InvokeVirtual(methodSb);
                    mg.LoadLocal(loc_sb);
                    mg.InvokeVirtual(new MethodInstance(null, typeof(StringBuilder), typeof(String), "ToString"));
                    mg.ReturnValue();
                    mg.EndMethod();
                }
            }
        }
Example #11
0
        /**
         * Almost empty implementation (just calling the static method) to be able to override and act on the property change
         */
        protected MethodInstance ImplementFirePropertyChange(PropertyInstance p_propertyChangeTemplate)
        {
            MethodInstance m_firePropertyChange_super = MethodInstance.FindByTemplate(template_m_firePropertyChange, true);

            IMethodVisitor mg;

            if (m_firePropertyChange_super == null)
            {
                // implement new
                mg = VisitMethod(template_m_firePropertyChange);
            }
            else
            {
                // override existing
                mg = VisitMethod(m_firePropertyChange_super);
            }
            Label l_propertyChangeIsInactive = mg.NewLabel();

            MethodInstance m_isPropertyChangeActive = MethodInstance.FindByTemplate(template_m_isPropertyChangeActive, false);

            mg.CallThisGetter(m_isPropertyChangeActive);
            mg.IfZCmp(CompareOperator.EQ, l_propertyChangeIsInactive);

            mg.CallThisGetter(p_propertyChangeTemplate);
            mg.LoadThis();
            mg.LoadArgs();
            // firePropertyChange(thisPointer, propertyChangeSupport, property, oldValue, newValue)
            mg.InvokeVirtual(m_firePropertyChange);
            mg.PopIfReturnValue(m_firePropertyChange);
            mg.Mark(l_propertyChangeIsInactive);

            mg.ReturnVoidOrThis();
            mg.EndMethod();

            return(mg.Method);
        }
        public override void VisitEnd()
        {
            HashMap <String, List <MethodInfo> > nameToMethodsMap = new HashMap <String, List <MethodInfo> >();

            foreach (MethodInfo method in ReflectUtil.GetMethods(State.OriginalType))
            {
                List <MethodInfo> methodList = nameToMethodsMap.Get(method.Name);
                if (methodList == null)
                {
                    methodList = new List <MethodInfo>();
                    nameToMethodsMap.Put(method.Name, methodList);
                }
                methodList.Add(method);
            }
            foreach (IPropertyInfo propertyInfo in propertyInfos)
            {
                MethodInfo getter = ((MethodPropertyInfo)propertyInfo).Getter;
                MethodInfo setter = ((MethodPropertyInfo)propertyInfo).Setter;
                if (getter == null)
                {
                    // look for abstract definition of the getter
                    getter = ReflectUtil.GetDeclaredMethod(true, State.CurrentType, propertyInfo.PropertyType, "get_" + propertyInfo.Name);
                }
                if (setter == null)
                {
                    // look for abstract definition of the setter
                    setter = ReflectUtil.GetDeclaredMethod(true, State.CurrentType, typeof(void), "set_" + propertyInfo.Name,
                                                           propertyInfo.PropertyType);
                }
                MethodInstance m_getterTemplate = getter != null ? new MethodInstance(getter) : null;
                MethodInstance m_setterTemplate = setter != null ? new MethodInstance(setter) : null;
                MethodInstance m_getter         = MethodInstance.FindByTemplate(m_getterTemplate, true);
                MethodInstance m_setter         = MethodInstance.FindByTemplate(m_setterTemplate, true);

                if (m_getter != null && m_setter != null)
                {
                    // ensure both accessors are public
                    if (!m_getter.Access.HasFlag(MethodAttributes.Public))
                    {
                        IMethodVisitor mv = VisitMethod(m_getter.DeriveAccess(MethodAttributes.Public));
                        mv.LoadThis();
                        mv.LoadArgs();
                        mv.InvokeSuper(m_getter);
                        mv.ReturnValue();
                        mv.EndMethod();
                    }
                    if (!m_setter.Access.HasFlag(MethodAttributes.Public))
                    {
                        IMethodVisitor mv = VisitMethod(m_setter.DeriveAccess(MethodAttributes.Public));
                        mv.LoadThis();
                        mv.LoadArgs();
                        mv.InvokeSuper(m_getter);
                        mv.ReturnValue();
                        mv.EndMethod();
                    }
                    continue;
                }
                if (m_getter != null || m_setter != null)
                {
                    // at least one of the accessors is explicitly implemented
                    continue;
                }
                FieldInstance f_backingField = EnsureBackingField(propertyInfo);
                if (f_backingField == null)
                {
                    continue;
                }
                if (m_setterTemplate == null)
                {
                    m_setterTemplate = new MethodInstance(null, MethodAttributes.Public | MethodAttributes.SpecialName, m_setterTemplate != null ? m_setterTemplate.ReturnType : NewType.VOID_TYPE,
                                                          "set_" + propertyInfo.Name, f_backingField.Type);
                }
                // implement setter
                m_setterTemplate = ImplementSetter(m_setterTemplate, f_backingField);
                List <MethodInfo> allSettersWithSameName = nameToMethodsMap.Get(m_setterTemplate.Name);
                if (allSettersWithSameName != null)
                {
                    MethodInstance f_m_setterTemplate = m_setterTemplate;
                    foreach (MethodInfo setterWithSameName in allSettersWithSameName)
                    {
                        MethodInstance m_setterWithSameName = MethodInstance.FindByTemplate(setterWithSameName, true);
                        if (m_setterWithSameName != null)
                        {
                            // method is implemented, so nothing to do
                            continue;
                        }
                        IMethodVisitor mv = VisitMethod(new MethodInstance(setterWithSameName));
                        if (mv.Method.Parameters.Length != 1)
                        {
                            // this visitor handles only "true" setters with exactly one argument
                            continue;
                        }
                        mv.CallThisSetter(m_setterTemplate, delegate(IMethodVisitor mg)
                        {
                            mg.LoadArg(0);
                            mg.CheckCast(f_m_setterTemplate.Parameters[0].Type);
                        });
                        mv.ReturnVoidOrThis();
                        mv.EndMethod();
                    }
                }
                if (m_getterTemplate == null)
                {
                    m_getterTemplate = new MethodInstance(null, MethodAttributes.Public | MethodAttributes.SpecialName, f_backingField.Type, "get_" + propertyInfo.Name, null);
                }
                // implement getter
                m_getterTemplate = ImplementGetter(m_getterTemplate, f_backingField);
                List <MethodInfo> allGettersWithSameName = nameToMethodsMap.Get(m_getterTemplate.Name);
                if (allGettersWithSameName != null)
                {
                    foreach (MethodInfo getterWithSameName in allGettersWithSameName)
                    {
                        MethodInstance m_getterWithSameName = MethodInstance.FindByTemplate(getterWithSameName, true);
                        if (m_getterWithSameName != null)
                        {
                            // method is implemented, so nothing to do
                            continue;
                        }
                        IMethodVisitor mv = VisitMethod(new MethodInstance(getterWithSameName));
                        mv.CallThisGetter(m_getterTemplate);
                        mv.ReturnValue();
                        mv.EndMethod();
                    }
                }
            }
            base.VisitEnd();
        }
Example #13
0
        protected PropertyInstance ImplementNotifyPropertyChangedSource(PropertyInstance p_propertyChangeTemplate,
                                                                        FieldInstance f_propertyChangeSupport)
        {
            MethodInstance m_onPropertyChanged_Values = MethodInstance.FindByTemplate(template_m_onPropertyChanged_Values, true);

            if (m_onPropertyChanged_Values == null)
            {
                IMethodVisitor mv = VisitMethod(template_m_onPropertyChanged_Values);
                mv.CallThisGetter(p_propertyChangeTemplate);
                mv.LoadThis();
                mv.GetThisField(f_propertyChangeSupport);

                // getMethodHandle(sender, propertyName)
                mv.CallThisGetter(p_propertyChangeTemplate);
                mv.LoadThis();
                mv.LoadArg(0);
                mv.InvokeVirtual(m_getMethodHandle);

                mv.LoadArg(1);
                mv.LoadArg(2);
                // firePropertyChange(sender, propertyChangeSupport, property, oldValue, newValue)
                mv.InvokeVirtual(m_firePropertyChange);
                mv.PopIfReturnValue(m_firePropertyChange);
                mv.ReturnVoidOrThis();
                mv.EndMethod();
                m_onPropertyChanged_Values = mv.Method;
            }
            MethodInstance m_onPropertyChanged = MethodInstance.FindByTemplate(template_m_onPropertyChanged, true);

            if (m_onPropertyChanged == null)
            {
                IMethodVisitor mv = VisitMethod(template_m_onPropertyChanged);
                mv.LoadThis();
                mv.LoadArg(0);
                mv.PushNull();
                mv.PushNull();
                mv.InvokeVirtual(m_onPropertyChanged_Values);
                mv.PopIfReturnValue(m_onPropertyChanged_Values);
                mv.ReturnVoidOrThis();
                mv.EndMethod();
                m_onPropertyChanged = mv.Method;
            }
            PropertyInstance p_pceHandlers = PropertyInstance.FindByTemplate(p_propertyChangeSupport, true);

            if (p_pceHandlers == null)
            {
                HideFromDebug(ImplementGetter(p_propertyChangeSupport.Getter, f_propertyChangeSupport));
                p_pceHandlers = PropertyInstance.FindByTemplate(p_propertyChangeSupport, false);
            }
            if (EmbeddedEnhancementHint.HasMemberPath(State.Context))
            {
                PropertyInstance p_parentEntity = EmbeddedTypeVisitor.GetParentObjectProperty(this);
                if (MethodInstance.FindByTemplate(p_parentChildEventHandler.Getter, true) == null)
                {
                    IMethodVisitor mv = VisitMethod(p_parentChildEventHandler.Getter);
                    mv.CallThisGetter(p_parentEntity);
                    mv.InvokeInterface(p_parentChildEventHandler.Getter);
                    mv.ReturnValue();
                    mv.EndMethod();
                    HideFromDebug(mv.Method);
                }
                if (MethodInstance.FindByTemplate(p_collectionEventHandler.Getter, true) == null)
                {
                    IMethodVisitor mv = VisitMethod(p_collectionEventHandler.Getter);
                    mv.CallThisGetter(p_parentEntity);
                    mv.InvokeInterface(p_collectionEventHandler.Getter);
                    mv.ReturnValue();
                    mv.EndMethod();
                    HideFromDebug(mv.Method);
                }
            }
            else
            {
                if (MethodInstance.FindByTemplate(p_parentChildEventHandler.Getter, true) == null)
                {
                    HideFromDebug(ImplementLazyInitProperty(p_parentChildEventHandler, delegate(IMethodVisitor mv)
                    {
                        MethodInstance method = new MethodInstance(null, typeof(NotifyPropertyChangedClassVisitor), typeof(PropertyChangedEventHandler), "CreateParentChildEventHandler", typeof(Object));
                        mv.LoadThis();
                        mv.InvokeStatic(method);
                    }));
                }
                if (MethodInstance.FindByTemplate(p_collectionEventHandler.Getter, true) == null)
                {
                    HideFromDebug(ImplementLazyInitProperty(p_collectionEventHandler, delegate(IMethodVisitor mv)
                    {
                        MethodInstance method = new MethodInstance(null, typeof(NotifyPropertyChangedClassVisitor), typeof(NotifyCollectionChangedEventHandler), "CreateCollectionEventHandler", typeof(Object));
                        mv.LoadThis();
                        mv.InvokeStatic(method);
                    }));
                }
            }

            //MethodAttributes ma = MethodAttributes.Public | MethodAttributes.Virtual | MethodAttributes.HideBySig;
            //{
            //    ConstructorInfo pceaCI = typeof(PropertyChangedEventArgs).GetConstructor(new Type[] { typeof(String) });

            //    MethodBuilder mb = VisitorUtil.DefineMethod(vs, onPropertyChangedMI_string, ma);
            //    ILGenerator gen = mb.GetILGenerator();
            //    gen.Emit(OpCodes.Ldarg_0);
            //    gen.Emit(OpCodes.Ldarg_1);
            //    gen.Emit(OpCodes.Newobj, pceaCI);
            //    gen.Emit(OpCodes.Call, onPropertyChangedMI_pceArg);
            //    gen.Emit(OpCodes.Ret);
            //}
            //{
            //    MethodBuilder mb = VisitorUtil.DefineMethod(vs, onPropertyChangedMI_pceArg, ma);
            //    ILGenerator gen = mb.GetILGenerator();
            //    gen.Emit(OpCodes.Ldarg_0);
            //    gen.Emit(OpCodes.Call, pctPI.GetGetMethod());
            //    gen.Emit(OpCodes.Ldarg_0);
            //    gen.Emit(OpCodes.Ldarg_1);
            //    gen.Emit(OpCodes.Call, FirePropertyChangedMI);
            //    gen.Emit(OpCodes.Ret);
            //}
            //    List<PropertyChangedEventHandler> PropertyChangedEventHandlers { get; }

            //void OnPropertyChanged(String propertyName);

            //void OnPropertyChanged(PropertyChangedEventArgs args);
            return(p_pceHandlers);
        }
Example #14
0
        protected PropertyInstance ImplementToBeUpdated()
        {
            PropertyInstance p_dataObjectTemplate = GetDataObjectTemplatePI(this);

            FieldInstance f_toBeUpdated = ImplementField(new FieldInstance(FieldAttributes.Private, "$toBeUpdated", template_p_toBeUpdated.PropertyType));

            bool atLeastOneToManyMember = false;
            List <RelationMember> parentChildMembers = new List <RelationMember>();

            foreach (RelationMember relationMember in metaData.RelationMembers)
            {
                if (relationMember.GetAnnotation(typeof(ParentChild)) != null)
                {
                    parentChildMembers.Add(relationMember);
                    if (relationMember.IsToMany)
                    {
                        atLeastOneToManyMember = true;
                    }
                }
            }
            bool             fAtLeastOneToManyMember = atLeastOneToManyMember;
            PropertyInstance p_toBeUpdated           = ImplementProperty(template_p_toBeUpdated, delegate(IMethodVisitor mg)
            {
                if (parentChildMembers.Count == 0)
                {
                    mg.GetThisField(f_toBeUpdated);
                    mg.ReturnValue();
                }
                else
                {
                    LocalVariableInfo loc_iterator = null;
                    if (fAtLeastOneToManyMember)
                    {
                        loc_iterator = mg.NewLocal(typeof(IEnumerator));
                    }
                    // we have to check the toBeUpdated-State for our "parentChild" members to decide our own toBeUpdate-State by OR-concatenation
                    LocalVariableInfo loc_parentChildValue = mg.NewLocal(typeof(Object));
                    Label trueLabel = mg.NewLabel();

                    mg.GetThisField(f_toBeUpdated);
                    mg.IfZCmp(CompareOperator.NE, trueLabel);

                    foreach (RelationMember parentChildMember in parentChildMembers)
                    {
                        int relationIndex   = metaData.GetIndexByRelationName(parentChildMember.Name);
                        Label l_valueIsNull = mg.NewLabel();
                        // load this RelationMember at runtime to be able to call its "getValue(Object obj)"

                        mg.LoadThis();
                        mg.Push(relationIndex);

                        mg.InvokeVirtual(MethodInstance.FindByTemplate(RelationsGetterVisitor.m_template_isInitialized_Member, false));

                        mg.IfZCmp(CompareOperator.EQ, l_valueIsNull);     // skip this member if it is not initialized

                        mg.LoadThis();
                        mg.Push(relationIndex);
                        mg.InvokeVirtual(MethodInstance.FindByTemplate(RelationsGetterVisitor.m_template_getValueDirect_Member, false));

                        mg.StoreLocal(loc_parentChildValue);

                        mg.LoadLocal(loc_parentChildValue);
                        mg.IfNull(l_valueIsNull);

                        mg.LoadLocal(loc_parentChildValue);

                        if (parentChildMember.IsToMany)
                        {
                            Label l_startLoop = mg.NewLabel();
                            Label l_endLoop   = mg.NewLabel();

                            mg.CheckCast(typeof(IEnumerable));
                            mg.InvokeInterface(new MethodInstance(null, typeof(IEnumerable), typeof(IEnumerator), "GetEnumerator"));
                            mg.StoreLocal(loc_iterator);

                            mg.Mark(l_startLoop);
                            mg.LoadLocal(loc_iterator);
                            mg.InvokeInterface(new MethodInstance(null, typeof(IEnumerator), typeof(bool), "MoveNext"));

                            mg.IfZCmp(CompareOperator.EQ, l_endLoop);
                            mg.LoadLocal(loc_iterator);
                            mg.InvokeInterface(new MethodInstance(null, typeof(IEnumerator), typeof(Object), "get_Current"));

                            mg.CheckCast(typeof(IDataObject));
                            mg.InvokeInterface(template_p_toBeUpdated.Getter);
                            mg.IfZCmp(CompareOperator.NE, trueLabel);

                            mg.GoTo(l_startLoop);
                            mg.Mark(l_endLoop);
                        }
                        else
                        {
                            mg.CheckCast(typeof(IDataObject));
                            mg.InvokeInterface(template_p_toBeUpdated.Getter);
                            mg.IfZCmp(CompareOperator.NE, trueLabel);
                        }
                        mg.Mark(l_valueIsNull);
                    }

                    mg.Push(false);
                    mg.ReturnValue();

                    mg.Mark(trueLabel);
                    mg.Push(true);
                    mg.ReturnValue();
                }
            }, delegate(IMethodVisitor mv)
            {
                LocalVariableInfo loc_existingValue = mv.NewLocal(typeof(bool));
                Label l_finish = mv.NewLabel();
                mv.GetThisField(f_toBeUpdated);
                mv.StoreLocal(loc_existingValue);

                mv.LoadLocal(loc_existingValue);
                mv.LoadArg(0);
                mv.IfCmp(typeof(bool), CompareOperator.EQ, l_finish);

                mv.PutThisField(f_toBeUpdated, delegate(IMethodVisitor mg2)
                {
                    mg2.LoadArg(0);
                });

                // call dataObjectTemplate
                mv.CallThisGetter(p_dataObjectTemplate);
                // "this" argument
                mv.LoadThis();
                // oldValue argument
                mv.LoadLocal(loc_existingValue);
                // newValue argument
                mv.LoadArg(0);
                mv.InvokeVirtual(m_toBeUpdatedChanged);

                mv.Mark(l_finish);
                mv.ReturnValue();
            });

            p_toBeUpdated.AddAnnotation(c_ignoreToBeUpdated);
            return(p_toBeUpdated);
        }
Example #15
0
 public static MethodInstance GetGetId()
 {
     return(MethodInstance.FindByTemplate(template_m_entityEquals_getId, false));
 }
Example #16
0
        public bool HasMethod(MethodInstance method)
        {
            MethodInstance existingMethod = MethodInstance.FindByTemplate(method, true);

            return(existingMethod != null && State.NewType.Equals(existingMethod.Owner));
        }
Example #17
0
 public static MethodInstance GetGetBaseType()
 {
     return(MethodInstance.FindByTemplate(template_m_getBaseType, false));
 }