private static bool IsAutoImplemented(CodeFieldReference field, PropertyDefinition property) { if (field != null && field.TargetObject is CodeThisReference) { if (field.Field.Name == GetAutomaticBackingFieldName(property)) return true; } return false; }
private void LoadToken(Instruction il) { if (il.Operand is FieldReference) { var fieldRef = (FieldReference)il.Operand; var expr = new CodeFieldReference(null, fieldRef); Push(expr); return; } throw new NotImplementedException(); }
private void LoadStaticField(Instruction il) { var field = (FieldReference)il.Operand; CodeTypeReference typeRef = new CodeTypeReference(field.DeclaringType); CodeFieldReference expr = new CodeFieldReference(typeRef, field); Push(expr); }
private void LoadField(Instruction il) { var field = (FieldReference)il.Operand; CodeExpression targetObject = Pop(); CodeFieldReference expr = new CodeFieldReference(targetObject, field); Push(expr); }
private void StoreStaticField(Instruction il) { var field = (FieldReference)il.Operand; var rhs = RefinePrimitiveExpression(Pop(), field.FieldType); var typeRef = new CodeTypeReference(field.DeclaringType); var lhs = new CodeFieldReference(typeRef, field); AddAssignment(lhs, rhs); this.StaticFieldsSet.Add(field.Resolve()); }
private void StoreField(Instruction il) { var field = (FieldReference)il.Operand; var rhs = RefinePrimitiveExpression(Pop(), field.FieldType); var targetObject = Pop(); var lhs = new CodeFieldReference(targetObject, field); AddAssignment(lhs, rhs); }