684 references to ContentAlignment
PresentationUI (2)
MS\Internal\Documents\Application\DocumentPropertiesDialog.Designer.cs (1)
396this._descriptionLabel.ImageAlign = System.Drawing.ContentAlignment.TopLeft;
MS\Internal\Documents\RMPermissions.Designer.cs (1)
123this.requestFromLabel.TextAlign = System.Drawing.ContentAlignment.MiddleLeft;
System.Drawing (1)
System.Drawing.cs (1)
17[assembly: System.Runtime.CompilerServices.TypeForwardedTo(typeof(System.Drawing.ContentAlignment))]
System.Windows.Forms (241)
System\Drawing\Design\UITypeEditor.cs (1)
54[typeof(ContentAlignment)] = $"System.Drawing.Design.ContentAlignmentEditor, {Assemblies.SystemDrawingDesign}",
System\Windows\Forms\Control.cs (16)
10634protected ContentAlignment RtlTranslateAlignment(ContentAlignment align) 10676protected internal ContentAlignment RtlTranslateContent(ContentAlignment align) 10684case ContentAlignment.TopLeft: 10685return ContentAlignment.TopRight; 10686case ContentAlignment.TopRight: 10687return ContentAlignment.TopLeft; 10695case ContentAlignment.MiddleLeft: 10696return ContentAlignment.MiddleRight; 10697case ContentAlignment.MiddleRight: 10698return ContentAlignment.MiddleLeft; 10706case ContentAlignment.BottomLeft: 10707return ContentAlignment.BottomRight; 10708case ContentAlignment.BottomRight: 10709return ContentAlignment.BottomLeft;
System\Windows\Forms\Controls\Buttons\ButtonBase.cs (9)
21private ContentAlignment _imageAlign = ContentAlignment.MiddleCenter; 22private ContentAlignment _textAlign = ContentAlignment.MiddleCenter; 280ContentAlignment align = RtlTranslateContent(TextAlign); 475[DefaultValue(ContentAlignment.MiddleCenter)] 479public ContentAlignment ImageAlign 728[DefaultValue(ContentAlignment.MiddleCenter)] 732public virtual ContentAlignment TextAlign
System\Windows\Forms\Controls\Buttons\ButtonInternal\ButtonBaseAdapter.cs (4)
579ContentAlignment textAlign, 595CheckAlign = ContentAlignment.TopLeft, 596ImageAlign = ContentAlignment.MiddleCenter, 622CheckAlign = ContentAlignment.TopLeft,
System\Windows\Forms\Controls\Buttons\ButtonInternal\ButtonBaseAdapter.LayoutOptions.cs (30)
35public ContentAlignment CheckAlign { get; set; } 36public ContentAlignment ImageAlign { get; set; } 37public ContentAlignment TextAlign { get; set; } 181CheckAlign == ContentAlignment.MiddleCenter || !LayoutUtils.IsHorizontalAlignment(CheckAlign); 243action[s_combineCheck] = CheckAlign == ContentAlignment.MiddleCenter || !LayoutUtils.IsVerticalAlignment(CheckAlign); 326internal ContentAlignment RtlTranslateContent(ContentAlignment align) 330ContentAlignment[][] mapping = 332[ContentAlignment.TopLeft, ContentAlignment.TopRight], 333[ContentAlignment.MiddleLeft, ContentAlignment.MiddleRight], 334[ContentAlignment.BottomLeft, ContentAlignment.BottomRight], 361ContentAlignment align = RtlTranslateContent(CheckAlign); 396case ContentAlignment.TopLeft: 397case ContentAlignment.MiddleLeft: 398case ContentAlignment.BottomLeft: 408case ContentAlignment.TopRight: 409case ContentAlignment.MiddleRight: 410case ContentAlignment.BottomRight: 419case ContentAlignment.TopCenter: 430case ContentAlignment.BottomCenter: 440case ContentAlignment.MiddleCenter: 451/// For example, <see cref="ContentAlignment.TopLeft"/> maps to <see cref="TextImageRelation.ImageAboveText"/> 469private static TextImageRelation ImageAlignToRelation(ContentAlignment alignment) 472private static TextImageRelation TextAlignToRelation(ContentAlignment alignment) 478ContentAlignment imageAlign = RtlTranslateContent(ImageAlign); 479ContentAlignment textAlign = RtlTranslateContent(TextAlign); 515Rectangle combinedBounds = LayoutUtils.Align(combinedSize, maxCombinedBounds, ContentAlignment.MiddleCenter);
System\Windows\Forms\Controls\Buttons\ButtonInternal\ButtonFlatAdapter.cs (1)
300ContentAlignment textAlign,
System\Windows\Forms\Controls\Buttons\ButtonInternal\ButtonPopupAdapter.cs (1)
157ContentAlignment textAlign,
System\Windows\Forms\Controls\Buttons\ButtonInternal\CheckBoxPopupAdapter.cs (1)
138ContentAlignment textAlign,
System\Windows\Forms\Controls\Buttons\CheckBox.cs (12)
26private const ContentAlignment AnyRight = ContentAlignment.TopRight | ContentAlignment.MiddleRight | ContentAlignment.BottomRight; 28private ContentAlignment _checkAlign = ContentAlignment.MiddleLeft; 49TextAlign = ContentAlignment.MiddleLeft; 132[DefaultValue(ContentAlignment.MiddleLeft)] 134public ContentAlignment CheckAlign 259ContentAlignment align = RtlTranslateContent(CheckAlign); 353[DefaultValue(ContentAlignment.MiddleLeft)] 354public override ContentAlignment TextAlign
System\Windows\Forms\Controls\Buttons\RadioButton.cs (12)
27private const ContentAlignment AnyRight = ContentAlignment.TopRight | ContentAlignment.MiddleRight | ContentAlignment.BottomRight; 33private ContentAlignment _checkAlign = ContentAlignment.MiddleLeft; 48TextAlign = ContentAlignment.MiddleLeft; 123[DefaultValue(ContentAlignment.MiddleLeft)] 125public ContentAlignment CheckAlign 224ContentAlignment align = RtlTranslateContent(CheckAlign); 320[DefaultValue(ContentAlignment.MiddleLeft)] 321public override ContentAlignment TextAlign
System\Windows\Forms\Controls\DataGridView\DataGridViewUtilities.cs (11)
20internal static ContentAlignment ComputeDrawingContentAlignmentForCellStyleAlignment(DataGridViewContentAlignment alignment) => 24DataGridViewContentAlignment.TopLeft => ContentAlignment.TopLeft, 25DataGridViewContentAlignment.TopCenter => ContentAlignment.TopCenter, 26DataGridViewContentAlignment.TopRight => ContentAlignment.TopRight, 27DataGridViewContentAlignment.MiddleLeft => ContentAlignment.MiddleLeft, 28DataGridViewContentAlignment.MiddleCenter => ContentAlignment.MiddleCenter, 29DataGridViewContentAlignment.MiddleRight => ContentAlignment.MiddleRight, 30DataGridViewContentAlignment.BottomLeft => ContentAlignment.BottomLeft, 31DataGridViewContentAlignment.BottomCenter => ContentAlignment.BottomCenter, 32DataGridViewContentAlignment.BottomRight => ContentAlignment.BottomRight, 33_ => ContentAlignment.MiddleCenter,
System\Windows\Forms\Controls\Labels\Label.cs (21)
267case ContentAlignment.TopLeft: 268case ContentAlignment.MiddleLeft: 269case ContentAlignment.BottomLeft: 272case ContentAlignment.TopRight: 273case ContentAlignment.MiddleRight: 274case ContentAlignment.BottomRight: 277case ContentAlignment.TopCenter: 278case ContentAlignment.MiddleCenter: 279case ContentAlignment.BottomCenter: 544[DefaultValue(ContentAlignment.MiddleCenter)] 548public ContentAlignment ImageAlign 550get => Properties.GetValueOrDefault(s_propImageAlign, ContentAlignment.MiddleCenter); 557Properties.AddOrRemoveValue(s_propImageAlign, value, defaultValue: ContentAlignment.MiddleCenter); 690[DefaultValue(ContentAlignment.TopLeft)] 692public virtual ContentAlignment TextAlign 694get => Properties.GetValueOrDefault(s_propTextAlign, ContentAlignment.TopLeft); 701Properties.AddOrRemoveValue(s_propTextAlign, value, defaultValue: ContentAlignment.TopLeft); 871protected Rectangle CalcImageRenderBounds(Image image, Rectangle r, ContentAlignment align) 964private void DrawImage(PaintEventArgs e, Image image, Rectangle r, ContentAlignment align) 980protected void DrawImage(Graphics g, Image image, Rectangle r, ContentAlignment align) 983private void DrawImageInternal(Graphics g, Image image, Rectangle r, ContentAlignment align)
System\Windows\Forms\Controls\Labels\LinkLabel.cs (1)
372internal static Rectangle CalcTextRenderBounds(Rectangle textRect, Rectangle clientRect, ContentAlignment align)
System\Windows\Forms\Controls\PropertyGrid\PropertyGridInternal\GridErrorDialog.cs (1)
147ImageAlign = ContentAlignment.MiddleLeft,
System\Windows\Forms\Controls\ToolStrips\ToolStripControlHost.cs (6)
18private ContentAlignment _controlAlign = ContentAlignment.MiddleCenter; 99[DefaultValue(ContentAlignment.MiddleCenter)] 101public ContentAlignment ControlAlign 259public new ContentAlignment ImageAlign 411public new ContentAlignment TextAlign
System\Windows\Forms\Controls\ToolStrips\ToolStripDropDownMenu.cs (5)
364_checkRectangle = LayoutUtils.Align(maxCheckSize, new Rectangle(nextPoint.X, nextPoint.Y, maxCheckSize.Width, _maxItemSize.Height), ContentAlignment.MiddleCenter); 369_imageRectangle = LayoutUtils.Align(maxImageSize, new Rectangle(nextPoint.X, nextPoint.Y, maxImageSize.Width, _maxItemSize.Height), ContentAlignment.MiddleCenter); 380_checkRectangle = LayoutUtils.Align(maxCheckSize, new Rectangle(nextPoint.X, nextPoint.Y, checkAndImageMarginWidth, _maxItemSize.Height), ContentAlignment.MiddleCenter); 399_checkRectangle = LayoutUtils.Align(LayoutUtils.UnionSizes(maxCheckSize, maxImageSize), new Rectangle(nextPoint.X, nextPoint.Y, checkAndImageMarginWidth - 1, _maxItemSize.Height), ContentAlignment.MiddleCenter); 456_textRectangle.Y = LayoutUtils.VAlign(_textRectangle.Size, new Rectangle(Point.Empty, _maxItemSize), ContentAlignment.MiddleCenter).Y;
System\Windows\Forms\Controls\ToolStrips\ToolStripItem.cs (8)
36private ContentAlignment _imageAlign = ContentAlignment.MiddleCenter; 37private ContentAlignment _textAlign = ContentAlignment.MiddleCenter; 1001[DefaultValue(ContentAlignment.MiddleCenter)] 1005public ContentAlignment ImageAlign 1876[DefaultValue(ContentAlignment.MiddleCenter)] 1880public virtual ContentAlignment TextAlign
System\Windows\Forms\Controls\ToolStrips\ToolStripItem.ToolStripItemInternalLayout.cs (2)
82internal static TextFormatFlags ContentAlignmentToTextFormat(ContentAlignment alignment, bool rightToLeft) 114layoutOptions.CheckAlign = ContentAlignment.TopLeft;
System\Windows\Forms\Controls\ToolStrips\ToolStripItemTextRenderEventArgs.cs (1)
49ContentAlignment textAlign)
System\Windows\Forms\Controls\ToolStrips\ToolStripMenuItem.cs (4)
991renderer.DrawItemText(new ToolStripItemTextRenderEventArgs(g, this, Text, InternalLayout.TextRectangle, textColor, Font, (rightToLeft) ? ContentAlignment.MiddleRight : ContentAlignment.MiddleLeft)); 1000renderer.DrawItemText(new ToolStripItemTextRenderEventArgs(g, this, GetShortcutText(), InternalLayout.TextRectangle, textColor, Font, (rightToLeft) ? ContentAlignment.MiddleLeft : ContentAlignment.MiddleRight));
System\Windows\Forms\Controls\ToolStrips\ToolStripMenuItem.ToolStripMenuItemInternalLayout.cs (2)
74arrowRect.Y = LayoutUtils.VAlign(arrowRect.Size, _ownerItem.ClientBounds, ContentAlignment.MiddleCenter).Y; 130imageRect.Y = LayoutUtils.VAlign(imageRect.Size, _ownerItem.ClientBounds, ContentAlignment.MiddleCenter).Y;
System\Windows\Forms\Controls\ToolStrips\ToolStripScrollButton.cs (1)
42ImageAlign = ContentAlignment.MiddleCenter,
System\Windows\Forms\Controls\ToolStrips\ToolStripSeparator.cs (2)
114public new ContentAlignment ImageAlign 211public new ContentAlignment TextAlign
System\Windows\Forms\Dialogs\ThreadExceptionDialog.cs (1)
304button.ImageAlign = ContentAlignment.MiddleLeft;
System\Windows\Forms\Internal\WinFormsUtils.cs (24)
13public const ContentAlignment AnyRightAlign = ContentAlignment.TopRight | ContentAlignment.MiddleRight | ContentAlignment.BottomRight; 14public const ContentAlignment AnyLeftAlign = ContentAlignment.TopLeft | ContentAlignment.MiddleLeft | ContentAlignment.BottomLeft; 15public const ContentAlignment AnyTopAlign = ContentAlignment.TopLeft | ContentAlignment.TopCenter | ContentAlignment.TopRight; 16public const ContentAlignment AnyBottomAlign = ContentAlignment.BottomLeft | ContentAlignment.BottomCenter | ContentAlignment.BottomRight; 17public const ContentAlignment AnyMiddleAlign = ContentAlignment.MiddleLeft | ContentAlignment.MiddleCenter | ContentAlignment.MiddleRight; 18public const ContentAlignment AnyCenterAlign = ContentAlignment.TopCenter | ContentAlignment.MiddleCenter | ContentAlignment.BottomCenter;
System\Windows\Forms\Layout\CommonProperties.cs (2)
26internal const ContentAlignment DefaultAlignment = ContentAlignment.TopLeft;
System\Windows\Forms\Layout\LayoutUtils.cs (42)
18public const ContentAlignment AnyTop = ContentAlignment.TopLeft | ContentAlignment.TopCenter | ContentAlignment.TopRight; 19public const ContentAlignment AnyBottom = ContentAlignment.BottomLeft | ContentAlignment.BottomCenter | ContentAlignment.BottomRight; 20public const ContentAlignment AnyLeft = ContentAlignment.TopLeft | ContentAlignment.MiddleLeft | ContentAlignment.BottomLeft; 21public const ContentAlignment AnyRight = ContentAlignment.TopRight | ContentAlignment.MiddleRight | ContentAlignment.BottomRight; 22public const ContentAlignment AnyCenter = ContentAlignment.TopCenter | ContentAlignment.MiddleCenter | ContentAlignment.BottomCenter; 23public const ContentAlignment AnyMiddle = ContentAlignment.MiddleLeft | ContentAlignment.MiddleCenter | ContentAlignment.MiddleRight; 72public static int ContentAlignmentToIndex(ContentAlignment alignment) 100Debug.Assert(result != 0x00 || alignment == ContentAlignment.TopLeft, "Error detected in ContentAlignmentToIndex."); 101Debug.Assert(result != 0x01 || alignment == ContentAlignment.TopCenter, "Error detected in ContentAlignmentToIndex."); 102Debug.Assert(result != 0x02 || alignment == ContentAlignment.TopRight, "Error detected in ContentAlignmentToIndex."); 104Debug.Assert(result != 0x04 || alignment == ContentAlignment.MiddleLeft, "Error detected in ContentAlignmentToIndex."); 105Debug.Assert(result != 0x05 || alignment == ContentAlignment.MiddleCenter, "Error detected in ContentAlignmentToIndex."); 106Debug.Assert(result != 0x06 || alignment == ContentAlignment.MiddleRight, "Error detected in ContentAlignmentToIndex."); 108Debug.Assert(result != 0x08 || alignment == ContentAlignment.BottomLeft, "Error detected in ContentAlignmentToIndex."); 109Debug.Assert(result != 0x09 || alignment == ContentAlignment.BottomCenter, "Error detected in ContentAlignmentToIndex."); 110Debug.Assert(result != 0x0A || alignment == ContentAlignment.BottomRight, "Error detected in ContentAlignmentToIndex."); 285public static Rectangle Align(Size alignThis, Rectangle withinThis, ContentAlignment align) 306private static Rectangle HAlign(Size alignThis, Rectangle withinThis, ContentAlignment align) 338public static Rectangle VAlign(Size alignThis, Rectangle withinThis, ContentAlignment align) 465public static bool IsHorizontalAlignment(ContentAlignment align) 476public static bool IsVerticalAlignment(ContentAlignment align) 478Debug.Assert(align != ContentAlignment.MiddleCenter, "Result is ambiguous with an alignment of MiddleCenter."); 479return (align & (ContentAlignment.TopCenter | ContentAlignment.BottomCenter)) != 0;
System\Windows\Forms\Printing\PrintControllerWithStatusDialog.StatusDialog.cs (1)
39TextAlign = ContentAlignment.MiddleCenter,
System\Windows\Forms\Rendering\ControlPaint.cs (19)
57private const ContentAlignment AnyRight 58= ContentAlignment.TopRight | ContentAlignment.MiddleRight | ContentAlignment.BottomRight; 59private const ContentAlignment AnyBottom 60= ContentAlignment.BottomLeft | ContentAlignment.BottomCenter | ContentAlignment.BottomRight; 61private const ContentAlignment AnyCenter 62= ContentAlignment.TopCenter | ContentAlignment.MiddleCenter | ContentAlignment.BottomCenter; 63private const ContentAlignment AnyMiddle 64= ContentAlignment.MiddleLeft | ContentAlignment.MiddleCenter | ContentAlignment.MiddleRight; 2557internal static TextFormatFlags ConvertAlignmentToTextFormat(ContentAlignment alignment) 2588ContentAlignment textAlign, 2642ContentAlignment alignment,
System.Windows.Forms.Design (54)
System\ComponentModel\Design\DesignerActionPanel.CheckBoxPropertyLine.cs (2)
21CheckAlign = ContentAlignment.MiddleLeft, 22TextAlign = ContentAlignment.MiddleLeft,
System\ComponentModel\Design\DesignerActionPanel.MethodLine.cs (1)
26TextAlign = ContentAlignment.MiddleLeft,
System\ComponentModel\Design\DesignerActionPanel.PanelHeaderLine.cs (2)
27TextAlign = ContentAlignment.MiddleLeft, 35TextAlign = ContentAlignment.MiddleLeft,
System\ComponentModel\Design\DesignerActionPanel.TextBoxPropertyLine.cs (2)
28TextAlign = ContentAlignment.MiddleLeft, 37TextAlign = ContentAlignment.TopLeft,
System\ComponentModel\Design\DesignerActionPanel.TextLine.cs (1)
24TextAlign = ContentAlignment.MiddleLeft,
System\Drawing\Design\ContentAlignmentEditor.ContentUI.cs (21)
30private ContentAlignment Align 36return ContentAlignment.TopLeft; 40return ContentAlignment.TopCenter; 44return ContentAlignment.TopRight; 48return ContentAlignment.MiddleLeft; 52return ContentAlignment.MiddleCenter; 56return ContentAlignment.MiddleRight; 60return ContentAlignment.BottomLeft; 64return ContentAlignment.BottomCenter; 68return ContentAlignment.BottomRight; 75case ContentAlignment.TopLeft: 78case ContentAlignment.TopCenter: 81case ContentAlignment.TopRight: 84case ContentAlignment.MiddleLeft: 87case ContentAlignment.MiddleCenter: 90case ContentAlignment.MiddleRight: 93case ContentAlignment.BottomLeft: 96case ContentAlignment.BottomCenter: 99case ContentAlignment.BottomRight: 453=> Align = Value is ContentAlignment contentAligment ? contentAligment : ContentAlignment.MiddleLeft;
System\Windows\Forms\Design\ButtonBaseDesigner.cs (5)
47ContentAlignment alignment = ContentAlignment.MiddleCenter; 103private static int CheckboxBaselineOffset(ContentAlignment alignment, FlatStyle flatStyle) 159private static int RadiobuttonBaselineOffset(ContentAlignment alignment, FlatStyle flatStyle) 190private static int DefaultBaselineOffset(ContentAlignment alignment, FlatStyle flatStyle)
System\Windows\Forms\Design\ComboBoxDesigner.cs (1)
33int baseline = DesignerUtils.GetTextBaseline(Control, Drawing.ContentAlignment.TopLeft);
System\Windows\Forms\Design\DateTimePickerDesigner.cs (1)
27int baseline = DesignerUtils.GetTextBaseline(Control, ContentAlignment.MiddleLeft);
System\Windows\Forms\Design\DesignBindingPicker.cs (4)
150TextAlign = ContentAlignment.MiddleLeft, 189TextAlign = ContentAlignment.TopLeft, 277TextAlign = ContentAlignment.MiddleLeft, 321TextAlign = ContentAlignment.TopLeft,
System\Windows\Forms\Design\DesignerUtils.cs (9)
107public const ContentAlignment AnyTopAlignment = ContentAlignment.TopLeft | ContentAlignment.TopCenter | ContentAlignment.TopRight; 108public const ContentAlignment AnyMiddleAlignment = ContentAlignment.MiddleLeft | ContentAlignment.MiddleCenter | ContentAlignment.MiddleRight; 524public static unsafe int GetTextBaseline(Control ctrl, ContentAlignment alignment)
System\Windows\Forms\Design\LabelDesigner.cs (3)
31ContentAlignment alignment = ContentAlignment.TopLeft; 97private static int LabelBaselineOffset(ContentAlignment alignment, BorderStyle borderStyle)
System\Windows\Forms\Design\TextBoxBaseDesigner.cs (1)
29int baseline = DesignerUtils.GetTextBaseline(Control, Drawing.ContentAlignment.TopLeft);
System\Windows\Forms\Design\UpDownBaseDesigner.cs (1)
43int baseline = DesignerUtils.GetTextBaseline(Control, Drawing.ContentAlignment.TopLeft);
System.Windows.Forms.Design.Tests (17)
EnsureEditorsTests.cs (1)
51[InlineData(typeof(ContentAlignment), typeof(ContentAlignmentEditor))]
System\Windows\Forms\Design\DesignerUtilsTests.cs (14)
551[InlineData(100, 50, "Arial", 10, ContentAlignment.TopLeft, 14)] 552[InlineData(100, 50, "Arial", 10, ContentAlignment.TopCenter, 14)] 553[InlineData(100, 50, "Arial", 10, ContentAlignment.TopRight, 14)] 554[InlineData(100, 50, "Arial", 10, ContentAlignment.MiddleLeft, 31)] 555[InlineData(100, 50, "Arial", 10, ContentAlignment.MiddleCenter, 31)] 556[InlineData(100, 50, "Arial", 10, ContentAlignment.MiddleRight, 31)] 557[InlineData(100, 50, "Arial", 10, ContentAlignment.BottomLeft, 48)] 558[InlineData(100, 50, "Arial", 10, ContentAlignment.BottomCenter, 48)] 559[InlineData(100, 50, "Arial", 10, ContentAlignment.BottomRight, 48)] 560[InlineData(200, 100, "Times New Roman", 12, ContentAlignment.TopLeft, 16)] 561[InlineData(200, 100, "Times New Roman", 12, ContentAlignment.MiddleCenter, 57)] 562[InlineData(200, 100, "Times New Roman", 12, ContentAlignment.BottomRight, 97)] 564int width, int height, string fontFamily, float fontSize, ContentAlignment alignment, int expectedBaseline) 581Action action = () => DesignerUtils.GetTextBaseline(null!, ContentAlignment.TopLeft);
System\Windows\Forms\Design\TextBoxBaseDesignerTests.cs (1)
59int expectedBaseline = DesignerUtils.GetTextBaseline(_textbox, Drawing.ContentAlignment.TopLeft) + expectedBaselineOffset;
System\Windows\Forms\Design\UpDownBaseDesignerTests.cs (1)
58int expectedBaseline = DesignerUtils.GetTextBaseline(_numericUpDown, Drawing.ContentAlignment.TopLeft) + expectedBaselineOffset;
System.Windows.Forms.Tests (365)
System\Windows\Forms\ButtonBaseTests.cs (66)
76Assert.Equal(ContentAlignment.MiddleCenter, control.ImageAlign); 113Assert.Equal(ContentAlignment.MiddleCenter, control.TextAlign); 184foreach (ContentAlignment textAlign in Enum.GetValues(typeof(ContentAlignment))) 192yield return new object[] { FlatStyle.System, RightToLeft.Yes, ContentAlignment.BottomLeft, 0x56012A00, 0x6000 }; 193yield return new object[] { FlatStyle.System, RightToLeft.Yes, ContentAlignment.BottomCenter, 0x56012B00, 0x6000 }; 194yield return new object[] { FlatStyle.System, RightToLeft.Yes, ContentAlignment.BottomRight, 0x56012900, 0x6000 }; 195yield return new object[] { FlatStyle.System, RightToLeft.Yes, ContentAlignment.MiddleLeft, 0x56012E00, 0x6000 }; 196yield return new object[] { FlatStyle.System, RightToLeft.Yes, ContentAlignment.MiddleCenter, 0x56012F00, 0x6000 }; 197yield return new object[] { FlatStyle.System, RightToLeft.Yes, ContentAlignment.MiddleRight, 0x56012D00, 0x6000 }; 198yield return new object[] { FlatStyle.System, RightToLeft.Yes, ContentAlignment.TopLeft, 0x56012600, 0x6000 }; 199yield return new object[] { FlatStyle.System, RightToLeft.Yes, ContentAlignment.TopCenter, 0x56012700, 0x6000 }; 200yield return new object[] { FlatStyle.System, RightToLeft.Yes, ContentAlignment.TopRight, 0x56012500, 0x6000 }; 202yield return new object[] { FlatStyle.System, RightToLeft.No, ContentAlignment.BottomLeft, 0x56012900, 0 }; 203yield return new object[] { FlatStyle.System, RightToLeft.No, ContentAlignment.BottomCenter, 0x56012B00, 0 }; 204yield return new object[] { FlatStyle.System, RightToLeft.No, ContentAlignment.BottomRight, 0x56012A00, 0 }; 205yield return new object[] { FlatStyle.System, RightToLeft.No, ContentAlignment.MiddleLeft, 0x56012D00, 0 }; 206yield return new object[] { FlatStyle.System, RightToLeft.No, ContentAlignment.MiddleCenter, 0x56012F00, 0 }; 207yield return new object[] { FlatStyle.System, RightToLeft.No, ContentAlignment.MiddleRight, 0x56012E00, 0 }; 208yield return new object[] { FlatStyle.System, RightToLeft.No, ContentAlignment.TopLeft, 0x56012500, 0 }; 209yield return new object[] { FlatStyle.System, RightToLeft.No, ContentAlignment.TopCenter, 0x56012700, 0 }; 210yield return new object[] { FlatStyle.System, RightToLeft.No, ContentAlignment.TopRight, 0x56012600, 0 }; 212yield return new object[] { FlatStyle.System, RightToLeft.Inherit, ContentAlignment.BottomLeft, 0x56012900, 0 }; 213yield return new object[] { FlatStyle.System, RightToLeft.Inherit, ContentAlignment.BottomCenter, 0x56012B00, 0 }; 214yield return new object[] { FlatStyle.System, RightToLeft.Inherit, ContentAlignment.BottomRight, 0x56012A00, 0 }; 215yield return new object[] { FlatStyle.System, RightToLeft.Inherit, ContentAlignment.MiddleLeft, 0x56012D00, 0 }; 216yield return new object[] { FlatStyle.System, RightToLeft.Inherit, ContentAlignment.MiddleCenter, 0x56012F00, 0 }; 217yield return new object[] { FlatStyle.System, RightToLeft.Inherit, ContentAlignment.MiddleRight, 0x56012E00, 0 }; 218yield return new object[] { FlatStyle.System, RightToLeft.Inherit, ContentAlignment.TopLeft, 0x56012500, 0 }; 219yield return new object[] { FlatStyle.System, RightToLeft.Inherit, ContentAlignment.TopCenter, 0x56012700, 0 }; 220yield return new object[] { FlatStyle.System, RightToLeft.Inherit, ContentAlignment.TopRight, 0x56012600, 0 }; 225public void ButtonBase_CreateParams_GetTextAlign_ReturnsExpected(FlatStyle flatStyle, RightToLeft rightToLeft, ContentAlignment textAlign, int expectedStyle, int expectedExStyle) 1843foreach (ContentAlignment value in Enum.GetValues(typeof(ContentAlignment))) 1852public void ButtonBase_ImageAlign_Set_GetReturnsExpected(bool autoSize, ContentAlignment value) 1875foreach (ContentAlignment value in Enum.GetValues(typeof(ContentAlignment))) 1877int expectedCallCount = value == ContentAlignment.MiddleCenter ? 0 : 1; 1885public void ButtonBase_ImageAlign_SetWithParent_GetReturnsExpected(bool autoSize, ContentAlignment value, int expectedParentLayoutCallCount) 1933foreach (ContentAlignment value in Enum.GetValues(typeof(ContentAlignment))) 1935int expectedCallCount = value == ContentAlignment.MiddleCenter ? 0 : 1; 1943public void ButtonBase_ImageAlign_SetWithHandle_GetReturnsExpected(bool autoSize, ContentAlignment value, int expectedInvalidatedCallCount) 1979foreach (ContentAlignment value in Enum.GetValues(typeof(ContentAlignment))) 1981int expectedCallCount = value == ContentAlignment.MiddleCenter ? 0 : 1; 1989public void ButtonBase_ImageAlign_SetWithParentWithHandle_GetReturnsExpected(bool autoSize, ContentAlignment value, int expectedParentLayoutCallCount, int expectedInvalidatedCallCount) 2048[InvalidEnumData<ContentAlignment>] 2049public void ButtonBase_ImageAlign_SetInvalid_ThrowsInvalidEnumArgumentException(ContentAlignment value) 3268foreach (ContentAlignment value in Enum.GetValues(typeof(ContentAlignment))) 3278public void ButtonBase_TextAlign_Set_GetReturnsExpected(bool autoSize, FlatStyle flatStyle, ContentAlignment value) 3304foreach (ContentAlignment value in Enum.GetValues(typeof(ContentAlignment))) 3306int expectedCallCount = value == ContentAlignment.MiddleCenter ? 0 : 1; 3315public void ButtonBase_TextAlign_SetWithParent_GetReturnsExpected(bool autoSize, FlatStyle flatStyle, ContentAlignment value, int expectedParentLayoutCallCount) 3364foreach (ContentAlignment value in Enum.GetValues(typeof(ContentAlignment))) 3366int expectedCallCount = value == ContentAlignment.MiddleCenter ? 0 : 1; 3377public void ButtonBase_TextAlign_SetWithHandle_GetReturnsExpected(bool autoSize, FlatStyle flatStyle, ContentAlignment value, int expectedInvalidatedCallCount, int expectedStyleChangedCallCount) 3414foreach (ContentAlignment value in Enum.GetValues(typeof(ContentAlignment))) 3416int expectedCallCount = value == ContentAlignment.MiddleCenter ? 0 : 1; 3431public void ButtonBase_TextAlign_SetWithParentWithHandle_GetReturnsExpected(bool autoSize, FlatStyle flatStyle, ContentAlignment value, int expectedParentLayoutCallCount, int expectedInvalidatedCallCount, int expectedStyleChangedCallCount) 3491[InvalidEnumData<ContentAlignment>] 3492public void ButtonBase_TextAlign_SetInvalidValue_ThrowsInvalidEnumArgumentException(ContentAlignment value)
System\Windows\Forms\ButtonFlatAdapterTests.cs (4)
167ContentAlignment textAlign = ContentAlignment.TopLeft; 215ContentAlignment textAlign = ContentAlignment.TopLeft;
System\Windows\Forms\ButtonPopupAdapterTests.cs (4)
92ContentAlignment textAlign = ContentAlignment.MiddleCenter; 125ContentAlignment textAlign = ContentAlignment.TopLeft;
System\Windows\Forms\ButtonTests.cs (32)
79Assert.Equal(ContentAlignment.MiddleCenter, control.ImageAlign); 111Assert.Equal(ContentAlignment.MiddleCenter, control.TextAlign); 206foreach (ContentAlignment textAlign in Enum.GetValues(typeof(ContentAlignment))) 214yield return new object[] { FlatStyle.System, RightToLeft.Yes, ContentAlignment.BottomLeft, 0x56012A00, 0x6000 }; 215yield return new object[] { FlatStyle.System, RightToLeft.Yes, ContentAlignment.BottomCenter, 0x56012B00, 0x6000 }; 216yield return new object[] { FlatStyle.System, RightToLeft.Yes, ContentAlignment.BottomRight, 0x56012900, 0x6000 }; 217yield return new object[] { FlatStyle.System, RightToLeft.Yes, ContentAlignment.MiddleLeft, 0x56012E00, 0x6000 }; 218yield return new object[] { FlatStyle.System, RightToLeft.Yes, ContentAlignment.MiddleCenter, 0x56012F00, 0x6000 }; 219yield return new object[] { FlatStyle.System, RightToLeft.Yes, ContentAlignment.MiddleRight, 0x56012D00, 0x6000 }; 220yield return new object[] { FlatStyle.System, RightToLeft.Yes, ContentAlignment.TopLeft, 0x56012600, 0x6000 }; 221yield return new object[] { FlatStyle.System, RightToLeft.Yes, ContentAlignment.TopCenter, 0x56012700, 0x6000 }; 222yield return new object[] { FlatStyle.System, RightToLeft.Yes, ContentAlignment.TopRight, 0x56012500, 0x6000 }; 224yield return new object[] { FlatStyle.System, RightToLeft.No, ContentAlignment.BottomLeft, 0x56012900, 0 }; 225yield return new object[] { FlatStyle.System, RightToLeft.No, ContentAlignment.BottomCenter, 0x56012B00, 0 }; 226yield return new object[] { FlatStyle.System, RightToLeft.No, ContentAlignment.BottomRight, 0x56012A00, 0 }; 227yield return new object[] { FlatStyle.System, RightToLeft.No, ContentAlignment.MiddleLeft, 0x56012D00, 0 }; 228yield return new object[] { FlatStyle.System, RightToLeft.No, ContentAlignment.MiddleCenter, 0x56012F00, 0 }; 229yield return new object[] { FlatStyle.System, RightToLeft.No, ContentAlignment.MiddleRight, 0x56012E00, 0 }; 230yield return new object[] { FlatStyle.System, RightToLeft.No, ContentAlignment.TopLeft, 0x56012500, 0 }; 231yield return new object[] { FlatStyle.System, RightToLeft.No, ContentAlignment.TopCenter, 0x56012700, 0 }; 232yield return new object[] { FlatStyle.System, RightToLeft.No, ContentAlignment.TopRight, 0x56012600, 0 }; 234yield return new object[] { FlatStyle.System, RightToLeft.Inherit, ContentAlignment.BottomLeft, 0x56012900, 0 }; 235yield return new object[] { FlatStyle.System, RightToLeft.Inherit, ContentAlignment.BottomCenter, 0x56012B00, 0 }; 236yield return new object[] { FlatStyle.System, RightToLeft.Inherit, ContentAlignment.BottomRight, 0x56012A00, 0 }; 237yield return new object[] { FlatStyle.System, RightToLeft.Inherit, ContentAlignment.MiddleLeft, 0x56012D00, 0 }; 238yield return new object[] { FlatStyle.System, RightToLeft.Inherit, ContentAlignment.MiddleCenter, 0x56012F00, 0 }; 239yield return new object[] { FlatStyle.System, RightToLeft.Inherit, ContentAlignment.MiddleRight, 0x56012E00, 0 }; 240yield return new object[] { FlatStyle.System, RightToLeft.Inherit, ContentAlignment.TopLeft, 0x56012500, 0 }; 241yield return new object[] { FlatStyle.System, RightToLeft.Inherit, ContentAlignment.TopCenter, 0x56012700, 0 }; 242yield return new object[] { FlatStyle.System, RightToLeft.Inherit, ContentAlignment.TopRight, 0x56012600, 0 }; 247public void Button_CreateParams_GetTextAlign_ReturnsExpected(FlatStyle flatStyle, RightToLeft rightToLeft, ContentAlignment textAlign, int expectedStyle, int expectedExStyle)
System\Windows\Forms\CheckBoxPopupAdapterTests.cs (3)
93[InlineData(true, 11, 50, 20, 2, false, "First Test", true, ContentAlignment.MiddleLeft, RightToLeft.No)] 94[InlineData(false, 15, 100, 40, 4, true, "Sec Test", false, ContentAlignment.TopRight, RightToLeft.Yes)] 104ContentAlignment textAlign,
System\Windows\Forms\CheckBoxTests.cs (11)
44Assert.Equal(ContentAlignment.MiddleLeft, control.CheckAlign); 80Assert.Equal(ContentAlignment.MiddleCenter, control.ImageAlign); 113Assert.Equal(ContentAlignment.MiddleLeft, control.TextAlign); 186[EnumData<ContentAlignment>] 187public void CheckBox_CheckAlign_Set_GetReturnsExpected(ContentAlignment value) 203[InvalidEnumData<ContentAlignment>] 204public void CheckBox_CheckAlign_SetInvalidValue_ThrowsInvalidEnumArgumentException(ContentAlignment value) 423[EnumData<ContentAlignment>] 424public void CheckBox_TextAlign_Set_GetReturnsExpected(ContentAlignment value) 440[InvalidEnumData<ContentAlignment>] 441public void CheckBox_TextAlign_SetInvalidValue_ThrowsInvalidEnumArgumentException(ContentAlignment value)
System\Windows\Forms\ControlTests.cs (4)
1418public new ContentAlignment RtlTranslateAlignment(ContentAlignment align) => base.RtlTranslateAlignment(align); 1420public new ContentAlignment RtlTranslateContent(ContentAlignment align) => base.RtlTranslateContent(align);
System\Windows\Forms\ControlTests.Methods.cs (24)
6828public void Control_RtlTranslateAlignment_InvokeContentAlignment_ReturnsExpected(RightToLeft rightToLeft, ContentAlignment align, ContentAlignment expected) 6876foreach (ContentAlignment align in Enum.GetValues(typeof(ContentAlignment))) 6882yield return new object[] { RightToLeft.Yes, ContentAlignment.BottomCenter, ContentAlignment.BottomCenter }; 6883yield return new object[] { RightToLeft.Yes, ContentAlignment.BottomLeft, ContentAlignment.BottomRight }; 6884yield return new object[] { RightToLeft.Yes, ContentAlignment.BottomRight, ContentAlignment.BottomLeft }; 6885yield return new object[] { RightToLeft.Yes, ContentAlignment.MiddleCenter, ContentAlignment.MiddleCenter }; 6886yield return new object[] { RightToLeft.Yes, ContentAlignment.MiddleLeft, ContentAlignment.MiddleRight }; 6887yield return new object[] { RightToLeft.Yes, ContentAlignment.MiddleRight, ContentAlignment.MiddleLeft }; 6888yield return new object[] { RightToLeft.Yes, ContentAlignment.TopCenter, ContentAlignment.TopCenter }; 6889yield return new object[] { RightToLeft.Yes, ContentAlignment.TopLeft, ContentAlignment.TopRight }; 6890yield return new object[] { RightToLeft.Yes, ContentAlignment.TopRight, ContentAlignment.TopLeft }; 6895public void Control_RtlTranslateContent_Invoke_ReturnsExpected(RightToLeft rightToLeft, ContentAlignment align, ContentAlignment expected)
System\Windows\Forms\LabelTests.cs (23)
72Assert.Equal(ContentAlignment.MiddleCenter, control.ImageAlign); 107Assert.Equal(ContentAlignment.TopLeft, control.TextAlign); 244[InvalidEnumData<ContentAlignment>] 245public void Label_ImageAlign_SetInvalidValue_ThrowsInvalidEnumArgumentException(ContentAlignment value) 255foreach (ContentAlignment value in Enum.GetValues(typeof(ContentAlignment))) 264public void Label_ImageAlign_Set_GetReturnsExpected(bool autoSize, ContentAlignment value) 383[InlineData(ContentAlignment.TopLeft)] 384[InlineData(ContentAlignment.TopCenter)] 385[InlineData(ContentAlignment.TopRight)] 386[InlineData(ContentAlignment.MiddleLeft)] 387[InlineData(ContentAlignment.MiddleCenter)] 388[InlineData(ContentAlignment.MiddleRight)] 389[InlineData(ContentAlignment.BottomLeft)] 390[InlineData(ContentAlignment.BottomCenter)] 391[InlineData(ContentAlignment.BottomRight)] 392public void Label_TextAlign_Set_GetReturnsExpected(ContentAlignment alignment) 405label.TextAlign = ContentAlignment.TopLeft; 410label.TextAlign = ContentAlignment.TopLeft; 418label.TextAlign = ContentAlignment.TopLeft; 423label.TextAlign = ContentAlignment.MiddleCenter; 840label.TextAlign = ContentAlignment.BottomCenter; 844label.TextAlign = ContentAlignment.BottomLeft;
System\Windows\Forms\RadioButtonBaseAdapterTests.cs (2)
309radioButton.CheckAlign = ContentAlignment.BottomRight; 312layoutOptions.CheckAlign.Should().Be(ContentAlignment.BottomRight);
System\Windows\Forms\RadioButtonTests.cs (25)
44Assert.Equal(ContentAlignment.MiddleLeft, control.CheckAlign); 79Assert.Equal(ContentAlignment.MiddleCenter, control.ImageAlign); 111Assert.Equal(ContentAlignment.MiddleLeft, control.TextAlign); 170[InvalidEnumData<ContentAlignment>] 171public void RadioButton_CheckAlign_SetInvalidValue_ThrowsInvalidEnumArgumentException(ContentAlignment value) 177public static TheoryData<ContentAlignment> CheckAlignData => 179ContentAlignment.TopLeft, 180ContentAlignment.TopRight, 181ContentAlignment.BottomCenter, 182ContentAlignment.BottomLeft, 183ContentAlignment.BottomRight, 184ContentAlignment.MiddleLeft, 185ContentAlignment.MiddleRight, 186ContentAlignment.TopCenter, 187ContentAlignment.MiddleCenter 192public void RadioButton_CheckAlign_Set_GetReturnsExpected(ContentAlignment value) 306foreach (ContentAlignment value in Enum.GetValues(typeof(ContentAlignment))) 316public void RadioRadioButton_TextAlign_Set_GetReturnsExpected(bool autoSize, FlatStyle flatStyle, ContentAlignment value) 342foreach (ContentAlignment value in Enum.GetValues(typeof(ContentAlignment))) 344int expectedCallCount = value == ContentAlignment.MiddleLeft ? 0 : 1; 355public void RadioRadioButton_TextAlign_SetWithHandle_GetReturnsExpected(bool autoSize, FlatStyle flatStyle, ContentAlignment value, int expectedInvalidatedCallCount, int expectedStyleChangedCallCount) 391[InvalidEnumData<ContentAlignment>] 392public void RadioRadioButton_TextAlign_SetInvalidValue_ThrowsInvalidEnumArgumentException(ContentAlignment value)
System\Windows\Forms\ToolStripButtonTests.cs (44)
62Assert.Equal(ContentAlignment.MiddleCenter, item.ImageAlign); 88Assert.Equal(ContentAlignment.MiddleCenter, item.TextAlign); 143Assert.Equal(ContentAlignment.MiddleCenter, item.ImageAlign); 169Assert.Equal(ContentAlignment.MiddleCenter, item.TextAlign); 230Assert.Equal(ContentAlignment.MiddleCenter, item.ImageAlign); 256Assert.Equal(ContentAlignment.MiddleCenter, item.TextAlign); 320Assert.Equal(ContentAlignment.MiddleCenter, item.ImageAlign); 346Assert.Equal(ContentAlignment.MiddleCenter, item.TextAlign); 408Assert.Equal(ContentAlignment.MiddleCenter, item.ImageAlign); 434Assert.Equal(ContentAlignment.MiddleCenter, item.TextAlign); 506Assert.Equal(ContentAlignment.MiddleCenter, item.ImageAlign); 532Assert.Equal(ContentAlignment.MiddleCenter, item.TextAlign); 1227yield return new object[] { ContentAlignment.MiddleCenter, RightToLeft.No, ToolStripItemDisplayStyle.None, 0, 0, TextFormatFlags.HorizontalCenter | TextFormatFlags.VerticalCenter | TextFormatFlags.HidePrefix }; 1228yield return new object[] { ContentAlignment.MiddleCenter, RightToLeft.No, ToolStripItemDisplayStyle.Image, 1, 0, TextFormatFlags.HorizontalCenter | TextFormatFlags.VerticalCenter | TextFormatFlags.HidePrefix }; 1229yield return new object[] { ContentAlignment.MiddleCenter, RightToLeft.No, ToolStripItemDisplayStyle.ImageAndText, 1, 1, TextFormatFlags.HorizontalCenter | TextFormatFlags.VerticalCenter | TextFormatFlags.HidePrefix }; 1231yield return new object[] { ContentAlignment.TopLeft, RightToLeft.Yes, ToolStripItemDisplayStyle.Text, 0, 1, TextFormatFlags.Left | TextFormatFlags.Top | TextFormatFlags.HidePrefix | TextFormatFlags.RightToLeft }; 1232yield return new object[] { ContentAlignment.TopLeft, RightToLeft.Inherit, ToolStripItemDisplayStyle.Text, 0, 1, TextFormatFlags.Left | TextFormatFlags.Top | TextFormatFlags.HidePrefix }; 1233yield return new object[] { ContentAlignment.TopLeft, RightToLeft.No, ToolStripItemDisplayStyle.Text, 0, 1, TextFormatFlags.Left | TextFormatFlags.Top | TextFormatFlags.HidePrefix }; 1234yield return new object[] { ContentAlignment.TopCenter, RightToLeft.Yes, ToolStripItemDisplayStyle.Text, 0, 1, TextFormatFlags.HorizontalCenter | TextFormatFlags.Top | TextFormatFlags.HidePrefix | TextFormatFlags.RightToLeft }; 1235yield return new object[] { ContentAlignment.TopCenter, RightToLeft.Inherit, ToolStripItemDisplayStyle.Text, 0, 1, TextFormatFlags.HorizontalCenter | TextFormatFlags.Top | TextFormatFlags.HidePrefix }; 1236yield return new object[] { ContentAlignment.TopCenter, RightToLeft.No, ToolStripItemDisplayStyle.Text, 0, 1, TextFormatFlags.HorizontalCenter | TextFormatFlags.Top | TextFormatFlags.HidePrefix }; 1237yield return new object[] { ContentAlignment.TopRight, RightToLeft.Yes, ToolStripItemDisplayStyle.Text, 0, 1, TextFormatFlags.Right | TextFormatFlags.Top | TextFormatFlags.HidePrefix | TextFormatFlags.RightToLeft }; 1238yield return new object[] { ContentAlignment.TopRight, RightToLeft.Inherit, ToolStripItemDisplayStyle.Text, 0, 1, TextFormatFlags.Right | TextFormatFlags.Top | TextFormatFlags.HidePrefix }; 1239yield return new object[] { ContentAlignment.TopRight, RightToLeft.No, ToolStripItemDisplayStyle.Text, 0, 1, TextFormatFlags.Right | TextFormatFlags.Top | TextFormatFlags.HidePrefix }; 1241yield return new object[] { ContentAlignment.MiddleLeft, RightToLeft.Yes, ToolStripItemDisplayStyle.Text, 0, 1, TextFormatFlags.Left | TextFormatFlags.VerticalCenter | TextFormatFlags.HidePrefix | TextFormatFlags.RightToLeft }; 1242yield return new object[] { ContentAlignment.MiddleLeft, RightToLeft.Inherit, ToolStripItemDisplayStyle.Text, 0, 1, TextFormatFlags.Left | TextFormatFlags.VerticalCenter | TextFormatFlags.HidePrefix }; 1243yield return new object[] { ContentAlignment.MiddleLeft, RightToLeft.No, ToolStripItemDisplayStyle.Text, 0, 1, TextFormatFlags.Left | TextFormatFlags.VerticalCenter | TextFormatFlags.HidePrefix }; 1244yield return new object[] { ContentAlignment.MiddleCenter, RightToLeft.Yes, ToolStripItemDisplayStyle.Text, 0, 1, TextFormatFlags.HorizontalCenter | TextFormatFlags.VerticalCenter | TextFormatFlags.HidePrefix | TextFormatFlags.RightToLeft }; 1245yield return new object[] { ContentAlignment.MiddleCenter, RightToLeft.Inherit, ToolStripItemDisplayStyle.Text, 0, 1, TextFormatFlags.HorizontalCenter | TextFormatFlags.VerticalCenter | TextFormatFlags.HidePrefix }; 1246yield return new object[] { ContentAlignment.MiddleCenter, RightToLeft.No, ToolStripItemDisplayStyle.Text, 0, 1, TextFormatFlags.HorizontalCenter | TextFormatFlags.VerticalCenter | TextFormatFlags.HidePrefix }; 1247yield return new object[] { ContentAlignment.MiddleRight, RightToLeft.Yes, ToolStripItemDisplayStyle.Text, 0, 1, TextFormatFlags.Right | TextFormatFlags.VerticalCenter | TextFormatFlags.HidePrefix | TextFormatFlags.RightToLeft }; 1248yield return new object[] { ContentAlignment.MiddleRight, RightToLeft.Inherit, ToolStripItemDisplayStyle.Text, 0, 1, TextFormatFlags.Right | TextFormatFlags.VerticalCenter | TextFormatFlags.HidePrefix }; 1249yield return new object[] { ContentAlignment.MiddleRight, RightToLeft.No, ToolStripItemDisplayStyle.Text, 0, 1, TextFormatFlags.Right | TextFormatFlags.VerticalCenter | TextFormatFlags.HidePrefix }; 1251yield return new object[] { ContentAlignment.BottomLeft, RightToLeft.Yes, ToolStripItemDisplayStyle.Text, 0, 1, TextFormatFlags.Left | TextFormatFlags.Bottom | TextFormatFlags.HidePrefix | TextFormatFlags.RightToLeft }; 1252yield return new object[] { ContentAlignment.BottomLeft, RightToLeft.Inherit, ToolStripItemDisplayStyle.Text, 0, 1, TextFormatFlags.Left | TextFormatFlags.Bottom | TextFormatFlags.HidePrefix }; 1253yield return new object[] { ContentAlignment.BottomLeft, RightToLeft.No, ToolStripItemDisplayStyle.Text, 0, 1, TextFormatFlags.Left | TextFormatFlags.Bottom | TextFormatFlags.HidePrefix }; 1254yield return new object[] { ContentAlignment.BottomCenter, RightToLeft.Yes, ToolStripItemDisplayStyle.Text, 0, 1, TextFormatFlags.HorizontalCenter | TextFormatFlags.Bottom | TextFormatFlags.HidePrefix | TextFormatFlags.RightToLeft }; 1255yield return new object[] { ContentAlignment.BottomCenter, RightToLeft.Inherit, ToolStripItemDisplayStyle.Text, 0, 1, TextFormatFlags.HorizontalCenter | TextFormatFlags.Bottom | TextFormatFlags.HidePrefix }; 1256yield return new object[] { ContentAlignment.BottomCenter, RightToLeft.No, ToolStripItemDisplayStyle.Text, 0, 1, TextFormatFlags.HorizontalCenter | TextFormatFlags.Bottom | TextFormatFlags.HidePrefix }; 1257yield return new object[] { ContentAlignment.BottomRight, RightToLeft.Yes, ToolStripItemDisplayStyle.Text, 0, 1, TextFormatFlags.Right | TextFormatFlags.Bottom | TextFormatFlags.HidePrefix | TextFormatFlags.RightToLeft }; 1258yield return new object[] { ContentAlignment.BottomRight, RightToLeft.Inherit, ToolStripItemDisplayStyle.Text, 0, 1, TextFormatFlags.Right | TextFormatFlags.Bottom | TextFormatFlags.HidePrefix }; 1259yield return new object[] { ContentAlignment.BottomRight, RightToLeft.No, ToolStripItemDisplayStyle.Text, 0, 1, TextFormatFlags.Right | TextFormatFlags.Bottom | TextFormatFlags.HidePrefix }; 1264public void ToolStripButton_OnPaint_InvokeWithOwner_DoesNotCallPaint(ContentAlignment textAlign, RightToLeft rightToLeft, ToolStripItemDisplayStyle displayStyle, int expectedRenderItemImageCallCount, int expectedRenderItemTextCallCount, TextFormatFlags expectedTextFormat) 1355public void ToolStripButton_OnPaint_InvokeWithOwnerCantShowKeyboardCues_DoesNotCallPaint(ContentAlignment textAlign, RightToLeft rightToLeft, ToolStripItemDisplayStyle displayStyle, int expectedRenderItemImageCallCount, int expectedRenderItemTextCallCount, TextFormatFlags expectedTextFormat)
System\Windows\Forms\ToolStripControlHostTests.cs (25)
72Assert.Equal(ContentAlignment.MiddleCenter, item.ControlAlign); 91Assert.Equal(ContentAlignment.MiddleCenter, item.ImageAlign); 117Assert.Equal(ContentAlignment.MiddleCenter, item.TextAlign); 697[EnumData<ContentAlignment>] 698public void ToolStripControlHost_ControlAlign_Set_GetReturnsExpected(ContentAlignment value) 722[EnumData<ContentAlignment>] 723public void ToolStripControlHost_ControlAlign_SetDisposed_GetReturnsExpected(ContentAlignment value) 740[InvalidEnumData<ContentAlignment>] 741[InlineData((ContentAlignment)int.MaxValue)] 742[InlineData((ContentAlignment)int.MinValue)] 743public void ToolStripControlHost_ControlAlign_SetInvalid_ThrowsInvalidEnumArgumentException(ContentAlignment value) 1241[EnumData<ContentAlignment>] 1242public void ToolStripControlHost_ImageAlign_Set_GetReturnsExpected(ContentAlignment value) 1259[InvalidEnumData<ContentAlignment>] 1260[InlineData((ContentAlignment)int.MaxValue)] 1261[InlineData((ContentAlignment)int.MinValue)] 1262public void ToolStripControlHost_ImageAlign_SetInvalid_ThrowsInvalidEnumArgumentException(ContentAlignment value) 2304[EnumData<ContentAlignment>] 2305public void ToolStripControlHost_TextAlign_Set_GetReturnsExpected(ContentAlignment value) 2320[InvalidEnumData<ContentAlignment>] 2321[InlineData((ContentAlignment)int.MaxValue)] 2322[InlineData((ContentAlignment)int.MinValue)] 2323public void ToolStripControlHost_TextAlign_SetInvalid_ThrowsInvalidEnumArgumentException(ContentAlignment value) 2767[EnumData<ContentAlignment>] 2768public void ToolStripControlHost_OnBoundsChanged_Invoke_Success(ContentAlignment controlAlign)
System\Windows\Forms\ToolStripDropDownItemTests.cs (8)
62Assert.Equal(ContentAlignment.MiddleCenter, item.ImageAlign); 88Assert.Equal(ContentAlignment.MiddleCenter, item.TextAlign); 151Assert.Equal(ContentAlignment.MiddleCenter, item.ImageAlign); 177Assert.Equal(ContentAlignment.MiddleCenter, item.TextAlign); 250Assert.Equal(ContentAlignment.MiddleCenter, item.ImageAlign); 276Assert.Equal(ContentAlignment.MiddleCenter, item.TextAlign); 358Assert.Equal(ContentAlignment.MiddleCenter, item.ImageAlign); 384Assert.Equal(ContentAlignment.MiddleCenter, item.TextAlign);
System\Windows\Forms\ToolStripItemTests.cs (66)
61Assert.Equal(ContentAlignment.MiddleCenter, item.ImageAlign); 87Assert.Equal(ContentAlignment.MiddleCenter, item.TextAlign); 146Assert.Equal(ContentAlignment.MiddleCenter, item.ImageAlign); 172Assert.Equal(ContentAlignment.MiddleCenter, item.TextAlign); 241Assert.Equal(ContentAlignment.MiddleCenter, item.ImageAlign); 267Assert.Equal(ContentAlignment.MiddleCenter, item.TextAlign); 4173[EnumData<ContentAlignment>] 4174public void ToolStripItem_ImageAlign_Set_GetReturnsExpected(ContentAlignment value) 4188[InlineData(ContentAlignment.TopLeft, 1)] 4189[InlineData(ContentAlignment.TopCenter, 1)] 4190[InlineData(ContentAlignment.TopRight, 1)] 4191[InlineData(ContentAlignment.MiddleLeft, 1)] 4192[InlineData(ContentAlignment.MiddleCenter, 0)] 4193[InlineData(ContentAlignment.MiddleRight, 1)] 4194[InlineData(ContentAlignment.BottomLeft, 1)] 4195[InlineData(ContentAlignment.BottomCenter, 1)] 4196[InlineData(ContentAlignment.BottomRight, 1)] 4197public void ToolStripItem_ImageAlign_SetWithOwner_GetReturnsExpected(ContentAlignment value, int expectedParentLayoutCallCount) 4235[InlineData(ContentAlignment.TopLeft, 1)] 4236[InlineData(ContentAlignment.TopCenter, 1)] 4237[InlineData(ContentAlignment.TopRight, 1)] 4238[InlineData(ContentAlignment.MiddleLeft, 1)] 4239[InlineData(ContentAlignment.MiddleCenter, 0)] 4240[InlineData(ContentAlignment.MiddleRight, 1)] 4241[InlineData(ContentAlignment.BottomLeft, 1)] 4242[InlineData(ContentAlignment.BottomCenter, 1)] 4243[InlineData(ContentAlignment.BottomRight, 1)] 4244public void ToolStripItem_ImageAlign_SetWithOwnerWithHandle_GetReturnsExpected(ContentAlignment value, int expectedParentLayoutCallCount) 4295[EnumData<ContentAlignment>] 4296public void ToolStripItem_ImageAlign_SetWithParent_GetReturnsExpected(ContentAlignment value) 4327[EnumData<ContentAlignment>] 4328public void ToolStripItem_ImageAlign_SetWithParentWithHandle_GetReturnsExpected(ContentAlignment value) 4372[InvalidEnumData<ContentAlignment>] 4373[InlineData((ContentAlignment)int.MaxValue)] 4374[InlineData((ContentAlignment)int.MinValue)] 4375public void ToolStripItem_ImageAlign_SetInvalid_ThrowsInvalidEnumArgumentException(ContentAlignment value) 8289[EnumData<ContentAlignment>] 8290public void ToolStripItem_TextAlign_Set_GetReturnsExpected(ContentAlignment value) 8304[InlineData(ContentAlignment.TopLeft, 1)] 8305[InlineData(ContentAlignment.TopCenter, 1)] 8306[InlineData(ContentAlignment.TopRight, 1)] 8307[InlineData(ContentAlignment.MiddleLeft, 1)] 8308[InlineData(ContentAlignment.MiddleCenter, 0)] 8309[InlineData(ContentAlignment.MiddleRight, 1)] 8310[InlineData(ContentAlignment.BottomLeft, 1)] 8311[InlineData(ContentAlignment.BottomCenter, 1)] 8312[InlineData(ContentAlignment.BottomRight, 1)] 8313public void ToolStripItem_TextAlign_SetWithOwner_GetReturnsExpected(ContentAlignment value, int expectedParentLayoutCallCount) 8351[InlineData(ContentAlignment.TopLeft, 1)] 8352[InlineData(ContentAlignment.TopCenter, 1)] 8353[InlineData(ContentAlignment.TopRight, 1)] 8354[InlineData(ContentAlignment.MiddleLeft, 1)] 8355[InlineData(ContentAlignment.MiddleCenter, 0)] 8356[InlineData(ContentAlignment.MiddleRight, 1)] 8357[InlineData(ContentAlignment.BottomLeft, 1)] 8358[InlineData(ContentAlignment.BottomCenter, 1)] 8359[InlineData(ContentAlignment.BottomRight, 1)] 8360public void ToolStripItem_TextAlign_SetWithOwnerWithHandle_GetReturnsExpected(ContentAlignment value, int expectedParentLayoutCallCount) 8411[EnumData<ContentAlignment>] 8412public void ToolStripItem_TextAlign_SetWithParent_GetReturnsExpected(ContentAlignment value) 8443[EnumData<ContentAlignment>] 8444public void ToolStripItem_TextAlign_SetWithParentWithHandle_GetReturnsExpected(ContentAlignment value) 8488[InvalidEnumData<ContentAlignment>] 8489[InlineData((ContentAlignment)int.MaxValue)] 8490[InlineData((ContentAlignment)int.MinValue)] 8491public void ToolStripItem_TextAlign_SetInvalid_ThrowsInvalidEnumArgumentException(ContentAlignment value)
System\Windows\Forms\ToolStripItemTextRenderEventArgsTests.cs (6)
39yield return new object[] { new ToolStripButton(), null, Rectangle.Empty, Color.Empty, null, ContentAlignment.TopLeft - 1, TextFormatFlags.Default | TextFormatFlags.Top | TextFormatFlags.HidePrefix }; 40yield return new object[] { new ToolStripButton(), "", new Rectangle(1, 2, 3, 4), Color.Red, SystemFonts.DefaultFont, ContentAlignment.MiddleCenter, TextFormatFlags.Default | TextFormatFlags.HorizontalCenter | TextFormatFlags.VerticalCenter | TextFormatFlags.HidePrefix }; 41yield return new object[] { new ToolStripButton(), "", new Rectangle(1, 2, 3, 4), Color.Red, SystemFonts.DefaultFont, ContentAlignment.BottomRight, TextFormatFlags.Default | TextFormatFlags.Bottom | TextFormatFlags.Right | TextFormatFlags.HidePrefix }; 42yield return new object[] { new ToolStripButton() { RightToLeft = RightToLeft.Yes }, "text", new Rectangle(1, 2, 3, 4), Color.Red, SystemFonts.DefaultFont, (ContentAlignment)(-1), TextFormatFlags.Default | TextFormatFlags.Bottom | TextFormatFlags.Right | TextFormatFlags.RightToLeft | TextFormatFlags.HidePrefix }; 47public void Ctor_ToolStripItem_String_Rectangle_Color_Font_ContentAlignment(ToolStripItem item, string text, Rectangle textRectangle, Color textColor, Font textFont, ContentAlignment textAlign, TextFormatFlags expectedTextFormat) 69Assert.Throws<ArgumentNullException>("item", () => new ToolStripItemTextRenderEventArgs(graphics, null, "", new Rectangle(1, 2, 3, 4), Color.Red, SystemFonts.DefaultFont, ContentAlignment.TopLeft));
System\Windows\Forms\ToolStripMenuItemTests.cs (4)
62Assert.Equal(ContentAlignment.MiddleCenter, item.ImageAlign); 93Assert.Equal(ContentAlignment.MiddleCenter, item.TextAlign); 287ImageAlign = ContentAlignment.BottomCenter, 301TextAlign = ContentAlignment.BottomRight,
System\Windows\Forms\ToolStripSeparatorTests.cs (14)
59Assert.Equal(ContentAlignment.MiddleCenter, item.ImageAlign); 85Assert.Equal(ContentAlignment.MiddleCenter, item.TextAlign); 448[EnumData<ContentAlignment>] 449public void ToolStripSeparator_ImageAlign_Set_GetReturnsExpected(ContentAlignment value) 463[InvalidEnumData<ContentAlignment>] 464[InlineData((ContentAlignment)int.MaxValue)] 465[InlineData((ContentAlignment)int.MinValue)] 466public void ToolStripSeparator_ImageAlign_SetInvalid_ThrowsInvalidEnumArgumentException(ContentAlignment value) 625[EnumData<ContentAlignment>] 626public void ToolStripSeparator_TextAlign_Set_GetReturnsExpected(ContentAlignment value) 640[InvalidEnumData<ContentAlignment>] 641[InlineData((ContentAlignment)int.MaxValue)] 642[InlineData((ContentAlignment)int.MinValue)] 643public void ToolStripSeparator_TextAlign_SetInvalid_ThrowsInvalidEnumArgumentException(ContentAlignment value)
WinFormsControlsTest (4)
DesignTimeAligned.Designer.cs (3)
50this.label1.TextAlign = System.Drawing.ContentAlignment.MiddleRight; 61this.label2.TextAlign = System.Drawing.ContentAlignment.MiddleRight; 71this.button1.TextAlign = System.Drawing.ContentAlignment.MiddleLeft;
FormOwnerTestForm.cs (1)
50TextAlign = ContentAlignment.MiddleCenter