Exemplo n.º 1
0
        public void SetShapeCells(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  = CellSrcDictionary.GetCellMapForShapes();
            var valuemap = new 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");
            }
        }
Exemplo n.º 2
0
        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.ToQuery(this.Cells);
            var surface         = new ShapeSheetSurface(target_page);
            var target_shapeids = new[] { surface.Target.Page.PageSheet.ID };
            var dt = DataTableHelpers.QueryToDataTable(query, this.GetResults, this.ResultType, target_shapeids, surface);

            this.WriteObject(dt);
        }
Exemplo n.º 3
0
        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(string.Format("Valid Names: {0}", v));
            var query           = cellmap.ToQuery(this.Cells);
            var surface         = this.Client.ShapeSheet.GetShapeSheetSurface();
            var target_shapeids = target_shapes.Select(s => s.ID).ToList();
            var dt = DataTableHelpers.QueryToDataTable(query, this.GetResults, this.ResultType, target_shapeids, surface);

            this.WriteObject(dt);
        }