private static void FetchSkusCallbackImpl(IntPtr ptr, Result result) { GCHandle h = GCHandle.FromIntPtr(ptr); FetchSkusHandler callback = (FetchSkusHandler)h.Target; h.Free(); callback(result); }
/// <summary> /// Fetches the list of SKUs for the connected application, readying them for iteration. /// <para> /// Only SKUs that have a price set will be fetched. If you aren't seeing any SKUs being returned, make sure they /// have a price set! /// </para> /// </summary> /// <param name="callback"></param> public void FetchSkus(FetchSkusHandler callback) { GCHandle wrapped = GCHandle.Alloc(callback); Methods.FetchSkus(methodsPtr, GCHandle.ToIntPtr(wrapped), FetchSkusCallbackImpl); }