コード例 #1
0
        internal List <BaseStdSegment> IsQualified(BaseFieldValues baseFieldValues, QulificationLevel recursiveCheck)
        {
            var retVal = new List <BaseStdSegment>();

            try
            {
                foreach (BaseStdSegment segmentDefinition in SegmentDefinitions)
                {
                    if (segmentDefinition.IsQualified(baseFieldValues))
                    {
                        retVal.Add(segmentDefinition);
                    }
                }

                if (recursiveCheck != QulificationLevel.TopMost) //was originally written this way because there was a .Recursive option that was removed.  Leaving like this because more could be added and this would break, seems less likely to break this way
                {
                    if (recursiveCheck == QulificationLevel.FirstChild)
                    {
                        recursiveCheck = QulificationLevel.TopMost;
                    }

                    //would have to search lower than our current level
                    //can only do this if we are currently working in a loop
                    //if we are, check its child loopCollections as well
                    if (LoopEntities != null && LoopEntities.Any())
                    {
                        foreach (LoopCollectionBase childLoopCollection in LoopEntities.Last().ChildLoopCollections)
                        {
                            retVal.AddRange(childLoopCollection.IsQualified(baseFieldValues, recursiveCheck));
                        }
                    }
                }
            }
            catch (Exception ex)
            {
                //todo srsly, how are we handling these here errors
            }

            return(retVal);
        }
コード例 #2
0
 /// <summary>
 /// Checks to see this loop contains a definition to handle a given BaseFieldValue (segment line)
 /// </summary>
 /// <param name="baseFieldValues">segment line from the segment stream class</param>
 /// <param name="recursiveCheck">how far down the heirarchy to look (only segments in this loop, or include first level of children loops)</param>
 /// <returns>Any handlers that qualify for the given segment line.  Should only be one, but needs to be checked and Count!=1 instances should be hanlded accordingly</returns>
 internal List <BaseStdSegment> IsQualified(BaseFieldValues baseFieldValues, QulificationLevel recursiveCheck)
 {
     return(ParentLoopCollection.IsQualified(baseFieldValues, recursiveCheck));
 }