public void DistributeHorizontal(TargetShapes targets, AlignmentHorizontal halign) { this._client.Application.AssertApplicationAvailable(); this._client.Document.AssertDocumentAvailable(); int shape_count = targets.SetSelectionGetSelectedCount(this._client); if (shape_count < 1) { return; } IVisio.VisUICmds cmd; switch (halign) { case AlignmentHorizontal.Left: cmd = IVisio.VisUICmds.visCmdDistributeLeft; break; case AlignmentHorizontal.Center: cmd = IVisio.VisUICmds.visCmdDistributeCenter; break; case AlignmentHorizontal.Right: cmd = IVisio.VisUICmds.visCmdDistributeRight; 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 AlignHorizontal(TargetShapes targets, AlignmentHorizontal align) { this._client.Application.AssertApplicationAvailable(); this._client.Document.AssertDocumentAvailable(); int shape_count = targets.SetSelectionGetSelectedCount(this._client); if (shape_count < 2) { return; } IVisio.VisHorizontalAlignTypes halign; var valign = IVisio.VisVerticalAlignTypes.visVertAlignNone; switch (align) { case AlignmentHorizontal.Left: halign = IVisio.VisHorizontalAlignTypes.visHorzAlignLeft; break; case AlignmentHorizontal.Center: halign = IVisio.VisHorizontalAlignTypes.visHorzAlignCenter; break; case AlignmentHorizontal.Right: halign = IVisio.VisHorizontalAlignTypes.visHorzAlignRight; break; default: throw new System.ArgumentOutOfRangeException(); } const bool glue_to_guide = false; using (var undoscope = this._client.Application.NewUndoScope("Align Horizontal")) { 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; }