public void SetShapeCells(VisioScripting.Models.TargetShapeIDs targets, Dictionary <string, string> hashtable, bool blast_guards, bool test_circular) { var writer = new SidSrcWriter(); writer.BlastGuards = blast_guards; writer.TestCircular = test_circular; var cellmap = VisioScripting.Models.CellSrcDictionary.GetCellMapForShapes(); var valuemap = new VisioScripting.Models.CellValueDictionary(cellmap, hashtable); foreach (var shape_id in targets.ShapeIDs) { foreach (var cellname in valuemap.Keys) { string cell_value = valuemap[cellname]; var cell_src = valuemap.GetSrc(cellname); writer.SetFormula((short)shape_id, cell_src, cell_value); } } var surface = this._client.ShapeSheet.GetShapeSheetSurface(); this._client.WriteVerbose("BlastGuards: {0}", blast_guards); this._client.WriteVerbose("TestCircular: {0}", test_circular); this._client.WriteVerbose("Number of Shapes : {0}", targets.ShapeIDs.Count); using (var undoscope = this._client.Application.NewUndoScope("Set Shape Cells")) { this._client.WriteVerbose("Start Update"); writer.Commit(surface); this._client.WriteVerbose("End Update"); } }
protected void DumpValues(VisioScripting.Models.CellValueDictionary cellvalues) { this.WriteVerbose(string.Format("CellValues contains {0} items", cellvalues.Keys.Count)); foreach (var cellname in cellvalues.Keys) { string cell_value = cellvalues[cellname]; this.WriteVerbose("{0} = {1}", cellname, cell_value); } }