655 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 (240)
System\Drawing\Design\UITypeEditor.cs (1)
54[typeof(ContentAlignment)] = $"System.Drawing.Design.ContentAlignmentEditor, {AssemblyRef.SystemDrawingDesign}",
System\Windows\Forms\Control.cs (16)
10489protected ContentAlignment RtlTranslateAlignment(ContentAlignment align) 10531protected internal ContentAlignment RtlTranslateContent(ContentAlignment align) 10539case ContentAlignment.TopLeft: 10540return ContentAlignment.TopRight; 10541case ContentAlignment.TopRight: 10542return ContentAlignment.TopLeft; 10550case ContentAlignment.MiddleLeft: 10551return ContentAlignment.MiddleRight; 10552case ContentAlignment.MiddleRight: 10553return ContentAlignment.MiddleLeft; 10561case ContentAlignment.BottomLeft: 10562return ContentAlignment.BottomRight; 10563case ContentAlignment.BottomRight: 10564return ContentAlignment.BottomLeft;
System\Windows\Forms\Controls\Buttons\ButtonBase.cs (9)
21private ContentAlignment _imageAlign = ContentAlignment.MiddleCenter; 22private ContentAlignment _textAlign = ContentAlignment.MiddleCenter; 274ContentAlignment align = RtlTranslateContent(TextAlign); 424[DefaultValue(ContentAlignment.MiddleCenter)] 428public ContentAlignment ImageAlign 670[DefaultValue(ContentAlignment.MiddleCenter)] 674public virtual ContentAlignment TextAlign
System\Windows\Forms\Controls\Buttons\ButtonInternal\ButtonBaseAdapter.cs (4)
562ContentAlignment textAlign, 578CheckAlign = ContentAlignment.TopLeft, 579ImageAlign = ContentAlignment.MiddleCenter, 605CheckAlign = 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)
305ContentAlignment 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; 113[DefaultValue(ContentAlignment.MiddleLeft)] 115public ContentAlignment CheckAlign 240ContentAlignment align = RtlTranslateContent(CheckAlign); 335[DefaultValue(ContentAlignment.MiddleLeft)] 336public 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; 120[DefaultValue(ContentAlignment.MiddleLeft)] 122public ContentAlignment CheckAlign 208ContentAlignment align = RtlTranslateContent(CheckAlign); 305[DefaultValue(ContentAlignment.MiddleLeft)] 306public 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)
269case ContentAlignment.TopLeft: 270case ContentAlignment.MiddleLeft: 271case ContentAlignment.BottomLeft: 274case ContentAlignment.TopRight: 275case ContentAlignment.MiddleRight: 276case ContentAlignment.BottomRight: 279case ContentAlignment.TopCenter: 280case ContentAlignment.MiddleCenter: 281case ContentAlignment.BottomCenter: 546[DefaultValue(ContentAlignment.MiddleCenter)] 550public ContentAlignment ImageAlign 552get => Properties.GetValueOrDefault(s_propImageAlign, ContentAlignment.MiddleCenter); 559Properties.AddOrRemoveValue(s_propImageAlign, value, defaultValue: ContentAlignment.MiddleCenter); 692[DefaultValue(ContentAlignment.TopLeft)] 694public virtual ContentAlignment TextAlign 696get => Properties.GetValueOrDefault(s_propTextAlign, ContentAlignment.TopLeft); 703Properties.AddOrRemoveValue(s_propTextAlign, value, defaultValue: ContentAlignment.TopLeft); 873protected Rectangle CalcImageRenderBounds(Image image, Rectangle r, ContentAlignment align) 966private void DrawImage(PaintEventArgs e, Image image, Rectangle r, ContentAlignment align) 982protected void DrawImage(Graphics g, Image image, Rectangle r, ContentAlignment align) 985private 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; 996[DefaultValue(ContentAlignment.MiddleCenter)] 1000public ContentAlignment ImageAlign 1879[DefaultValue(ContentAlignment.MiddleCenter)] 1883public 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)
994renderer.DrawItemText(new ToolStripItemTextRenderEventArgs(g, this, Text, InternalLayout.TextRectangle, textColor, Font, (rightToLeft) ? ContentAlignment.MiddleRight : ContentAlignment.MiddleLeft)); 1003renderer.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)
296button.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\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; 2503internal static TextFormatFlags ConvertAlignmentToTextFormat(ContentAlignment alignment) 2534ContentAlignment textAlign, 2588ContentAlignment 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)
52ContentAlignment alignment = ContentAlignment.MiddleCenter; 108private static int CheckboxBaselineOffset(ContentAlignment alignment, FlatStyle flatStyle) 164private static int RadiobuttonBaselineOffset(ContentAlignment alignment, FlatStyle flatStyle) 195private static int DefaultBaselineOffset(ContentAlignment alignment, FlatStyle flatStyle)
System\Windows\Forms\Design\ComboBoxDesigner.cs (1)
35int 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)
33ContentAlignment alignment = ContentAlignment.TopLeft; 99private 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)
45int baseline = DesignerUtils.GetTextBaseline(Control, Drawing.ContentAlignment.TopLeft);
System.Windows.Forms.Design.Tests (2)
EnsureEditorsTests.cs (1)
49[InlineData(typeof(ContentAlignment), typeof(ContentAlignmentEditor))]
System\Windows\Forms\Design\UpDownBaseDesignerTests.cs (1)
60int expectedBaseline = DesignerUtils.GetTextBaseline(_numericUpDown, Drawing.ContentAlignment.TopLeft) + expectedBaselineOffset;
System.Windows.Forms.Tests (352)
System\Windows\Forms\ButtonBaseTests.cs (66)
74Assert.Equal(ContentAlignment.MiddleCenter, control.ImageAlign); 111Assert.Equal(ContentAlignment.MiddleCenter, control.TextAlign); 182foreach (ContentAlignment textAlign in Enum.GetValues(typeof(ContentAlignment))) 190yield return new object[] { FlatStyle.System, RightToLeft.Yes, ContentAlignment.BottomLeft, 0x56012A00, 0x6000 }; 191yield return new object[] { FlatStyle.System, RightToLeft.Yes, ContentAlignment.BottomCenter, 0x56012B00, 0x6000 }; 192yield return new object[] { FlatStyle.System, RightToLeft.Yes, ContentAlignment.BottomRight, 0x56012900, 0x6000 }; 193yield return new object[] { FlatStyle.System, RightToLeft.Yes, ContentAlignment.MiddleLeft, 0x56012E00, 0x6000 }; 194yield return new object[] { FlatStyle.System, RightToLeft.Yes, ContentAlignment.MiddleCenter, 0x56012F00, 0x6000 }; 195yield return new object[] { FlatStyle.System, RightToLeft.Yes, ContentAlignment.MiddleRight, 0x56012D00, 0x6000 }; 196yield return new object[] { FlatStyle.System, RightToLeft.Yes, ContentAlignment.TopLeft, 0x56012600, 0x6000 }; 197yield return new object[] { FlatStyle.System, RightToLeft.Yes, ContentAlignment.TopCenter, 0x56012700, 0x6000 }; 198yield return new object[] { FlatStyle.System, RightToLeft.Yes, ContentAlignment.TopRight, 0x56012500, 0x6000 }; 200yield return new object[] { FlatStyle.System, RightToLeft.No, ContentAlignment.BottomLeft, 0x56012900, 0 }; 201yield return new object[] { FlatStyle.System, RightToLeft.No, ContentAlignment.BottomCenter, 0x56012B00, 0 }; 202yield return new object[] { FlatStyle.System, RightToLeft.No, ContentAlignment.BottomRight, 0x56012A00, 0 }; 203yield return new object[] { FlatStyle.System, RightToLeft.No, ContentAlignment.MiddleLeft, 0x56012D00, 0 }; 204yield return new object[] { FlatStyle.System, RightToLeft.No, ContentAlignment.MiddleCenter, 0x56012F00, 0 }; 205yield return new object[] { FlatStyle.System, RightToLeft.No, ContentAlignment.MiddleRight, 0x56012E00, 0 }; 206yield return new object[] { FlatStyle.System, RightToLeft.No, ContentAlignment.TopLeft, 0x56012500, 0 }; 207yield return new object[] { FlatStyle.System, RightToLeft.No, ContentAlignment.TopCenter, 0x56012700, 0 }; 208yield return new object[] { FlatStyle.System, RightToLeft.No, ContentAlignment.TopRight, 0x56012600, 0 }; 210yield return new object[] { FlatStyle.System, RightToLeft.Inherit, ContentAlignment.BottomLeft, 0x56012900, 0 }; 211yield return new object[] { FlatStyle.System, RightToLeft.Inherit, ContentAlignment.BottomCenter, 0x56012B00, 0 }; 212yield return new object[] { FlatStyle.System, RightToLeft.Inherit, ContentAlignment.BottomRight, 0x56012A00, 0 }; 213yield return new object[] { FlatStyle.System, RightToLeft.Inherit, ContentAlignment.MiddleLeft, 0x56012D00, 0 }; 214yield return new object[] { FlatStyle.System, RightToLeft.Inherit, ContentAlignment.MiddleCenter, 0x56012F00, 0 }; 215yield return new object[] { FlatStyle.System, RightToLeft.Inherit, ContentAlignment.MiddleRight, 0x56012E00, 0 }; 216yield return new object[] { FlatStyle.System, RightToLeft.Inherit, ContentAlignment.TopLeft, 0x56012500, 0 }; 217yield return new object[] { FlatStyle.System, RightToLeft.Inherit, ContentAlignment.TopCenter, 0x56012700, 0 }; 218yield return new object[] { FlatStyle.System, RightToLeft.Inherit, ContentAlignment.TopRight, 0x56012600, 0 }; 223public void ButtonBase_CreateParams_GetTextAlign_ReturnsExpected(FlatStyle flatStyle, RightToLeft rightToLeft, ContentAlignment textAlign, int expectedStyle, int expectedExStyle) 1841foreach (ContentAlignment value in Enum.GetValues(typeof(ContentAlignment))) 1850public void ButtonBase_ImageAlign_Set_GetReturnsExpected(bool autoSize, ContentAlignment value) 1873foreach (ContentAlignment value in Enum.GetValues(typeof(ContentAlignment))) 1875int expectedCallCount = value == ContentAlignment.MiddleCenter ? 0 : 1; 1883public void ButtonBase_ImageAlign_SetWithParent_GetReturnsExpected(bool autoSize, ContentAlignment value, int expectedParentLayoutCallCount) 1931foreach (ContentAlignment value in Enum.GetValues(typeof(ContentAlignment))) 1933int expectedCallCount = value == ContentAlignment.MiddleCenter ? 0 : 1; 1941public void ButtonBase_ImageAlign_SetWithHandle_GetReturnsExpected(bool autoSize, ContentAlignment value, int expectedInvalidatedCallCount) 1977foreach (ContentAlignment value in Enum.GetValues(typeof(ContentAlignment))) 1979int expectedCallCount = value == ContentAlignment.MiddleCenter ? 0 : 1; 1987public void ButtonBase_ImageAlign_SetWithParentWithHandle_GetReturnsExpected(bool autoSize, ContentAlignment value, int expectedParentLayoutCallCount, int expectedInvalidatedCallCount) 2046[InvalidEnumData<ContentAlignment>] 2047public void ButtonBase_ImageAlign_SetInvalid_ThrowsInvalidEnumArgumentException(ContentAlignment value) 3266foreach (ContentAlignment value in Enum.GetValues(typeof(ContentAlignment))) 3276public void ButtonBase_TextAlign_Set_GetReturnsExpected(bool autoSize, FlatStyle flatStyle, ContentAlignment value) 3302foreach (ContentAlignment value in Enum.GetValues(typeof(ContentAlignment))) 3304int expectedCallCount = value == ContentAlignment.MiddleCenter ? 0 : 1; 3313public void ButtonBase_TextAlign_SetWithParent_GetReturnsExpected(bool autoSize, FlatStyle flatStyle, ContentAlignment value, int expectedParentLayoutCallCount) 3362foreach (ContentAlignment value in Enum.GetValues(typeof(ContentAlignment))) 3364int expectedCallCount = value == ContentAlignment.MiddleCenter ? 0 : 1; 3375public void ButtonBase_TextAlign_SetWithHandle_GetReturnsExpected(bool autoSize, FlatStyle flatStyle, ContentAlignment value, int expectedInvalidatedCallCount, int expectedStyleChangedCallCount) 3412foreach (ContentAlignment value in Enum.GetValues(typeof(ContentAlignment))) 3414int expectedCallCount = value == ContentAlignment.MiddleCenter ? 0 : 1; 3429public void ButtonBase_TextAlign_SetWithParentWithHandle_GetReturnsExpected(bool autoSize, FlatStyle flatStyle, ContentAlignment value, int expectedParentLayoutCallCount, int expectedInvalidatedCallCount, int expectedStyleChangedCallCount) 3489[InvalidEnumData<ContentAlignment>] 3490public void ButtonBase_TextAlign_SetInvalidValue_ThrowsInvalidEnumArgumentException(ContentAlignment value)
System\Windows\Forms\ButtonTests.cs (32)
77Assert.Equal(ContentAlignment.MiddleCenter, control.ImageAlign); 109Assert.Equal(ContentAlignment.MiddleCenter, control.TextAlign); 204foreach (ContentAlignment textAlign in Enum.GetValues(typeof(ContentAlignment))) 212yield return new object[] { FlatStyle.System, RightToLeft.Yes, ContentAlignment.BottomLeft, 0x56012A00, 0x6000 }; 213yield return new object[] { FlatStyle.System, RightToLeft.Yes, ContentAlignment.BottomCenter, 0x56012B00, 0x6000 }; 214yield return new object[] { FlatStyle.System, RightToLeft.Yes, ContentAlignment.BottomRight, 0x56012900, 0x6000 }; 215yield return new object[] { FlatStyle.System, RightToLeft.Yes, ContentAlignment.MiddleLeft, 0x56012E00, 0x6000 }; 216yield return new object[] { FlatStyle.System, RightToLeft.Yes, ContentAlignment.MiddleCenter, 0x56012F00, 0x6000 }; 217yield return new object[] { FlatStyle.System, RightToLeft.Yes, ContentAlignment.MiddleRight, 0x56012D00, 0x6000 }; 218yield return new object[] { FlatStyle.System, RightToLeft.Yes, ContentAlignment.TopLeft, 0x56012600, 0x6000 }; 219yield return new object[] { FlatStyle.System, RightToLeft.Yes, ContentAlignment.TopCenter, 0x56012700, 0x6000 }; 220yield return new object[] { FlatStyle.System, RightToLeft.Yes, ContentAlignment.TopRight, 0x56012500, 0x6000 }; 222yield return new object[] { FlatStyle.System, RightToLeft.No, ContentAlignment.BottomLeft, 0x56012900, 0 }; 223yield return new object[] { FlatStyle.System, RightToLeft.No, ContentAlignment.BottomCenter, 0x56012B00, 0 }; 224yield return new object[] { FlatStyle.System, RightToLeft.No, ContentAlignment.BottomRight, 0x56012A00, 0 }; 225yield return new object[] { FlatStyle.System, RightToLeft.No, ContentAlignment.MiddleLeft, 0x56012D00, 0 }; 226yield return new object[] { FlatStyle.System, RightToLeft.No, ContentAlignment.MiddleCenter, 0x56012F00, 0 }; 227yield return new object[] { FlatStyle.System, RightToLeft.No, ContentAlignment.MiddleRight, 0x56012E00, 0 }; 228yield return new object[] { FlatStyle.System, RightToLeft.No, ContentAlignment.TopLeft, 0x56012500, 0 }; 229yield return new object[] { FlatStyle.System, RightToLeft.No, ContentAlignment.TopCenter, 0x56012700, 0 }; 230yield return new object[] { FlatStyle.System, RightToLeft.No, ContentAlignment.TopRight, 0x56012600, 0 }; 232yield return new object[] { FlatStyle.System, RightToLeft.Inherit, ContentAlignment.BottomLeft, 0x56012900, 0 }; 233yield return new object[] { FlatStyle.System, RightToLeft.Inherit, ContentAlignment.BottomCenter, 0x56012B00, 0 }; 234yield return new object[] { FlatStyle.System, RightToLeft.Inherit, ContentAlignment.BottomRight, 0x56012A00, 0 }; 235yield return new object[] { FlatStyle.System, RightToLeft.Inherit, ContentAlignment.MiddleLeft, 0x56012D00, 0 }; 236yield return new object[] { FlatStyle.System, RightToLeft.Inherit, ContentAlignment.MiddleCenter, 0x56012F00, 0 }; 237yield return new object[] { FlatStyle.System, RightToLeft.Inherit, ContentAlignment.MiddleRight, 0x56012E00, 0 }; 238yield return new object[] { FlatStyle.System, RightToLeft.Inherit, ContentAlignment.TopLeft, 0x56012500, 0 }; 239yield return new object[] { FlatStyle.System, RightToLeft.Inherit, ContentAlignment.TopCenter, 0x56012700, 0 }; 240yield return new object[] { FlatStyle.System, RightToLeft.Inherit, ContentAlignment.TopRight, 0x56012600, 0 }; 245public void Button_CreateParams_GetTextAlign_ReturnsExpected(FlatStyle flatStyle, RightToLeft rightToLeft, ContentAlignment textAlign, int expectedStyle, int expectedExStyle)
System\Windows\Forms\CheckBoxTests.cs (11)
42Assert.Equal(ContentAlignment.MiddleLeft, control.CheckAlign); 78Assert.Equal(ContentAlignment.MiddleCenter, control.ImageAlign); 111Assert.Equal(ContentAlignment.MiddleLeft, control.TextAlign); 184[EnumData<ContentAlignment>] 185public void CheckBox_CheckAlign_Set_GetReturnsExpected(ContentAlignment value) 201[InvalidEnumData<ContentAlignment>] 202public void CheckBox_CheckAlign_SetInvalidValue_ThrowsInvalidEnumArgumentException(ContentAlignment value) 421[EnumData<ContentAlignment>] 422public void CheckBox_TextAlign_Set_GetReturnsExpected(ContentAlignment value) 438[InvalidEnumData<ContentAlignment>] 439public void CheckBox_TextAlign_SetInvalidValue_ThrowsInvalidEnumArgumentException(ContentAlignment value)
System\Windows\Forms\ControlTests.cs (4)
1416public new ContentAlignment RtlTranslateAlignment(ContentAlignment align) => base.RtlTranslateAlignment(align); 1418public new ContentAlignment RtlTranslateContent(ContentAlignment align) => base.RtlTranslateContent(align);
System\Windows\Forms\ControlTests.Methods.cs (24)
6859public void Control_RtlTranslateAlignment_InvokeContentAlignment_ReturnsExpected(RightToLeft rightToLeft, ContentAlignment align, ContentAlignment expected) 6907foreach (ContentAlignment align in Enum.GetValues(typeof(ContentAlignment))) 6913yield return new object[] { RightToLeft.Yes, ContentAlignment.BottomCenter, ContentAlignment.BottomCenter }; 6914yield return new object[] { RightToLeft.Yes, ContentAlignment.BottomLeft, ContentAlignment.BottomRight }; 6915yield return new object[] { RightToLeft.Yes, ContentAlignment.BottomRight, ContentAlignment.BottomLeft }; 6916yield return new object[] { RightToLeft.Yes, ContentAlignment.MiddleCenter, ContentAlignment.MiddleCenter }; 6917yield return new object[] { RightToLeft.Yes, ContentAlignment.MiddleLeft, ContentAlignment.MiddleRight }; 6918yield return new object[] { RightToLeft.Yes, ContentAlignment.MiddleRight, ContentAlignment.MiddleLeft }; 6919yield return new object[] { RightToLeft.Yes, ContentAlignment.TopCenter, ContentAlignment.TopCenter }; 6920yield return new object[] { RightToLeft.Yes, ContentAlignment.TopLeft, ContentAlignment.TopRight }; 6921yield return new object[] { RightToLeft.Yes, ContentAlignment.TopRight, ContentAlignment.TopLeft }; 6926public void Control_RtlTranslateContent_Invoke_ReturnsExpected(RightToLeft rightToLeft, ContentAlignment align, ContentAlignment expected)
System\Windows\Forms\LabelTests.cs (23)
70Assert.Equal(ContentAlignment.MiddleCenter, control.ImageAlign); 105Assert.Equal(ContentAlignment.TopLeft, control.TextAlign); 242[InvalidEnumData<ContentAlignment>] 243public void Label_ImageAlign_SetInvalidValue_ThrowsInvalidEnumArgumentException(ContentAlignment value) 253foreach (ContentAlignment value in Enum.GetValues(typeof(ContentAlignment))) 262public void Label_ImageAlign_Set_GetReturnsExpected(bool autoSize, ContentAlignment value) 381[InlineData(ContentAlignment.TopLeft)] 382[InlineData(ContentAlignment.TopCenter)] 383[InlineData(ContentAlignment.TopRight)] 384[InlineData(ContentAlignment.MiddleLeft)] 385[InlineData(ContentAlignment.MiddleCenter)] 386[InlineData(ContentAlignment.MiddleRight)] 387[InlineData(ContentAlignment.BottomLeft)] 388[InlineData(ContentAlignment.BottomCenter)] 389[InlineData(ContentAlignment.BottomRight)] 390public void Label_TextAlign_Set_GetReturnsExpected(ContentAlignment alignment) 403label.TextAlign = ContentAlignment.TopLeft; 408label.TextAlign = ContentAlignment.TopLeft; 416label.TextAlign = ContentAlignment.TopLeft; 421label.TextAlign = ContentAlignment.MiddleCenter; 838label.TextAlign = ContentAlignment.BottomCenter; 842label.TextAlign = ContentAlignment.BottomLeft;
System\Windows\Forms\RadioButtonTests.cs (25)
42Assert.Equal(ContentAlignment.MiddleLeft, control.CheckAlign); 77Assert.Equal(ContentAlignment.MiddleCenter, control.ImageAlign); 109Assert.Equal(ContentAlignment.MiddleLeft, control.TextAlign); 168[InvalidEnumData<ContentAlignment>] 169public void RadioButton_CheckAlign_SetInvalidValue_ThrowsInvalidEnumArgumentException(ContentAlignment value) 175public static TheoryData<ContentAlignment> CheckAlignData => new() 177ContentAlignment.TopLeft, 178ContentAlignment.TopRight, 179ContentAlignment.BottomCenter, 180ContentAlignment.BottomLeft, 181ContentAlignment.BottomRight, 182ContentAlignment.MiddleLeft, 183ContentAlignment.MiddleRight, 184ContentAlignment.TopCenter, 185ContentAlignment.MiddleCenter 190public void RadioButton_CheckAlign_Set_GetReturnsExpected(ContentAlignment value) 304foreach (ContentAlignment value in Enum.GetValues(typeof(ContentAlignment))) 314public void RadioRadioButton_TextAlign_Set_GetReturnsExpected(bool autoSize, FlatStyle flatStyle, ContentAlignment value) 340foreach (ContentAlignment value in Enum.GetValues(typeof(ContentAlignment))) 342int expectedCallCount = value == ContentAlignment.MiddleLeft ? 0 : 1; 353public void RadioRadioButton_TextAlign_SetWithHandle_GetReturnsExpected(bool autoSize, FlatStyle flatStyle, ContentAlignment value, int expectedInvalidatedCallCount, int expectedStyleChangedCallCount) 389[InvalidEnumData<ContentAlignment>] 390public void RadioRadioButton_TextAlign_SetInvalidValue_ThrowsInvalidEnumArgumentException(ContentAlignment value)
System\Windows\Forms\ToolStripButtonTests.cs (44)
60Assert.Equal(ContentAlignment.MiddleCenter, item.ImageAlign); 86Assert.Equal(ContentAlignment.MiddleCenter, item.TextAlign); 141Assert.Equal(ContentAlignment.MiddleCenter, item.ImageAlign); 167Assert.Equal(ContentAlignment.MiddleCenter, item.TextAlign); 228Assert.Equal(ContentAlignment.MiddleCenter, item.ImageAlign); 254Assert.Equal(ContentAlignment.MiddleCenter, item.TextAlign); 318Assert.Equal(ContentAlignment.MiddleCenter, item.ImageAlign); 344Assert.Equal(ContentAlignment.MiddleCenter, item.TextAlign); 406Assert.Equal(ContentAlignment.MiddleCenter, item.ImageAlign); 432Assert.Equal(ContentAlignment.MiddleCenter, item.TextAlign); 504Assert.Equal(ContentAlignment.MiddleCenter, item.ImageAlign); 530Assert.Equal(ContentAlignment.MiddleCenter, item.TextAlign); 1225yield return new object[] { ContentAlignment.MiddleCenter, RightToLeft.No, ToolStripItemDisplayStyle.None, 0, 0, TextFormatFlags.HorizontalCenter | TextFormatFlags.VerticalCenter | TextFormatFlags.HidePrefix }; 1226yield return new object[] { ContentAlignment.MiddleCenter, RightToLeft.No, ToolStripItemDisplayStyle.Image, 1, 0, TextFormatFlags.HorizontalCenter | TextFormatFlags.VerticalCenter | TextFormatFlags.HidePrefix }; 1227yield return new object[] { ContentAlignment.MiddleCenter, RightToLeft.No, ToolStripItemDisplayStyle.ImageAndText, 1, 1, TextFormatFlags.HorizontalCenter | TextFormatFlags.VerticalCenter | TextFormatFlags.HidePrefix }; 1229yield return new object[] { ContentAlignment.TopLeft, RightToLeft.Yes, ToolStripItemDisplayStyle.Text, 0, 1, TextFormatFlags.Left | TextFormatFlags.Top | TextFormatFlags.HidePrefix | TextFormatFlags.RightToLeft }; 1230yield return new object[] { ContentAlignment.TopLeft, RightToLeft.Inherit, ToolStripItemDisplayStyle.Text, 0, 1, TextFormatFlags.Left | TextFormatFlags.Top | TextFormatFlags.HidePrefix }; 1231yield return new object[] { ContentAlignment.TopLeft, RightToLeft.No, ToolStripItemDisplayStyle.Text, 0, 1, TextFormatFlags.Left | TextFormatFlags.Top | TextFormatFlags.HidePrefix }; 1232yield return new object[] { ContentAlignment.TopCenter, RightToLeft.Yes, ToolStripItemDisplayStyle.Text, 0, 1, TextFormatFlags.HorizontalCenter | TextFormatFlags.Top | TextFormatFlags.HidePrefix | TextFormatFlags.RightToLeft }; 1233yield return new object[] { ContentAlignment.TopCenter, RightToLeft.Inherit, ToolStripItemDisplayStyle.Text, 0, 1, TextFormatFlags.HorizontalCenter | TextFormatFlags.Top | TextFormatFlags.HidePrefix }; 1234yield return new object[] { ContentAlignment.TopCenter, RightToLeft.No, ToolStripItemDisplayStyle.Text, 0, 1, TextFormatFlags.HorizontalCenter | TextFormatFlags.Top | TextFormatFlags.HidePrefix }; 1235yield return new object[] { ContentAlignment.TopRight, RightToLeft.Yes, ToolStripItemDisplayStyle.Text, 0, 1, TextFormatFlags.Right | TextFormatFlags.Top | TextFormatFlags.HidePrefix | TextFormatFlags.RightToLeft }; 1236yield return new object[] { ContentAlignment.TopRight, RightToLeft.Inherit, ToolStripItemDisplayStyle.Text, 0, 1, TextFormatFlags.Right | TextFormatFlags.Top | TextFormatFlags.HidePrefix }; 1237yield return new object[] { ContentAlignment.TopRight, RightToLeft.No, ToolStripItemDisplayStyle.Text, 0, 1, TextFormatFlags.Right | TextFormatFlags.Top | TextFormatFlags.HidePrefix }; 1239yield return new object[] { ContentAlignment.MiddleLeft, RightToLeft.Yes, ToolStripItemDisplayStyle.Text, 0, 1, TextFormatFlags.Left | TextFormatFlags.VerticalCenter | TextFormatFlags.HidePrefix | TextFormatFlags.RightToLeft }; 1240yield return new object[] { ContentAlignment.MiddleLeft, RightToLeft.Inherit, ToolStripItemDisplayStyle.Text, 0, 1, TextFormatFlags.Left | TextFormatFlags.VerticalCenter | TextFormatFlags.HidePrefix }; 1241yield return new object[] { ContentAlignment.MiddleLeft, RightToLeft.No, ToolStripItemDisplayStyle.Text, 0, 1, TextFormatFlags.Left | TextFormatFlags.VerticalCenter | TextFormatFlags.HidePrefix }; 1242yield return new object[] { ContentAlignment.MiddleCenter, RightToLeft.Yes, ToolStripItemDisplayStyle.Text, 0, 1, TextFormatFlags.HorizontalCenter | TextFormatFlags.VerticalCenter | TextFormatFlags.HidePrefix | TextFormatFlags.RightToLeft }; 1243yield return new object[] { ContentAlignment.MiddleCenter, RightToLeft.Inherit, ToolStripItemDisplayStyle.Text, 0, 1, TextFormatFlags.HorizontalCenter | TextFormatFlags.VerticalCenter | TextFormatFlags.HidePrefix }; 1244yield return new object[] { ContentAlignment.MiddleCenter, RightToLeft.No, ToolStripItemDisplayStyle.Text, 0, 1, TextFormatFlags.HorizontalCenter | TextFormatFlags.VerticalCenter | TextFormatFlags.HidePrefix }; 1245yield return new object[] { ContentAlignment.MiddleRight, RightToLeft.Yes, ToolStripItemDisplayStyle.Text, 0, 1, TextFormatFlags.Right | TextFormatFlags.VerticalCenter | TextFormatFlags.HidePrefix | TextFormatFlags.RightToLeft }; 1246yield return new object[] { ContentAlignment.MiddleRight, RightToLeft.Inherit, ToolStripItemDisplayStyle.Text, 0, 1, TextFormatFlags.Right | TextFormatFlags.VerticalCenter | TextFormatFlags.HidePrefix }; 1247yield return new object[] { ContentAlignment.MiddleRight, RightToLeft.No, ToolStripItemDisplayStyle.Text, 0, 1, TextFormatFlags.Right | TextFormatFlags.VerticalCenter | TextFormatFlags.HidePrefix }; 1249yield return new object[] { ContentAlignment.BottomLeft, RightToLeft.Yes, ToolStripItemDisplayStyle.Text, 0, 1, TextFormatFlags.Left | TextFormatFlags.Bottom | TextFormatFlags.HidePrefix | TextFormatFlags.RightToLeft }; 1250yield return new object[] { ContentAlignment.BottomLeft, RightToLeft.Inherit, ToolStripItemDisplayStyle.Text, 0, 1, TextFormatFlags.Left | TextFormatFlags.Bottom | TextFormatFlags.HidePrefix }; 1251yield return new object[] { ContentAlignment.BottomLeft, RightToLeft.No, ToolStripItemDisplayStyle.Text, 0, 1, TextFormatFlags.Left | TextFormatFlags.Bottom | TextFormatFlags.HidePrefix }; 1252yield return new object[] { ContentAlignment.BottomCenter, RightToLeft.Yes, ToolStripItemDisplayStyle.Text, 0, 1, TextFormatFlags.HorizontalCenter | TextFormatFlags.Bottom | TextFormatFlags.HidePrefix | TextFormatFlags.RightToLeft }; 1253yield return new object[] { ContentAlignment.BottomCenter, RightToLeft.Inherit, ToolStripItemDisplayStyle.Text, 0, 1, TextFormatFlags.HorizontalCenter | TextFormatFlags.Bottom | TextFormatFlags.HidePrefix }; 1254yield return new object[] { ContentAlignment.BottomCenter, RightToLeft.No, ToolStripItemDisplayStyle.Text, 0, 1, TextFormatFlags.HorizontalCenter | TextFormatFlags.Bottom | TextFormatFlags.HidePrefix }; 1255yield return new object[] { ContentAlignment.BottomRight, RightToLeft.Yes, ToolStripItemDisplayStyle.Text, 0, 1, TextFormatFlags.Right | TextFormatFlags.Bottom | TextFormatFlags.HidePrefix | TextFormatFlags.RightToLeft }; 1256yield return new object[] { ContentAlignment.BottomRight, RightToLeft.Inherit, ToolStripItemDisplayStyle.Text, 0, 1, TextFormatFlags.Right | TextFormatFlags.Bottom | TextFormatFlags.HidePrefix }; 1257yield return new object[] { ContentAlignment.BottomRight, RightToLeft.No, ToolStripItemDisplayStyle.Text, 0, 1, TextFormatFlags.Right | TextFormatFlags.Bottom | TextFormatFlags.HidePrefix }; 1262public void ToolStripButton_OnPaint_InvokeWithOwner_DoesNotCallPaint(ContentAlignment textAlign, RightToLeft rightToLeft, ToolStripItemDisplayStyle displayStyle, int expectedRenderItemImageCallCount, int expectedRenderItemTextCallCount, TextFormatFlags expectedTextFormat) 1353public void ToolStripButton_OnPaint_InvokeWithOwnerCantShowKeyboardCues_DoesNotCallPaint(ContentAlignment textAlign, RightToLeft rightToLeft, ToolStripItemDisplayStyle displayStyle, int expectedRenderItemImageCallCount, int expectedRenderItemTextCallCount, TextFormatFlags expectedTextFormat)
System\Windows\Forms\ToolStripControlHostTests.cs (25)
70Assert.Equal(ContentAlignment.MiddleCenter, item.ControlAlign); 89Assert.Equal(ContentAlignment.MiddleCenter, item.ImageAlign); 115Assert.Equal(ContentAlignment.MiddleCenter, item.TextAlign); 695[EnumData<ContentAlignment>] 696public void ToolStripControlHost_ControlAlign_Set_GetReturnsExpected(ContentAlignment value) 720[EnumData<ContentAlignment>] 721public void ToolStripControlHost_ControlAlign_SetDisposed_GetReturnsExpected(ContentAlignment value) 738[InvalidEnumData<ContentAlignment>] 739[InlineData((ContentAlignment)int.MaxValue)] 740[InlineData((ContentAlignment)int.MinValue)] 741public void ToolStripControlHost_ControlAlign_SetInvalid_ThrowsInvalidEnumArgumentException(ContentAlignment value) 1239[EnumData<ContentAlignment>] 1240public void ToolStripControlHost_ImageAlign_Set_GetReturnsExpected(ContentAlignment value) 1257[InvalidEnumData<ContentAlignment>] 1258[InlineData((ContentAlignment)int.MaxValue)] 1259[InlineData((ContentAlignment)int.MinValue)] 1260public void ToolStripControlHost_ImageAlign_SetInvalid_ThrowsInvalidEnumArgumentException(ContentAlignment value) 2302[EnumData<ContentAlignment>] 2303public void ToolStripControlHost_TextAlign_Set_GetReturnsExpected(ContentAlignment value) 2318[InvalidEnumData<ContentAlignment>] 2319[InlineData((ContentAlignment)int.MaxValue)] 2320[InlineData((ContentAlignment)int.MinValue)] 2321public void ToolStripControlHost_TextAlign_SetInvalid_ThrowsInvalidEnumArgumentException(ContentAlignment value) 2765[EnumData<ContentAlignment>] 2766public void ToolStripControlHost_OnBoundsChanged_Invoke_Success(ContentAlignment controlAlign)
System\Windows\Forms\ToolStripDropDownItemTests.cs (8)
60Assert.Equal(ContentAlignment.MiddleCenter, item.ImageAlign); 86Assert.Equal(ContentAlignment.MiddleCenter, item.TextAlign); 149Assert.Equal(ContentAlignment.MiddleCenter, item.ImageAlign); 175Assert.Equal(ContentAlignment.MiddleCenter, item.TextAlign); 248Assert.Equal(ContentAlignment.MiddleCenter, item.ImageAlign); 274Assert.Equal(ContentAlignment.MiddleCenter, item.TextAlign); 356Assert.Equal(ContentAlignment.MiddleCenter, item.ImageAlign); 382Assert.Equal(ContentAlignment.MiddleCenter, item.TextAlign);
System\Windows\Forms\ToolStripItemTests.cs (66)
59Assert.Equal(ContentAlignment.MiddleCenter, item.ImageAlign); 85Assert.Equal(ContentAlignment.MiddleCenter, item.TextAlign); 144Assert.Equal(ContentAlignment.MiddleCenter, item.ImageAlign); 170Assert.Equal(ContentAlignment.MiddleCenter, item.TextAlign); 239Assert.Equal(ContentAlignment.MiddleCenter, item.ImageAlign); 265Assert.Equal(ContentAlignment.MiddleCenter, item.TextAlign); 4171[EnumData<ContentAlignment>] 4172public void ToolStripItem_ImageAlign_Set_GetReturnsExpected(ContentAlignment value) 4186[InlineData(ContentAlignment.TopLeft, 1)] 4187[InlineData(ContentAlignment.TopCenter, 1)] 4188[InlineData(ContentAlignment.TopRight, 1)] 4189[InlineData(ContentAlignment.MiddleLeft, 1)] 4190[InlineData(ContentAlignment.MiddleCenter, 0)] 4191[InlineData(ContentAlignment.MiddleRight, 1)] 4192[InlineData(ContentAlignment.BottomLeft, 1)] 4193[InlineData(ContentAlignment.BottomCenter, 1)] 4194[InlineData(ContentAlignment.BottomRight, 1)] 4195public void ToolStripItem_ImageAlign_SetWithOwner_GetReturnsExpected(ContentAlignment value, int expectedParentLayoutCallCount) 4233[InlineData(ContentAlignment.TopLeft, 1)] 4234[InlineData(ContentAlignment.TopCenter, 1)] 4235[InlineData(ContentAlignment.TopRight, 1)] 4236[InlineData(ContentAlignment.MiddleLeft, 1)] 4237[InlineData(ContentAlignment.MiddleCenter, 0)] 4238[InlineData(ContentAlignment.MiddleRight, 1)] 4239[InlineData(ContentAlignment.BottomLeft, 1)] 4240[InlineData(ContentAlignment.BottomCenter, 1)] 4241[InlineData(ContentAlignment.BottomRight, 1)] 4242public void ToolStripItem_ImageAlign_SetWithOwnerWithHandle_GetReturnsExpected(ContentAlignment value, int expectedParentLayoutCallCount) 4293[EnumData<ContentAlignment>] 4294public void ToolStripItem_ImageAlign_SetWithParent_GetReturnsExpected(ContentAlignment value) 4325[EnumData<ContentAlignment>] 4326public void ToolStripItem_ImageAlign_SetWithParentWithHandle_GetReturnsExpected(ContentAlignment value) 4370[InvalidEnumData<ContentAlignment>] 4371[InlineData((ContentAlignment)int.MaxValue)] 4372[InlineData((ContentAlignment)int.MinValue)] 4373public void ToolStripItem_ImageAlign_SetInvalid_ThrowsInvalidEnumArgumentException(ContentAlignment value) 8287[EnumData<ContentAlignment>] 8288public void ToolStripItem_TextAlign_Set_GetReturnsExpected(ContentAlignment value) 8302[InlineData(ContentAlignment.TopLeft, 1)] 8303[InlineData(ContentAlignment.TopCenter, 1)] 8304[InlineData(ContentAlignment.TopRight, 1)] 8305[InlineData(ContentAlignment.MiddleLeft, 1)] 8306[InlineData(ContentAlignment.MiddleCenter, 0)] 8307[InlineData(ContentAlignment.MiddleRight, 1)] 8308[InlineData(ContentAlignment.BottomLeft, 1)] 8309[InlineData(ContentAlignment.BottomCenter, 1)] 8310[InlineData(ContentAlignment.BottomRight, 1)] 8311public void ToolStripItem_TextAlign_SetWithOwner_GetReturnsExpected(ContentAlignment value, int expectedParentLayoutCallCount) 8349[InlineData(ContentAlignment.TopLeft, 1)] 8350[InlineData(ContentAlignment.TopCenter, 1)] 8351[InlineData(ContentAlignment.TopRight, 1)] 8352[InlineData(ContentAlignment.MiddleLeft, 1)] 8353[InlineData(ContentAlignment.MiddleCenter, 0)] 8354[InlineData(ContentAlignment.MiddleRight, 1)] 8355[InlineData(ContentAlignment.BottomLeft, 1)] 8356[InlineData(ContentAlignment.BottomCenter, 1)] 8357[InlineData(ContentAlignment.BottomRight, 1)] 8358public void ToolStripItem_TextAlign_SetWithOwnerWithHandle_GetReturnsExpected(ContentAlignment value, int expectedParentLayoutCallCount) 8409[EnumData<ContentAlignment>] 8410public void ToolStripItem_TextAlign_SetWithParent_GetReturnsExpected(ContentAlignment value) 8441[EnumData<ContentAlignment>] 8442public void ToolStripItem_TextAlign_SetWithParentWithHandle_GetReturnsExpected(ContentAlignment value) 8486[InvalidEnumData<ContentAlignment>] 8487[InlineData((ContentAlignment)int.MaxValue)] 8488[InlineData((ContentAlignment)int.MinValue)] 8489public void ToolStripItem_TextAlign_SetInvalid_ThrowsInvalidEnumArgumentException(ContentAlignment value)
System\Windows\Forms\ToolStripItemTextRenderEventArgsTests.cs (6)
37yield return new object[] { new ToolStripButton(), null, Rectangle.Empty, Color.Empty, null, ContentAlignment.TopLeft - 1, TextFormatFlags.Default | TextFormatFlags.Top | TextFormatFlags.HidePrefix }; 38yield 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 }; 39yield 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 }; 40yield 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 }; 45public void Ctor_ToolStripItem_String_Rectangle_Color_Font_ContentAlignment(ToolStripItem item, string text, Rectangle textRectangle, Color textColor, Font textFont, ContentAlignment textAlign, TextFormatFlags expectedTextFormat) 67Assert.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)
64Assert.Equal(ContentAlignment.MiddleCenter, item.ImageAlign); 95Assert.Equal(ContentAlignment.MiddleCenter, item.TextAlign); 289ImageAlign = ContentAlignment.BottomCenter, 303TextAlign = ContentAlignment.BottomRight,
System\Windows\Forms\ToolStripSeparatorTests.cs (14)
57Assert.Equal(ContentAlignment.MiddleCenter, item.ImageAlign); 83Assert.Equal(ContentAlignment.MiddleCenter, item.TextAlign); 446[EnumData<ContentAlignment>] 447public void ToolStripSeparator_ImageAlign_Set_GetReturnsExpected(ContentAlignment value) 461[InvalidEnumData<ContentAlignment>] 462[InlineData((ContentAlignment)int.MaxValue)] 463[InlineData((ContentAlignment)int.MinValue)] 464public void ToolStripSeparator_ImageAlign_SetInvalid_ThrowsInvalidEnumArgumentException(ContentAlignment value) 623[EnumData<ContentAlignment>] 624public void ToolStripSeparator_TextAlign_Set_GetReturnsExpected(ContentAlignment value) 638[InvalidEnumData<ContentAlignment>] 639[InlineData((ContentAlignment)int.MaxValue)] 640[InlineData((ContentAlignment)int.MinValue)] 641public 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