protected override void ProcessRecord() { var cellmap = CellSRCDictionary.GetCellMapForPages(); if (this.Cells == null || this.Cells.Length < 1 || this.Cells.Contains("*")) { this.Cells = cellmap.GetNames().ToArray(); } Get_VisioPageCell.EnsureEnoughCellNames(this.Cells); var target_page = this.Page ?? this.client.Page.Get(); this.WriteVerbose("Valid Names: " + string.Join(",", cellmap.GetNames())); var query = cellmap.CreateQueryFromCellNames(this.Cells); var surface = new VA.ShapeSheet.ShapeSheetSurface(target_page); var target_shapeids = new[] { surface.Target.Page.PageSheet.ID }; var dt = Helpers.QueryToDataTable(query, this.GetResults, this.ResultType, target_shapeids, surface); this.WriteObject(dt); }
protected override void ProcessRecord() { var cellmap = CellSRCDictionary.GetCellMapForShapes(); if (this.Cells == null || this.Cells.Length < 1 || this.Cells.Contains("*")) { this.Cells = cellmap.GetNames().ToArray(); } Get_VisioPageCell.EnsureEnoughCellNames(this.Cells); var target_shapes = this.Shapes ?? this.client.Selection.GetShapes(); var v = string.Join(",", cellmap.GetNames()); this.WriteVerbose($"Valid Names: {v}"); var query = cellmap.CreateQueryFromCellNames(this.Cells); var surface = this.client.ShapeSheet.GetShapeSheetSurface(); var target_shapeids = target_shapes.Select(s => s.ID).ToList(); var dt = Helpers.QueryToDataTable(query, this.GetResults, this.ResultType, target_shapeids, surface); this.WriteObject(dt); }
protected override void ProcessRecord() { var update = new VisioAutomation.ShapeSheet.Update(); update.BlastGuards = this.BlastGuards; update.TestCircular = this.TestCircular; var cellmap = CellSRCDictionary.GetCellMapForShapes(); var valuemap = new CellValueDictionary(cellmap, this.Hashtable); var target_shapes = this.Shapes ?? this.Client.Selection.GetShapes(); this.DumpValues(valuemap); foreach (var shape in target_shapes) { var id = shape.ID16; foreach (var cellname in valuemap.CellNames) { string cell_value = valuemap[cellname]; var cell_src = valuemap.GetSRC(cellname); update.SetFormulaIgnoreNull(id, cell_src, cell_value); } } var surface = this.Client.ShapeSheet.GetShapeSheetSurface(); this.WriteVerbose("BlastGuards: {0}", this.BlastGuards); this.WriteVerbose("TestCircular: {0}", this.TestCircular); this.WriteVerbose("Number of Shapes : {0}", target_shapes.Count); this.WriteVerbose("Number of Total Updates: {0}", update.Count()); using (var undoscope = this.Client.Application.NewUndoScope("SetShapeCells")) { this.WriteVerbose("Start Update"); update.Execute(surface); this.WriteVerbose("End Update"); } }
protected override void ProcessRecord() { var update = new VisioAutomation.ShapeSheet.Update(); update.BlastGuards = this.BlastGuards; update.TestCircular = this.TestCircular; var target_pages = this.Pages ?? new[] { this.client.Page.Get() }; var cellmap = CellSRCDictionary.GetCellMapForPages(); var valuemap = new CellValueDictionary(cellmap, this.Hashtable); this.DumpValues(valuemap); foreach (var page in target_pages) { var pagesheet = page.PageSheet; foreach (var cellname in valuemap.CellNames) { string cell_value = valuemap[cellname]; var cell_src = valuemap.GetSRC(cellname); update.SetFormulaIgnoreNull(cell_src, cell_value); } this.WriteVerbose("BlastGuards: {0}", this.BlastGuards); this.WriteVerbose("TestCircular: {0}", this.TestCircular); this.WriteVerbose("Number of Shapes : {0}", 1); this.WriteVerbose("Number of Total Updates: {0}", update.Count()); var application = this.client.Application.Get(); using (var undoscope = this.client.Application.NewUndoScope("SetPageCells")) { this.WriteVerbose("Start Update"); update.Execute(pagesheet); this.WriteVerbose("End Update"); } } }