Ejemplo n.º 1
0
        protected override void ProcessRecord()
        {
            var update = new VisioAutomation.ShapeSheet.Update();

            update.BlastGuards  = this.BlastGuards;
            update.TestCircular = this.TestCircular;

            var cellmap  = CellSRCDictionary.GetCellMapForShapes();
            var valuemap = new CellValueDictionary(cellmap, this.Hashtable);

            var target_shapes = this.Shapes ?? this.Client.Selection.GetShapes();

            this.DumpValues(valuemap);

            foreach (var shape in target_shapes)
            {
                var id = shape.ID16;

                foreach (var cellname in valuemap.CellNames)
                {
                    string cell_value = valuemap[cellname];
                    var    cell_src   = valuemap.GetSRC(cellname);
                    update.SetFormulaIgnoreNull(id, cell_src, cell_value);
                }
            }

            var surface = this.Client.ShapeSheet.GetShapeSheetSurface();

            this.WriteVerbose("BlastGuards: {0}", this.BlastGuards);
            this.WriteVerbose("TestCircular: {0}", this.TestCircular);
            this.WriteVerbose("Number of Shapes : {0}", target_shapes.Count);
            this.WriteVerbose("Number of Total Updates: {0}", update.Count());

            using (var undoscope = this.Client.Application.NewUndoScope("SetShapeCells"))
            {
                this.WriteVerbose("Start Update");
                update.Execute(surface);
                this.WriteVerbose("End Update");
            }
        }
        protected override void ProcessRecord()
        {
            var update = new VisioAutomation.ShapeSheet.Update();
            update.BlastGuards = this.BlastGuards;
            update.TestCircular = this.TestCircular;

            var cellmap = CellSRCDictionary.GetCellMapForShapes();
            var valuemap = new CellValueDictionary(cellmap, this.Hashtable);

            var target_shapes = this.Shapes ?? this.client.Selection.GetShapes();

            this.DumpValues(valuemap);

            foreach (var shape in target_shapes)
            {
                var id = shape.ID16;

                foreach (var cellname in valuemap.CellNames)
                {
                    string cell_value = valuemap[cellname];
                    var cell_src = valuemap.GetSRC(cellname);
                    update.SetFormulaIgnoreNull(id,cell_src, cell_value);
                }
            }

            var surface = this.client.ShapeSheet.GetShapeSheetSurface();

            this.WriteVerbose("BlastGuards: {0}", this.BlastGuards);
            this.WriteVerbose("TestCircular: {0}", this.TestCircular);
            this.WriteVerbose("Number of Shapes : {0}", target_shapes.Count);
            this.WriteVerbose("Number of Total Updates: {0}", update.Count());

            using (var undoscope = this.client.Application.NewUndoScope( "SetShapeCells"))
            {
                this.WriteVerbose("Start Update");
                update.Execute(surface);
                this.WriteVerbose("End Update");
            }
        }
        protected override void ProcessRecord()
        {
            var update = new VisioAutomation.ShapeSheet.Update();

            update.BlastGuards  = this.BlastGuards;
            update.TestCircular = this.TestCircular;

            var target_pages = this.Pages ?? new[] { this.client.Page.Get() };

            var cellmap  = CellSRCDictionary.GetCellMapForPages();
            var valuemap = new CellValueDictionary(cellmap, this.Hashtable);

            this.DumpValues(valuemap);

            foreach (var page in target_pages)
            {
                var pagesheet = page.PageSheet;

                foreach (var cellname in valuemap.CellNames)
                {
                    string cell_value = valuemap[cellname];
                    var    cell_src   = valuemap.GetSRC(cellname);
                    update.SetFormulaIgnoreNull(cell_src, cell_value);
                }
                this.WriteVerbose("BlastGuards: {0}", this.BlastGuards);
                this.WriteVerbose("TestCircular: {0}", this.TestCircular);
                this.WriteVerbose("Number of Shapes : {0}", 1);
                this.WriteVerbose("Number of Total Updates: {0}", update.Count());

                var application = this.client.Application.Get();
                using (var undoscope = this.client.Application.NewUndoScope("SetPageCells"))
                {
                    this.WriteVerbose("Start Update");
                    update.Execute(pagesheet);
                    this.WriteVerbose("End Update");
                }
            }
        }
