예제 #1
0
        private void addcell(VA.ShapeSheet.Query.CellQuery query, bool switchpar, string cellname)
        {
            var dic = Get_VisioPageCell.GetPageCellDictionary();

            if (switchpar)
            {
                query.Columns.Add(dic[cellname], cellname);
            }
        }
예제 #2
0
        protected override void ProcessRecord()
        {
            var cellmap = VisioScripting.Models.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);
        }
예제 #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);
        }
예제 #4
0
        protected override void ProcessRecord()
        {
            var query = new VisioAutomation.ShapeSheet.Query.CellQuery();

            var target_shapes   = this.Shapes ?? this.client.Selection.GetShapes();
            var target_shapeids = target_shapes.Select(s => s.ID).ToList();

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

            var dic = GetShapeCellDictionary();

            Get_VisioPageCell.SetFromCellNames(query, this.Cells, dic);

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

            this.WriteVerbose("Number of Shapes : {0}", target_shapes.Count);
            this.WriteVerbose("Number of Cells: {0}", query.Columns.Count);

            this.WriteVerbose("Start Query");

            var dt = Helpers.QueryToDataTable(query, this.GetResults, this.ResultType, target_shapeids, surface);

            this.WriteObject(dt);

            this.WriteVerbose("End Query");
        }
예제 #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");
                }
            }
        }