public override void SetValue (EvaluationContext ctx, object value) { ctx.AssertTargetInvokeAllowed (); var args = new Value [indexerArgs != null ? indexerArgs.Length + 1 : 1]; if (indexerArgs != null) indexerArgs.CopyTo (args, 0); args [args.Length - 1] = (Value) value; var setter = property.GetSetMethod (true); if (setter == null) throw new EvaluatorException ("Property is read-only"); this.value = null; haveValue = false; ((SoftEvaluationContext) ctx).RuntimeInvoke (setter, obj ?? declaringType, args); this.value = value; haveValue = true; }
public override object RuntimeInvoke (EvaluationContext gctx, object targetType, object target, string methodName, object[] argTypes, object[] argValues) { gctx.AssertTargetInvokeAllowed (); MdbEvaluationContext ctx = (MdbEvaluationContext) gctx; TargetObject[] lst = new TargetObject [argValues.Length]; Array.Copy (argValues, lst, argValues.Length); if (target != null) return CallMethod (ctx, methodName, (TargetObject) target, lst); else return CallStaticMethod (ctx, methodName, (TargetType) targetType, lst); }