Ejemplo n.º 4
0
        protected override void ProcessRecord()
        {
            var update = new VisioAutomation.ShapeSheet.Update();

            update.BlastGuards  = this.BlastGuards;
            update.TestCircular = this.TestCircular;

            var valuemap = new CellValueMap(Get_VisioShapeCell.GetShapeCellDictionary());

            valuemap.UpdateValueMap(this.Hashtable);
            valuemap.SetIf("Angle", this.Angle);
            valuemap.SetIf("BeginArrow", this.BeginArrow);
            valuemap.SetIf("BeginArrowSize", this.BeginArrowSize);
            valuemap.SetIf("BeginX", this.BeginX);
            valuemap.SetIf("BeginY", this.BeginY);
            valuemap.SetIf("CharCase", this.CharCase);
            valuemap.SetIf("CharColor", this.CharColor);
            valuemap.SetIf("CharColorTransparency", this.CharColorTransparency);
            valuemap.SetIf("CharFont", this.CharFont);
            valuemap.SetIf("CharFontScale", this.CharFontScale);
            valuemap.SetIf("CharLetterspace", this.CharLetterspace);
            valuemap.SetIf("CharSize", this.CharSize);
            valuemap.SetIf("CharStyle", this.CharStyle);
            valuemap.SetIf("EndArrow", this.EndArrow);
            valuemap.SetIf("EndArrowSize", this.EndArrowSize);
            valuemap.SetIf("EndX", this.EndX);
            valuemap.SetIf("EndY", this.EndY);
            valuemap.SetIf("FillBkgnd", this.FillBkgnd);
            valuemap.SetIf("FillBkgndTrans", this.FillBkgndTrans);
            valuemap.SetIf("FillForegnd", this.FillForegnd);
            valuemap.SetIf("FillForegndTrans", this.FillForegndTrans);
            valuemap.SetIf("FillPattern", this.FillPattern);
            valuemap.SetIf("Height", this.Height);
            valuemap.SetIf("HideText", this.HideText);
            valuemap.SetIf("LineCap", this.LineCap);
            valuemap.SetIf("LineColor", this.LineColor);
            valuemap.SetIf("LinePattern", this.LinePattern);
            valuemap.SetIf("LineWeight", this.LineWeight);
            valuemap.SetIf("LockAspect", this.LockAspect);
            valuemap.SetIf("LockBegin", this.LockBegin);
            valuemap.SetIf("LockCalcWH", this.LockCalcWH);
            valuemap.SetIf("LockCrop", this.LockCrop);
            valuemap.SetIf("LockCustProp", this.LockCustProp);
            valuemap.SetIf("LockDelete", this.LockDelete);
            valuemap.SetIf("LockEnd", this.LockEnd);
            valuemap.SetIf("LockFormat", this.LockFormat);
            valuemap.SetIf("LockFromGroupFormat", this.LockFromGroupFormat);
            valuemap.SetIf("LockGroup", this.LockGroup);
            valuemap.SetIf("LockHeight", this.LockHeight);
            valuemap.SetIf("LockMoveX", this.LockMoveX);
            valuemap.SetIf("LockMoveY", this.LockMoveY);
            valuemap.SetIf("LockRotate", this.LockRotate);
            valuemap.SetIf("LockSelect", this.LockSelect);
            valuemap.SetIf("LockTextEdit", this.LockTextEdit);
            valuemap.SetIf("LockThemeColors", this.LockThemeColors);
            valuemap.SetIf("LockThemeEffects", this.LockThemeEffects);
            valuemap.SetIf("LockVtxEdit", this.LockVtxEdit);
            valuemap.SetIf("LockWidth", this.LockWidth);
            valuemap.SetIf("LocPinX", this.LocPinX);
            valuemap.SetIf("LocPinY", this.LocPinY);
            valuemap.SetIf("PinX", this.PinX);
            valuemap.SetIf("PinY", this.PinY);
            valuemap.SetIf("Rounding", this.Rounding);
            valuemap.SetIf("SelectMode", this.SelectMode);
            valuemap.SetIf("ShdwBkgnd", this.ShdwBkgnd);
            valuemap.SetIf("ShdwBkgndTrans", this.ShdwBkgndTrans);
            valuemap.SetIf("ShdwForegnd", this.ShdwForegnd);
            valuemap.SetIf("ShdwForegndTrans", this.ShdwForegndTrans);
            valuemap.SetIf("ShdwObliqueAngle", this.ShdwObliqueAngle);
            valuemap.SetIf("ShdwOffsetX", this.ShdwOffsetX);
            valuemap.SetIf("ShdwOffsetY", this.ShdwOffsetY);
            valuemap.SetIf("ShdwPattern", this.ShdwPattern);
            valuemap.SetIf("ShdwScalefactor", this.ShdwScalefactor);
            valuemap.SetIf("ShdwType", this.ShdwType);
            valuemap.SetIf("TxtAngle", this.TxtAngle);
            valuemap.SetIf("TxtHeight", this.TxtHeight);
            valuemap.SetIf("TxtHeight", this.TxtHeight);
            valuemap.SetIf("TxtLocPinY", this.TxtLocPinY);
            valuemap.SetIf("TxtPinX", this.TxtPinX);
            valuemap.SetIf("TxtPinY", this.TxtPinY);
            valuemap.SetIf("TxtWidth", this.TxtWidth);
            valuemap.SetIf("Width", this.Width);

            var target_shapes = this.Shapes ?? this.client.Selection.GetShapes();

            foreach (var shape in target_shapes)
            {
                var id = shape.ID16;

                foreach (var cellname in valuemap.CellNames)
                {
                    string cell_value = valuemap[cellname];
                    var    cell_src   = valuemap.GetSRC(cellname);
                    update.SetFormulaIgnoreNull(id, cell_src, cell_value);
                }
            }

            var surface = this.client.Draw.GetDrawingSurfaceSafe();

            this.WriteVerbose("BlastGuards: {0}", this.BlastGuards);
            this.WriteVerbose("TestCircular: {0}", this.TestCircular);
            this.WriteVerbose("Number of Shapes : {0}", target_shapes.Count);
            this.WriteVerbose("Number of Total Updates: {0}", update.Count());

            using (var undoscope = new VA.Application.UndoScope(this.client.VisioApplication, "SetShapeCells"))
            {
                this.WriteVerbose("Start Update");
                update.Execute(surface);
                this.WriteVerbose("End Update");
            }
        }
