public void PasteFormat(IVisio.Page page, IList <int> shapeids, FormatPaintCategory paint_category, bool applyformulas) { // Find all the cells that are going to be pasted var matching_cells = this.Cells.Where(c => c.MatchesCategory(paint_category)).ToArray(); // Apply those matched cells to each shape var writer = new SidSrcWriter(); foreach (var shape_id in shapeids) { foreach (var cell in matching_cells) { var sidsrc = new VisioAutomation.ShapeSheet.SidSrc((short)shape_id, cell.Src); var new_formula = applyformulas ? cell.Formula : cell.Result; writer.SetFormula(sidsrc, new_formula); } } writer.Commit(page); }
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); } } } }
public void AddCell(short id, VisioAutomation.ShapeSheet.Src src) { var sidsrc = new VisioAutomation.ShapeSheet.SidSrc(id, src); this.SidSrcStreamBuilder.Add(sidsrc); }