internal static void InvokeAddAssignCallSite(object target, string name, object[] args, string[] argNames, Type context, bool staticContext, ref CallSite callSiteIsEvent, ref CallSite callSiteAdd, ref CallSite callSiteGet, ref CallSite callSiteSet) { if (InvokeIsEventCallSite(target, name, context, ref callSiteIsEvent)) { InvokeMemberActionCallSite(target, InvokeMemberName.CreateSpecialName("add_" + name), args, argNames, context, staticContext, ref callSiteAdd); } else { dynamic tGet = InvokeGetCallSite(target, name, context, staticContext, ref callSiteGet); tGet += (dynamic)(args[0]); InvokeSetCallSite(target, name, (object)tGet, context, staticContext, ref callSiteSet); } }
internal static void InvokeSubtractAssignCallSite(object target, string name, object[] args, string[] argNames, Type context, bool staticContext, ref CallSite callSiteIsEvent, ref CallSite callSiteRemove, ref CallSite callSiteGet, ref CallSite callSiteSet) { if (InvokeIsEventCallSite(target, name, context, ref callSiteIsEvent)) { InvokeMemberActionCallSite(target, InvokeMemberName.CreateSpecialName("remove_" + name), args, argNames, context, staticContext, ref callSiteRemove); } else { dynamic tGet = InvokeGetCallSite(target, name, context, staticContext, ref callSiteGet); tGet -= (dynamic)(args[0]); InvokeHelper.InvokeSetCallSite(target, name, tGet, context, staticContext, ref callSiteSet); } }
internal static void InvokeSubtractAssignCallSite(object target, string name, object[] args, string[] argNames, Type context, bool staticContext, // lgtm [cs/too-many-ref-parameters] ref CallSite callSiteIsEvent, ref CallSite callSiteRemove, ref CallSite callSiteGet, ref CallSite callSiteSet) //This is an optimization readability isn't the concern. { if (InvokeIsEventCallSite(target, name, context, ref callSiteIsEvent)) { InvokeMemberActionCallSite(target, InvokeMemberName.CreateSpecialName("remove_" + name), args, argNames, context, staticContext, ref callSiteRemove); } else { dynamic tGet = InvokeGetCallSite(target, name, context, staticContext, ref callSiteGet); tGet -= (dynamic)(args[0]); InvokeHelper.InvokeSetCallSite(target, name, tGet, context, staticContext, ref callSiteSet); } }