Ejemplo n.º 5
0
        protected override void ProcessRecord()
        {
            var update = new VisioAutomation.ShapeSheet.Update();

            update.BlastGuards  = this.BlastGuards;
            update.TestCircular = this.TestCircular;

            var target_pages = this.Pages ?? new[] { this.client.Page.Get() };

            var valuemap = new CellValueMap(Get_VisioPageCell.GetPageCellDictionary());

            valuemap.UpdateValueMap(this.Hashtable);

            valuemap.SetIf("PageBottomMargin", this.PageBottomMargin);
            valuemap.SetIf("PageHeight", this.PageHeight);
            valuemap.SetIf("PageLeftMargin", this.PageLeftMargin);
            valuemap.SetIf("PageLineJumpDirX", this.PageLineJumpDirX);
            valuemap.SetIf("PageLineJumpDirY", this.PageLineJumpDirY);
            valuemap.SetIf("PageRightMargin", this.PageRightMargin);
            valuemap.SetIf("PageScale", this.PageScale);
            valuemap.SetIf("PageShapeSplit", this.PageShapeSplit);
            valuemap.SetIf("PageTopMargin", this.PageTopMargin);
            valuemap.SetIf("PageWidth", this.PageWidth);
            valuemap.SetIf("CenterX", this.CenterX);
            valuemap.SetIf("CenterY", this.CenterY);
            valuemap.SetIf("PaperKind", this.PaperKind);
            valuemap.SetIf("PrintGrid", this.PrintGrid);
            valuemap.SetIf("PrintPageOrientation", this.PrintPageOrientation);
            valuemap.SetIf("ScaleX", this.ScaleX);
            valuemap.SetIf("ScaleY", this.ScaleY);
            valuemap.SetIf("PaperSource", this.PaperSource);
            valuemap.SetIf("DrawingScale", this.DrawingScale);
            valuemap.SetIf("DrawingScaleType", this.DrawingScaleType);
            valuemap.SetIf("DrawingSizeType", this.DrawingSizeType);
            valuemap.SetIf("InhibitSnap", this.InhibitSnap);
            valuemap.SetIf("ShdwObliqueAngle", this.ShdwObliqueAngle);
            valuemap.SetIf("ShdwOffsetX", this.ShdwOffsetX);
            valuemap.SetIf("ShdwOffsetY", this.ShdwOffsetY);
            valuemap.SetIf("ShdwScaleFactor", this.ShdwScaleFactor);
            valuemap.SetIf("ShdwType", this.ShdwType);
            valuemap.SetIf("UIVisibility", this.UIVisibility);
            valuemap.SetIf("XGridDensity", this.XGridDensity);
            valuemap.SetIf("XGridOrigin", this.XGridOrigin);
            valuemap.SetIf("XGridSpacing", this.XGridSpacing);
            valuemap.SetIf("XRulerDensity", this.XRulerDensity);
            valuemap.SetIf("XRulerOrigin", this.XRulerOrigin);
            valuemap.SetIf("YGridDensity", this.YGridDensity);
            valuemap.SetIf("YGridOrigin", this.YGridOrigin);
            valuemap.SetIf("YGridSpacing", this.YGridSpacing);
            valuemap.SetIf("YRulerDensity", this.YRulerDensity);
            valuemap.SetIf("YRulerOrigin", this.YRulerOrigin);
            valuemap.SetIf("AvenueSizeX", this.AvenueSizeX);
            valuemap.SetIf("AvenueSizeY", this.AvenueSizeY);
            valuemap.SetIf("BlockSizeX", this.BlockSizeX);
            valuemap.SetIf("BlockSizeY", this.BlockSizeY);
            valuemap.SetIf("CtrlAsInput", this.CtrlAsInput);
            valuemap.SetIf("DynamicsOff", this.DynamicsOff);
            valuemap.SetIf("EnableGrid", this.EnableGrid);
            valuemap.SetIf("LineAdjustFrom", this.LineAdjustFrom);
            valuemap.SetIf("LineAdjustTo", this.LineAdjustTo);
            valuemap.SetIf("LineJumpCode", this.LineJumpCode);
            valuemap.SetIf("LineJumpFactorX", this.LineJumpFactorX);
            valuemap.SetIf("LineJumpFactorY", this.LineJumpFactorY);
            valuemap.SetIf("LineJumpStyle", this.LineJumpStyle);
            valuemap.SetIf("LineRouteExt", this.LineRouteExt);
            valuemap.SetIf("LineToLineX", this.LineToLineX);
            valuemap.SetIf("LineToLineY", this.LineToLineY);
            valuemap.SetIf("LineToNodeX", this.LineToNodeX);
            valuemap.SetIf("LineToNodeY", this.LineToNodeY);
            valuemap.SetIf("PageLineJumpDirX", this.PageLineJumpDirX);
            valuemap.SetIf("PageLineJumpDirY", this.PageLineJumpDirY);
            valuemap.SetIf("PageShapeSplit", this.PageShapeSplit);
            valuemap.SetIf("PlaceDepth", this.PlaceDepth);
            valuemap.SetIf("PlaceFlip", this.PlaceFlip);
            valuemap.SetIf("PlaceStyle", this.PlaceStyle);
            valuemap.SetIf("PlowCode", this.PlowCode);
            valuemap.SetIf("ResizePage", this.ResizePage);
            valuemap.SetIf("RouteStyle", this.RouteStyle);
            valuemap.SetIf("AvoidPageBreaks", this.AvoidPageBreaks);
            valuemap.SetIf("DrawingResizeType", this.DrawingResizeType);


            foreach (var page in target_pages)
            {
                var pagesheet = page.PageSheet;

                foreach (var cellname in valuemap.CellNames)
                {
                    string cell_value = valuemap[cellname];
                    var    cell_src   = valuemap.GetSRC(cellname);
                    update.SetFormulaIgnoreNull(cell_src, cell_value);
                }
                this.WriteVerbose("BlastGuards: {0}", this.BlastGuards);
                this.WriteVerbose("TestCircular: {0}", this.TestCircular);
                this.WriteVerbose("Number of Shapes : {0}", 1);
                this.WriteVerbose("Number of Total Updates: {0}", update.Count());
                this.WriteVerbose("Number of Updates per Shape: {0}", update.Count() / 1);

                using (var undoscope = new VA.Application.UndoScope(this.client.VisioApplication, "SetPageCells"))
                {
                    this.WriteVerbose("Start Update");
                    update.Execute(pagesheet);
                    this.WriteVerbose("End Update");
                }
            }
        }
        protected override void ProcessRecord()
        {
            var update = new VisioAutomation.ShapeSheet.Update();
            update.BlastGuards = this.BlastGuards;
            update.TestCircular = this.TestCircular;

            var valuemap = new CellValueMap(Get_VisioShapeCell.GetShapeCellDictionary());
            valuemap.UpdateValueMap(this.Hashtable);
            valuemap.SetIf("Angle", this.Angle);
            valuemap.SetIf("BeginArrow", this.BeginArrow);
            valuemap.SetIf("BeginArrowSize", this.BeginArrowSize);
            valuemap.SetIf("BeginX", this.BeginX);
            valuemap.SetIf("BeginY", this.BeginY);
            valuemap.SetIf("CharCase", this.CharCase);
            valuemap.SetIf("CharColor", this.CharColor);
            valuemap.SetIf("CharColorTransparency", this.CharColorTransparency);
            valuemap.SetIf("CharFont", this.CharFont);
            valuemap.SetIf("CharFontScale", this.CharFontScale);
            valuemap.SetIf("CharLetterspace", this.CharLetterspace);
            valuemap.SetIf("CharSize", this.CharSize);
            valuemap.SetIf("CharStyle", this.CharStyle);
            valuemap.SetIf("EndArrow", this.EndArrow);
            valuemap.SetIf("EndArrowSize", this.EndArrowSize);
            valuemap.SetIf("EndX", this.EndX);
            valuemap.SetIf("EndY", this.EndY);
            valuemap.SetIf("FillBkgnd", this.FillBkgnd);
            valuemap.SetIf("FillBkgndTrans", this.FillBkgndTrans);
            valuemap.SetIf("FillForegnd", this.FillForegnd);
            valuemap.SetIf("FillForegndTrans", this.FillForegndTrans);
            valuemap.SetIf("FillPattern", this.FillPattern);
            valuemap.SetIf("Height", this.Height);
            valuemap.SetIf("HideText", this.HideText);
            valuemap.SetIf("LineCap", this.LineCap);
            valuemap.SetIf("LineColor", this.LineColor);
            valuemap.SetIf("LinePattern", this.LinePattern);
            valuemap.SetIf("LineWeight", this.LineWeight);
            valuemap.SetIf("LockAspect", this.LockAspect);
            valuemap.SetIf("LockBegin", this.LockBegin);
            valuemap.SetIf("LockCalcWH", this.LockCalcWH);
            valuemap.SetIf("LockCrop", this.LockCrop);
            valuemap.SetIf("LockCustProp", this.LockCustProp);
            valuemap.SetIf("LockDelete", this.LockDelete);
            valuemap.SetIf("LockEnd", this.LockEnd);
            valuemap.SetIf("LockFormat", this.LockFormat);
            valuemap.SetIf("LockFromGroupFormat", this.LockFromGroupFormat);
            valuemap.SetIf("LockGroup", this.LockGroup);
            valuemap.SetIf("LockHeight", this.LockHeight);
            valuemap.SetIf("LockMoveX", this.LockMoveX);
            valuemap.SetIf("LockMoveY", this.LockMoveY);
            valuemap.SetIf("LockRotate", this.LockRotate);
            valuemap.SetIf("LockSelect", this.LockSelect);
            valuemap.SetIf("LockTextEdit", this.LockTextEdit);
            valuemap.SetIf("LockThemeColors", this.LockThemeColors);
            valuemap.SetIf("LockThemeEffects", this.LockThemeEffects);
            valuemap.SetIf("LockVtxEdit", this.LockVtxEdit);
            valuemap.SetIf("LockWidth", this.LockWidth);
            valuemap.SetIf("LocPinX", this.LocPinX);
            valuemap.SetIf("LocPinY", this.LocPinY);
            valuemap.SetIf("PinX", this.PinX);
            valuemap.SetIf("PinY", this.PinY);
            valuemap.SetIf("Rounding", this.Rounding);
            valuemap.SetIf("SelectMode", this.SelectMode);
            valuemap.SetIf("ShdwBkgnd", this.ShdwBkgnd);
            valuemap.SetIf("ShdwBkgndTrans", this.ShdwBkgndTrans);
            valuemap.SetIf("ShdwForegnd", this.ShdwForegnd);
            valuemap.SetIf("ShdwForegndTrans", this.ShdwForegndTrans);
            valuemap.SetIf("ShdwObliqueAngle", this.ShdwObliqueAngle);
            valuemap.SetIf("ShdwOffsetX", this.ShdwOffsetX);
            valuemap.SetIf("ShdwOffsetY", this.ShdwOffsetY);
            valuemap.SetIf("ShdwPattern", this.ShdwPattern);
            valuemap.SetIf("ShdwScalefactor", this.ShdwScalefactor);
            valuemap.SetIf("ShdwType", this.ShdwType);
            valuemap.SetIf("TxtAngle", this.TxtAngle);
            valuemap.SetIf("TxtHeight", this.TxtHeight);
            valuemap.SetIf("TxtHeight", this.TxtHeight);
            valuemap.SetIf("TxtLocPinY", this.TxtLocPinY);
            valuemap.SetIf("TxtPinX", this.TxtPinX);
            valuemap.SetIf("TxtPinY", this.TxtPinY);
            valuemap.SetIf("TxtWidth", this.TxtWidth);
            valuemap.SetIf("Width", this.Width);

            var target_shapes = this.Shapes ?? this.client.Selection.GetShapes();

            foreach (var shape in target_shapes)
            {
                var id = shape.ID16;

                foreach (var cellname in valuemap.CellNames)
                {
                    string cell_value = valuemap[cellname];
                    var cell_src = valuemap.GetSRC(cellname);
                    update.SetFormulaIgnoreNull(id,cell_src, cell_value);
                }
            }

            var surface = this.client.Draw.GetDrawingSurfaceSafe();

            this.WriteVerbose("BlastGuards: {0}", this.BlastGuards);
            this.WriteVerbose("TestCircular: {0}", this.TestCircular);
            this.WriteVerbose("Number of Shapes : {0}", target_shapes.Count);
            this.WriteVerbose("Number of Total Updates: {0}", update.Count());

            using (var undoscope = new VA.Application.UndoScope(this.client.VisioApplication, "SetShapeCells"))
            {
                this.WriteVerbose("Start Update");
                update.Execute(surface);
                this.WriteVerbose("End Update");
            }
        }