XPathNodeView FillSubRow(ContentIterator iter, Shape shape, object[] columns) { if (null == columns) { int colCount = shape.SubShapes.Count; if (0 == colCount) { colCount = 1; } columns = new object[colCount]; } switch (shape.BindingType) { case BindingType.Element: columns[0] = FillColumn(iter, shape); break; case BindingType.Sequence: { int iPrev = -1; int i; while (null != iter.Node) { i = shape.FindMatchingSubShape(iter.Particle); if (i <= iPrev) { break; } columns[i] = FillColumn(iter, shape.SubShape(i)); iPrev = i; } break; } case BindingType.All: { while (null != iter.Node) { int i = shape.FindMatchingSubShape(iter.Particle); if (-1 == i || null != columns[i]) { break; } columns[i] = FillColumn(iter, shape.SubShape(i)); } break; } case BindingType.Choice: { int i = shape.FindMatchingSubShape(iter.Particle); if (-1 != i) { columns[i] = FillColumn(iter, shape.SubShape(i)); } break; } case BindingType.Repeat: default: // should not map to a row throw new NotSupportedException(); } return(new XPathNodeView(this, null, columns)); }
XPathNodeView FillSubRow(ContentIterator iter, Shape shape, object[] columns) { if (null == columns) { int colCount = shape.SubShapes.Count; if (0 == colCount) colCount = 1; columns = new object[colCount]; } switch (shape.BindingType) { case BindingType.Element: columns[0] = FillColumn(iter, shape); break; case BindingType.Sequence: { int iPrev = -1; int i; while (null != iter.Node) { i = shape.FindMatchingSubShape(iter.Particle); if (i <= iPrev) break; columns[i] = FillColumn(iter, shape.SubShape(i)); iPrev = i; } break; } case BindingType.All: { while (null != iter.Node) { int i = shape.FindMatchingSubShape(iter.Particle); if (-1 == i || null != columns[i]) break; columns[i] = FillColumn(iter, shape.SubShape(i)); } break; } case BindingType.Choice: { int i = shape.FindMatchingSubShape(iter.Particle); if (-1 != i) { columns[i] = FillColumn(iter, shape.SubShape(i)); } break; } case BindingType.Repeat: default: // should not map to a row throw new NotSupportedException(); } return new XPathNodeView(this, null, columns); }