Example #1
0
        /// <summary>
        /// Deletes a wallet.
        /// </summary>
        /// <remarks>
        /// <para>Deletes a wallet created earlier using the <see cref="CreateWalletAsync(string, string, string, string, string)"/>
        /// by name.
        /// </para>
        /// <para>The <paramref name="credentials"/> parameter is unused in the default wallet at present,
        /// however the value can be used by custom wallet implementations; it is up to the custom wallet
        /// type implementer to interpret the value.
        /// </para>
        /// </remarks>
        /// <param name="name">The name of the wallet to delete.</param>
        /// <param name="credentials">The wallet credentials.</param>
        /// <returns>An asynchronous <see cref="Task"/> with no return value that completes when the operation completes.</returns>
        public static Task DeleteWalletAsync(string name, string credentials)
        {
            var taskCompletionSource = new TaskCompletionSource <bool>();
            var commandHandle        = PendingCommands.Add(taskCompletionSource);

            var result = IndyNativeMethods.indy_delete_wallet(
                commandHandle,
                name,
                credentials,
                CallbackHelper.TaskCompletingNoValueCallback
                );

            CallbackHelper.CheckResult(result);

            return(taskCompletionSource.Task);
        }