public void DistributeVertical(TargetShapes targets, AlignmentVertical valign) { this._client.Application.AssertApplicationAvailable(); this._client.Document.AssertDocumentAvailable(); int shape_count = targets.SetSelectionGetSelectedCount(this._client); if (shape_count < 1) { return; } IVisio.VisUICmds cmd; switch (valign) { case AlignmentVertical.Top: cmd = IVisio.VisUICmds.visCmdDistributeTop; break; case AlignmentVertical.Center: cmd = IVisio.VisUICmds.visCmdDistributeMiddle; break; case AlignmentVertical.Bottom: cmd = IVisio.VisUICmds.visCmdDistributeBottom; break; default: throw new System.ArgumentOutOfRangeException(); } var application = this._client.Application.Get(); application.DoCmd((short)cmd); }
public virtual void ResetToDefaultConfiguration() { horizontalContentAlignment = AlignmentHorizontal.Left; verticalContentAlignment = AlignmentVertical.Top; horizontalContentOffset = 0; verticalContentOffset = 0; depth = 1; constrainToBounds = false; backgroundType = BackgroundType.SolidColor; backgroundColor = Color.white; backgroundImage = null; backgroundImageStyle = "RoundedBackground"; extendedBackgroundWidth = 0; extendedBackgroundHeight = 0; }
public void AlignVertical(TargetShapes targets, AlignmentVertical align) { this._client.Application.AssertApplicationAvailable(); this._client.Document.AssertDocumentAvailable(); int shape_count = targets.SetSelectionGetSelectedCount(this._client); if (shape_count < 2) { return; } // Set the align enums var halign = IVisio.VisHorizontalAlignTypes.visHorzAlignNone; IVisio.VisVerticalAlignTypes valign; switch (align) { case AlignmentVertical.Top: valign = IVisio.VisVerticalAlignTypes.visVertAlignTop; break; case AlignmentVertical.Center: valign = IVisio.VisVerticalAlignTypes.visVertAlignMiddle; break; case AlignmentVertical.Bottom: valign = IVisio.VisVerticalAlignTypes.visVertAlignBottom; break; default: throw new System.ArgumentOutOfRangeException(); } const bool glue_to_guide = false; // Perform the alignment using (var undoscope = this._client.Application.NewUndoScope("Align Vertical")) { var selection = this._client.Selection.Get(); selection.Align(halign, valign, glue_to_guide); } }
public TextAlignment(AlignmentHorizontal HorizontalAlignment = AlignmentHorizontal.ALIGN_NONE, AlignmentVertical VerticalAlignment = AlignmentVertical.ALIGN_NONE) { this.HorizontalAlignment = HorizontalAlignment; this.VerticalAlignment = VerticalAlignment; }