Ejemplo n.º 1
0
 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;
 }
Ejemplo n.º 2
0
        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();
        }
Ejemplo n.º 3
0
 private void LoadStaticField(Instruction il)
 {
     var field = (FieldReference)il.Operand;
     CodeTypeReference typeRef = new CodeTypeReference(field.DeclaringType);
     CodeFieldReference expr = new CodeFieldReference(typeRef, field);
     Push(expr);
 }
Ejemplo n.º 4
0
 private void LoadField(Instruction il)
 {
     var field = (FieldReference)il.Operand;
     CodeExpression targetObject = Pop();
     CodeFieldReference expr = new CodeFieldReference(targetObject, field);
     Push(expr);
 }
Ejemplo n.º 5
0
        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());
        }
Ejemplo n.º 6
0
 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);
 }