internal LocalBuilder EmitLoadMember(EmitContext ec, LocalBuilder local) { ec.EmitLoadSubject(local); return(member.OnFieldOrProperty <LocalBuilder> ( field => EmitLoadField(ec, field), prop => EmitLoadProperty(ec, prop))); }
private void EmitPropertyAccess(EmitContext ec, PropertyInfo property) { MethodInfo getMethod = property.GetGetMethod(true); if (!getMethod.IsStatic) { ec.EmitLoadSubject(this.expression); } ec.EmitCall(getMethod); }
void EmitPropertyAccess(EmitContext ec, PropertyInfo property) { var getter = property.GetGetMethod(true); if (!getter.IsStatic) { ec.EmitLoadSubject(expression); } ec.EmitCall(getter); }
private void EmitFieldAccess(EmitContext ec, FieldInfo field) { if (!field.IsStatic) { ec.EmitLoadSubject(this.expression); ec.ig.Emit(OpCodes.Ldfld, field); } else { ec.ig.Emit(OpCodes.Ldsfld, field); } }
private void EmitPropertyAssignment(EmitContext ec, PropertyInfo property, LocalBuilder local) { MethodInfo setMethod = property.GetSetMethod(true); if (setMethod == null) { throw new InvalidOperationException(); } ec.EmitLoadSubject(local); this.expression.Emit(ec); ec.EmitCall(setMethod); }
internal LocalBuilder EmitLoadMember(EmitContext ec, LocalBuilder local) { ec.EmitLoadSubject(local); return(member.OnFieldOrProperty((FieldInfo field) => EmitLoadField(ec, field), (PropertyInfo prop) => EmitLoadProperty(ec, prop))); }
void EmitFieldAssignment(EmitContext ec, FieldInfo field, LocalBuilder local) { ec.EmitLoadSubject(local); expression.Emit(ec); ec.ig.Emit(OpCodes.Stfld, field); }