Ejemplo n.º 1
0
        //Virtural List Implementation

        public async Task <Tuple <IEnumerable <AsycudaDocumentSetEntryDataDetails>, int> > LoadRange(int startIndex, int count, string exp, Dictionary <string, string> navExp, IEnumerable <string> includeLst = null)
        {
            var overallCount = 0;

            if (System.ComponentModel.LicenseManager.UsageMode == LicenseUsageMode.Designtime || exp == null || exp == "None")
            {
                return(new Tuple <IEnumerable <AsycudaDocumentSetEntryDataDetails>, int>(new List <AsycudaDocumentSetEntryDataDetails>().AsEnumerable(), overallCount));
            }

            try
            {
                using (var t = new AsycudaDocumentSetEntryDataDetailsClient())
                {
                    IEnumerable <DTO.AsycudaDocumentSetEntryDataDetails> res = null;

                    res = await t.LoadRangeNav(startIndex, count, exp, navExp, includeLst).ConfigureAwait(continueOnCapturedContext: false);

                    overallCount = await t.CountNav(exp, navExp).ConfigureAwait(continueOnCapturedContext: false);



                    if (res != null)
                    {
                        return(new Tuple <IEnumerable <AsycudaDocumentSetEntryDataDetails>, int>(res.Select(x => new AsycudaDocumentSetEntryDataDetails(x)).AsEnumerable(), overallCount));
                    }
                    else
                    {
                        return(null);
                    }
                }
            }
            catch (FaultException <ValidationFault> e)
            {
                throw new Exception(e.Detail.Message, e.InnerException);
            }
            catch (Exception)
            {
                Debugger.Break();
                throw;
            }
        }