示例#1
0
        /// <summary>
        /// Removes an identity from a listener.
        /// </summary>
        /// <param name="listener">The listener to remove the identity from.</param>
        /// <param name="wallet">The wallet.</param>
        /// <param name="did">The DID of the identity to remove.</param>
        /// <returns>An asynchronous task that returns no value.</returns>
        private static Task AgentRemoveIdentityAsync(Listener listener, Wallet wallet, string did)
        {
            var taskCompletionSource = new TaskCompletionSource <bool>();
            var commandHandle        = AddTaskCompletionSource(taskCompletionSource);

            var result = IndyNativeMethods.indy_agent_remove_identity(
                commandHandle,
                listener.Handle,
                wallet.Handle,
                did,
                _noValueCallback
                );

            CheckResult(result);

            return(taskCompletionSource.Task);
        }
示例#2
0
        /// <summary>
        /// Removes an identity from the listener.
        /// </summary>
        /// <remarks>
        /// <para>Once an identity has been added to an AgentListner using the <see cref="AddIdentityAsync(Pool, Wallet, string)"/>
        /// it can be removed using this method. A <see cref="Wallet"/> lookup will be performed to find
        /// the identity information for the DID so the wallet containing the DID must be provided.
        /// </para>
        /// </remarks>
        /// <param name="wallet">The wallet that contains the identity for the DID.</param>
        /// <param name="did">The DID of the identity to remove. </param>
        /// <returns>An asynchronous <see cref="Task"/> completes once the operation completes.</returns>
        public Task RemoveIdentityAsync(Wallet wallet, string did)
        {
            var taskCompletionSource = new TaskCompletionSource <bool>();
            var commandHandle        = PendingCommands.Add(taskCompletionSource);

            var result = IndyNativeMethods.indy_agent_remove_identity(
                commandHandle,
                Handle,
                wallet.Handle,
                did,
                CallbackHelper.TaskCompletingNoValueCallback
                );

            CallbackHelper.CheckResult(result);

            return(taskCompletionSource.Task);
        }