public void SetShapeCells(TargetShapeIDs targets, Dictionary <string, string> hashtable, bool blast_guards, bool test_circular)
        {
            var writer = new FormulaWriterSIDSRC();

            writer.BlastGuards  = blast_guards;
            writer.TestCircular = test_circular;

            var cellmap  = VisioAutomation.Scripting.ShapeSheet.CellSRCDictionary.GetCellMapForShapes();
            var valuemap = new VisioAutomation.Scripting.ShapeSheet.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);
            this._client.WriteVerbose("Number of Total Updates: {0}", writer.Count);

            using (var undoscope = this._client.Application.NewUndoScope("Set Shape Cells"))
            {
                this._client.WriteVerbose("Start Update");
                writer.Commit(surface);
                this._client.WriteVerbose("End Update");
            }
        }
예제 #2
0
 protected void DumpValues(VisioAutomation.Scripting.ShapeSheet.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);
     }
 }