protected override void ProcessRecord()
 {
     if (Count < 0)
     {
         var cells = new VisioPowerShell.Models.ShapeCells();
         this.WriteObject(cells);
     }
     else
     {
         var list_cells = new List <VisioPowerShell.Models.ShapeCells>(this.Count);
         var indices    = Enumerable.Range(0, this.Count);
         var enum_cells = indices.Select(i => new VisioPowerShell.Models.ShapeCells());
         list_cells.AddRange(enum_cells);
         this.WriteObject(list_cells, false);
     }
 }
        protected override void ProcessRecord()
        {
            var target_shapes = this.Shapes ?? this.Client.Selection.GetShapesInSelection();

            var template        = new VisioPowerShell.Models.ShapeCells();
            var celldic         = VisioPowerShell.Models.NameCellDictionary.FromCells(template);
            var cellnames       = celldic.Keys.ToArray();
            var query           = _CreateQuery(celldic, cellnames);
            var surface         = this.Client.ShapeSheet.GetShapeSheetSurface();
            var target_shapeids = target_shapes.Select(s => s.ID).ToList();
            var dt = VisioPowerShell.Models.DataTableHelpers.QueryToDataTable(query, this.OutputType, target_shapeids, surface);

            // Annotate the returned datatable to disambiguate rows
            var shapeid_col = dt.Columns.Add("ShapeID", typeof(System.Int32));

            shapeid_col.SetOrdinal(0);
            for (int row_index = 0; row_index < target_shapeids.Count; row_index++)
            {
                dt.Rows[row_index][shapeid_col.ColumnName] = target_shapeids[row_index];
            }

            this.WriteObject(dt);
        }
Beispiel #3
0
        protected override void ProcessRecord()
        {
            var cells = new VisioPowerShell.Models.ShapeCells();

            this.WriteObject(cells);
        }