Exemplo n.º 1
0
        internal static bool TryConstruct(cSequenceSets pSequenceSets, int pAsterisk, bool pDistinct, out cUIntList rResult)
        {
            if (pSequenceSets == null)
            {
                throw new ArgumentNullException(nameof(pSequenceSets));
            }

            rResult = new cUIntList();

            foreach (var lSequenceSet in pSequenceSets)
            {
                if (lSequenceSet == null)
                {
                    return(false);
                }
                if (!ZExpand(lSequenceSet, pAsterisk, out var lResult))
                {
                    return(false);
                }
                rResult.AddRange(lResult);
            }

            if (pDistinct)
            {
                rResult = new cUIntList(rResult.Distinct());
            }
            return(true);
        }
                public override eProcessDataResult ProcessData(cResponseData pData, cTrace.cContext pParentContext)
                {
                    var lContext = pParentContext.NewMethod(nameof(cCommandHookBaseSearchExtended), nameof(ProcessData));

                    if (!(pData is cResponseDataESearch lESearch))
                    {
                        return(eProcessDataResult.notprocessed);
                    }
                    if (!cASCII.Compare(mCommandTag, lESearch.Tag, true))
                    {
                        return(eProcessDataResult.notprocessed);
                    }

                    if (mSequenceSets == null)
                    {
                        mSequenceSets = new cSequenceSets();
                    }
                    if (lESearch.SequenceSet != null)
                    {
                        mSequenceSets.Add(lESearch.SequenceSet);
                    }

                    return(eProcessDataResult.processed);
                }