Esempio n. 1
0
        /// <summary>
        /// Close wallet search (make search handle invalid)
        /// </summary>
        /// <returns>The wallet search async.</returns>
        /// <param name="walletSearch">Wallet search.</param>
        public static Task CloseWalletSearchAsync(WalletSearch walletSearch)
        {
            ParamGuard.NotNull(walletSearch, "walletSearch");

            var taskCompletionSource = new TaskCompletionSource <string>();
            var commandHandle        = PendingCommands.Add(taskCompletionSource);

            var result = NativeMethods.indy_close_wallet_search(
                commandHandle,
                walletSearch.Handle,
                CallbackHelper.TaskCompletingNoValueCallback);

            return(taskCompletionSource.Task);
        }
Esempio n. 2
0
        /// <summary>
        /// Fetch next records for wallet search.
        /// </summary>
        /// <returns>
        /// <code>
        /// {
        ///   totalCount: &lt;str>, // present only if retrieveTotalCount set to true
        ///   records: [{ // present only if retrieveRecords set to true
        ///       id: "Some id",
        ///       type: "Some type", // present only if retrieveType set to true
        ///       value: "Some value", // present only if retrieveValue set to true
        ///       tags: &lt;tags json>, // present only if retrieveTags set to true
        ///   }],
        /// }
        /// </code>
        /// </returns>
        /// <param name="wallet">Wallet.</param>
        /// <param name="walletSearch">Wallet search handle (created by <see cref="OpenSearchAsync(Wallet, string, string, string)"/>).</param>
        /// <param name="count">Count of records to fetch.</param>
        public static Task <string> FetchNextRecordsAsync(Wallet wallet, WalletSearch walletSearch, int count)
        {
            ParamGuard.NotNull(wallet, "wallet");
            ParamGuard.NotNull(walletSearch, "walletSearch");

            var taskCompletionSource = new TaskCompletionSource <string>();
            var commandHandle        = PendingCommands.Add(taskCompletionSource);

            var result = NativeMethods.indy_fetch_wallet_search_next_records(
                commandHandle,
                wallet.Handle,
                walletSearch.Handle,
                count,
                FetchNextCallback);

            return(taskCompletionSource.Task);
        }