示例#1
0
            private static void BulkInsertResponse(int reqId, IntPtr provider, IntPtr bulkResults, bool providerResult, string error, IntPtr userData)
            {
                Log.Debug(LogTag, $"BulkInsertResponse {reqId.ToString()}");

                BulkResultData brd;
                Consumer       consumer = null;

                if (!UnregisterReqId(reqId, ref consumer))
                {
                    return;
                }

                if (!providerResult)
                {
                    Log.Error(LogTag, $"reqId {reqId.ToString()}, error : {error}");
                }

                if (bulkResults != IntPtr.Zero)
                {
                    brd = new BulkResultData(new Interop.DataControl.SafeBulkResultDataHandle(bulkResults, false));
                }
                else
                {
                    brd = new BulkResultData();
                    Log.Error(LogTag, $"reqId {reqId.ToString()}, bulkResults is null");
                }

                consumer.OnBulkInsertResult(new BulkInsertResult(brd, providerResult));
            }
示例#2
0
            private static void BulkInsertResponse(int reqId, IntPtr provider, IntPtr bulkResults, bool providerResult, string error, IntPtr userData)
            {
                BulkResultData brd;

                Log.Debug(LogTag, $"BulkInsertResponse {reqId.ToString()}");
                if (!_reqConsumerDictionary.ContainsKey(reqId))
                {
                    Log.Error(LogTag, $"Invalid reqId {reqId.ToString()}");
                    return;
                }

                if (!providerResult)
                {
                    Log.Error(LogTag, $"reqId {reqId.ToString()}, error : {error}");
                }

                if (bulkResults != IntPtr.Zero)
                {
                    brd = new BulkResultData(new Interop.DataControl.SafeBulkResultDataHandle(bulkResults, false));
                }
                else
                {
                    brd = new BulkResultData();
                    Log.Error(LogTag, $"reqId {reqId.ToString()}, bulkResults is null");
                }

                Consumer consumer = _reqConsumerDictionary[reqId];

                consumer.OnBulkInsertResult(new BulkInsertResult(brd, providerResult));
                _reqConsumerDictionary.Remove(reqId);
            }
示例#3
0
        /// <summary>
        /// Initializes the InsertResult class with the bulkResultData and the result.
        /// </summary>
        /// <param name="bulkResultData">The bulk insert request result data.</param>
        /// <param name="result">The bulk insert request result.</param>
        /// <exception cref="ArgumentException">Thrown in case of an invalid parameter.</exception>
        /// <since_tizen> 3 </since_tizen>
        public BulkInsertResult(BulkResultData bulkResultData, bool result)
        {
            if (result == true && (bulkResultData == null || bulkResultData.SafeBulkDataHandle.IsInvalid))
            {
                ErrorFactory.ThrowException(ResultType.InvalidParameter, false, "bulkResultData");
            }

            BulkResultData = bulkResultData;
            Result         = result;
        }