public static Task <ulong> IDataNewSelfEncryptorAsync() { var tcs = new TaskCompletionSource <ulong>(); IDataNewSelfEncryptorCb callback = null; callback = (self, result, sEWriterHandle) => { if (result.ErrorCode != 0) { tcs.SetException(result.ToException()); CallbackManager.Unregister(callback); return; } tcs.SetResult(sEWriterHandle); CallbackManager.Unregister(callback); }; CallbackManager.Register(callback); NativeBindings.IDataNewSelfEncryptor(Session.AppPtr, Session.UserData, callback); return(tcs.Task); }
public static extern void IDataNewSelfEncryptorNative(IntPtr appPtr, IntPtr self, IDataNewSelfEncryptorCb callback);
public void IDataNewSelfEncryptor(IntPtr appPtr, IntPtr self, IDataNewSelfEncryptorCb callback) { IDataNewSelfEncryptorNative(appPtr, self, callback); }