Beispiel #1
0
 private static IEnumerable <SidSrc> _sidsrcs_for_shape(int shapeid, ShapeCache shapecache)
 {
     foreach (var shapecacheitem in shapecache)
     {
         foreach (int row_index in Enumerable.Range(0, shapecacheitem.RowCount))
         {
             var cols          = shapecacheitem.SectionQueryColumns;
             var section_index = shapecacheitem.SectionIndex;
             foreach (var col in cols)
             {
                 var sidsrc = new VASS.SidSrc(
                     (short)shapeid,
                     (short)section_index,
                     (short)row_index,
                     col.Src.Cell);
                 yield return(sidsrc);
             }
         }
     }
 }
Beispiel #2
0
        private SectionQueryShapeResults <T> _create_output_for_shape <T>(short shapeid, ShapeCache shapecacheitems, VASS.Internal.ArraySegmentReader <T> segreader)
        {
            int original_seg_count = segreader.Count;

            if (shapecacheitems == null)
            {
                throw new VisioAutomation.Exceptions.InternalAssertionException();
            }


            var results_rows = new List <SectionShapeRows <T> >(shapecacheitems.Count);

            foreach (var shapecacheitem in shapecacheitems)
            {
                var secindex         = shapecacheitem.SectionQueryColumns.SectionIndex;
                var sectionshaperows = new SectionShapeRows <T>(shapecacheitem.RowCount, shapeid, secindex);
                results_rows.Add(sectionshaperows);

                int num_cols = shapecacheitem.SectionQueryColumns.Count;
                foreach (int row_index in Enumerable.Range(0, shapecacheitem.RowCount))
                {
                    var cells       = segreader.GetNextSegment(num_cols);
                    var sec_res_row = new Row <T>(shapeid, secindex, cells);
                    sectionshaperows.Add(sec_res_row);
                }
            }

            var results = new SectionQueryShapeResults <T>(shapeid, results_rows);

            // the difference in the segment count must match the total number of output cells

            int final_seg_count     = segreader.Count;
            int segment_count_delta = final_seg_count - original_seg_count;
            int total_cell_count    = shapecacheitems.CountCells();

            if (segment_count_delta != total_cell_count)
            {
                throw new Exceptions.InternalAssertionException("Unexpected cursor");
            }

            return(results);
        }
Beispiel #3
0
 public void Add(ShapeCache item)
 {
     this._list.Add(item);
 }