Пример #1
0
 private void DescendantsInternal(ComparisonUnit comparisonUnit, List <ComparisonUnit> comparisonUnitList)
 {
     foreach (var cu in comparisonUnit.Contents)
     {
         comparisonUnitList.Add(cu);
         if (cu.Contents != null && cu.Contents.Any())
         {
             DescendantsInternal(cu, comparisonUnitList);
         }
     }
 }
Пример #2
0
        public static ComparisonUnitAtom GetFirstComparisonUnitAtomOfGroup(ComparisonUnit group)
        {
            var thisGroup = group;

            while (true)
            {
                if (thisGroup is ComparisonUnitGroup tg)
                {
                    thisGroup = tg.Contents.First();
                    continue;
                }
                if (!(thisGroup is ComparisonUnitWord tw))
                {
                    throw new OpenXmlPowerToolsException("Internal error: GetFirstComparisonUnitAtomOfGroup");
                }

                var ca = (ComparisonUnitAtom)tw.Contents.First();
                return(ca);
            }
        }