public override DynamicMetaObject BindSetIndex(SetIndexBinder binder, DynamicMetaObject[] indexes, DynamicMetaObject value) { if (!this.IsOverridden("TrySetIndex")) { return(base.BindSetIndex(binder, indexes, value)); } return(this.CallMethodReturnLast("TrySetIndex", binder, DynamicProxyMetaObject <T> .GetArgArray(indexes, value), (DynamicMetaObject e) => binder.FallbackSetIndex(this, indexes, value, e))); }
public override DynamicMetaObject BindDeleteIndex(DeleteIndexBinder binder, DynamicMetaObject[] indexes) { if (!this.IsOverridden("TryDeleteIndex")) { return(base.BindDeleteIndex(binder, indexes)); } return(this.CallMethodNoResult("TryDeleteIndex", binder, DynamicProxyMetaObject <T> .GetArgArray(indexes), (DynamicMetaObject e) => binder.FallbackDeleteIndex(this, indexes, e))); }
public override DynamicMetaObject BindInvoke(InvokeBinder binder, DynamicMetaObject[] args) { if (!this.IsOverridden("TryInvoke")) { return(base.BindInvoke(binder, args)); } return(this.CallMethodWithResult("TryInvoke", binder, DynamicProxyMetaObject <T> .GetArgArray(args), (DynamicMetaObject e) => binder.FallbackInvoke(this, args, e), null)); }
public override DynamicMetaObject BindGetIndex(GetIndexBinder binder, DynamicMetaObject[] indexes) { if (!this.IsOverridden("TryGetIndex")) { return(base.BindGetIndex(binder, indexes)); } return(this.CallMethodWithResult("TryGetIndex", binder, DynamicProxyMetaObject <T> .GetArgArray(indexes), e => binder.FallbackGetIndex((DynamicProxyMetaObject <T>) this, indexes, e), null)); }
public override DynamicMetaObject BindCreateInstance(CreateInstanceBinder binder, DynamicMetaObject[] args) { if (!this.IsOverridden("TryCreateInstance")) { return(base.BindCreateInstance(binder, args)); } return(this.CallMethodWithResult("TryCreateInstance", binder, DynamicProxyMetaObject <T> .GetArgArray(args), e => binder.FallbackCreateInstance((DynamicProxyMetaObject <T>) this, args, e), null)); }
public override DynamicMetaObject BindInvokeMember(InvokeMemberBinder binder, DynamicMetaObject[] args) { if (!this.IsOverridden("TryInvokeMember")) { return(base.BindInvokeMember(binder, args)); } DynamicProxyMetaObject <T> .Fallback fallback = (DynamicMetaObject e) => binder.FallbackInvokeMember(this, args, e); return(this.BuildCallMethodWithResult("TryInvokeMember", binder, DynamicProxyMetaObject <T> .GetArgArray(args), this.BuildCallMethodWithResult("TryGetMember", new DynamicProxyMetaObject <T> .GetBinderAdapter(binder), DynamicProxyMetaObject <T> .NoArgs, fallback(null), (DynamicMetaObject e) => binder.FallbackInvoke(e, args, null)), null)); }
public override DynamicMetaObject BindInvokeMember(InvokeMemberBinder binder, DynamicMetaObject[] args) { if (!this.IsOverridden("TryInvokeMember")) { return(base.BindInvokeMember(binder, args)); } Fallback <T> fallback = e => binder.FallbackInvokeMember((DynamicProxyMetaObject <T>) this, args, e); DynamicMetaObject errorSuggestion = this.BuildCallMethodWithResult("TryInvokeMember", binder, DynamicProxyMetaObject <T> .GetArgArray(args), this.BuildCallMethodWithResult("TryGetMember", new GetBinderAdapter <T>(binder), DynamicProxyMetaObject <T> .NoArgs, fallback(null), e => binder.FallbackInvoke(e, args, null)), null); if (!this._dontFallbackFirst) { return(fallback(errorSuggestion)); } return(errorSuggestion); }