public WaterboxAdapter(IEnumerable <Delegate> slots, ICallbackAdjuster waterboxHost)
 {
     if (slots != null)
     {
         _slots = slots.Select((cb, i) => new { cb, i })
                  .ToDictionary(a => a.cb, a => a.i, new ReferenceEqualityComparer());
     }
     _waterboxHost = waterboxHost;
 }
 /// <summary>
 /// waterbox calling convention, including thunk handling for stack marshalling.  Can only do callins, not callouts
 /// </summary>
 public static ICallingConventionAdapter MakeWaterboxDepartureOnly(ICallbackAdjuster waterboxHost)
 {
     return(new WaterboxAdapter(null, waterboxHost));
 }
 /// <summary>
 /// waterbox calling convention, including thunk handling for stack marshalling
 /// </summary>
 public static ICallingConventionAdapter MakeWaterbox(IEnumerable <Delegate> slots, ICallbackAdjuster waterboxHost)
 {
     return(new WaterboxAdapter(slots, waterboxHost));
 }