public short Render(IVisio.Shape shape) { short sec_index = ShapeGeometryHelper.AddSection(shape); short row_count = shape.RowCount[sec_index]; var writer = new VisioAutomation.ShapeSheet.Writers.SrcWriter(); var src_nofill = new VA.ShapeSheet.Src(sec_index, 0, ShapeSheet.SrcConstants.GeometryNoFill.Cell); var src_noline = new VA.ShapeSheet.Src(sec_index, 0, ShapeSheet.SrcConstants.GeometryNoLine.Cell); var src_noshow = new VA.ShapeSheet.Src(sec_index, 0, ShapeSheet.SrcConstants.GeometryNoShow.Cell); var src_nosnap = new VA.ShapeSheet.Src(sec_index, 0, ShapeSheet.SrcConstants.GeometryNoSnap.Cell); var src_noquickdrag = new VA.ShapeSheet.Src(sec_index, 0, ShapeSheet.SrcConstants.GeometryNoQuickDrag.Cell); writer.SetValue(src_nofill, this.NoFill); writer.SetValue(src_noline, this.NoLine); writer.SetValue(src_noshow, this.NoShow); writer.SetValue(src_nosnap, this.NoSnap); writer.SetValue(src_noquickdrag, this.NoQuickDrag); foreach (var row in this.Rows) { row.AddTo(shape, writer, row_count, sec_index); row_count++; } writer.Commit(shape, CellValueType.Formula); return(0); }
public static void Delete(IVisio.Shape shape) { int num = shape.GeometryCount; for (int i = num - 1; i >= 0; i--) { ShapeGeometryHelper._delete_section(shape, (short)i); } }
private static void _delete_section(IVisio.Shape shape, short index) { if (shape == null) { throw new System.ArgumentNullException(nameof(shape)); } short target_section_index = ShapeGeometryHelper._get_geometry_section_index(index); shape.DeleteSection(target_section_index); }
public static short AddSection(IVisio.Shape shape) { if (shape == null) { throw new System.ArgumentNullException(nameof(shape)); } int num_geometry_sections = shape.GeometryCount; short new_sec_index = ShapeGeometryHelper._get_geometry_section_index((short)num_geometry_sections); short actual_sec_index = shape.AddSection(new_sec_index); if (actual_sec_index != new_sec_index) { throw new InternalAssertionException(); } short row_index = shape.AddRow(new_sec_index, (short)IVisio.VisRowIndices.visRowComponent, (short)IVisio.VisRowTags.visTagComponent); return(new_sec_index); }