public static Task <ulong> MDataInfoRandomPrivateAsync(ulong typeTag) { var tcs = new TaskCompletionSource <ulong>(); MDataInfoRandomPrivateCb callback = null; callback = (pVoid, result, privateMDataInfoH) => { if (result.ErrorCode != 0) { tcs.SetException(result.ToException()); CallbackManager.Unregister(callback); return; } tcs.SetResult(privateMDataInfoH); CallbackManager.Unregister(callback); }; CallbackManager.Register(callback); NativeBindings.MDataInfoRandomPrivate(Session.AppPtr, typeTag, Session.UserData, callback); return(tcs.Task); }
public static extern void MDataInfoRandomPrivateNative(IntPtr appPtr, ulong typeTag, IntPtr self, MDataInfoRandomPrivateCb callback);
public void MDataInfoRandomPrivate(IntPtr appPtr, ulong typeTag, IntPtr self, MDataInfoRandomPrivateCb callback) { MDataInfoRandomPrivateNative(appPtr, typeTag, self, callback); }