655 references to ContentAlignment
PresentationUI (2)
MS\Internal\Documents\Application\DocumentPropertiesDialog.Designer.cs (1)
396
this._descriptionLabel.ImageAlign = System.Drawing.
ContentAlignment
.TopLeft;
MS\Internal\Documents\RMPermissions.Designer.cs (1)
123
this.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)
10489
protected
ContentAlignment
RtlTranslateAlignment(
ContentAlignment
align)
10531
protected internal
ContentAlignment
RtlTranslateContent(
ContentAlignment
align)
10539
case
ContentAlignment
.TopLeft:
10540
return
ContentAlignment
.TopRight;
10541
case
ContentAlignment
.TopRight:
10542
return
ContentAlignment
.TopLeft;
10550
case
ContentAlignment
.MiddleLeft:
10551
return
ContentAlignment
.MiddleRight;
10552
case
ContentAlignment
.MiddleRight:
10553
return
ContentAlignment
.MiddleLeft;
10561
case
ContentAlignment
.BottomLeft:
10562
return
ContentAlignment
.BottomRight;
10563
case
ContentAlignment
.BottomRight:
10564
return
ContentAlignment
.BottomLeft;
System\Windows\Forms\Controls\Buttons\ButtonBase.cs (9)
21
private
ContentAlignment
_imageAlign =
ContentAlignment
.MiddleCenter;
22
private
ContentAlignment
_textAlign =
ContentAlignment
.MiddleCenter;
274
ContentAlignment
align = RtlTranslateContent(TextAlign);
424
[DefaultValue(
ContentAlignment
.MiddleCenter)]
428
public
ContentAlignment
ImageAlign
670
[DefaultValue(
ContentAlignment
.MiddleCenter)]
674
public virtual
ContentAlignment
TextAlign
System\Windows\Forms\Controls\Buttons\ButtonInternal\ButtonBaseAdapter.cs (4)
562
ContentAlignment
textAlign,
578
CheckAlign =
ContentAlignment
.TopLeft,
579
ImageAlign =
ContentAlignment
.MiddleCenter,
605
CheckAlign =
ContentAlignment
.TopLeft,
System\Windows\Forms\Controls\Buttons\ButtonInternal\ButtonBaseAdapter.LayoutOptions.cs (30)
35
public
ContentAlignment
CheckAlign { get; set; }
36
public
ContentAlignment
ImageAlign { get; set; }
37
public
ContentAlignment
TextAlign { get; set; }
181
CheckAlign ==
ContentAlignment
.MiddleCenter || !LayoutUtils.IsHorizontalAlignment(CheckAlign);
243
action[s_combineCheck] = CheckAlign ==
ContentAlignment
.MiddleCenter || !LayoutUtils.IsVerticalAlignment(CheckAlign);
326
internal
ContentAlignment
RtlTranslateContent(
ContentAlignment
align)
330
ContentAlignment
[][] mapping =
332
[
ContentAlignment
.TopLeft,
ContentAlignment
.TopRight],
333
[
ContentAlignment
.MiddleLeft,
ContentAlignment
.MiddleRight],
334
[
ContentAlignment
.BottomLeft,
ContentAlignment
.BottomRight],
361
ContentAlignment
align = RtlTranslateContent(CheckAlign);
396
case
ContentAlignment
.TopLeft:
397
case
ContentAlignment
.MiddleLeft:
398
case
ContentAlignment
.BottomLeft:
408
case
ContentAlignment
.TopRight:
409
case
ContentAlignment
.MiddleRight:
410
case
ContentAlignment
.BottomRight:
419
case
ContentAlignment
.TopCenter:
430
case
ContentAlignment
.BottomCenter:
440
case
ContentAlignment
.MiddleCenter:
451
/// For example, <see cref="
ContentAlignment
.TopLeft"/> maps to <see cref="TextImageRelation.ImageAboveText"/>
469
private static TextImageRelation ImageAlignToRelation(
ContentAlignment
alignment)
472
private static TextImageRelation TextAlignToRelation(
ContentAlignment
alignment)
478
ContentAlignment
imageAlign = RtlTranslateContent(ImageAlign);
479
ContentAlignment
textAlign = RtlTranslateContent(TextAlign);
515
Rectangle combinedBounds = LayoutUtils.Align(combinedSize, maxCombinedBounds,
ContentAlignment
.MiddleCenter);
System\Windows\Forms\Controls\Buttons\ButtonInternal\ButtonFlatAdapter.cs (1)
305
ContentAlignment
textAlign,
System\Windows\Forms\Controls\Buttons\ButtonInternal\ButtonPopupAdapter.cs (1)
157
ContentAlignment
textAlign,
System\Windows\Forms\Controls\Buttons\ButtonInternal\CheckBoxPopupAdapter.cs (1)
138
ContentAlignment
textAlign,
System\Windows\Forms\Controls\Buttons\CheckBox.cs (12)
26
private const
ContentAlignment
AnyRight =
ContentAlignment
.TopRight |
ContentAlignment
.MiddleRight |
ContentAlignment
.BottomRight;
28
private
ContentAlignment
_checkAlign =
ContentAlignment
.MiddleLeft;
49
TextAlign =
ContentAlignment
.MiddleLeft;
113
[DefaultValue(
ContentAlignment
.MiddleLeft)]
115
public
ContentAlignment
CheckAlign
240
ContentAlignment
align = RtlTranslateContent(CheckAlign);
335
[DefaultValue(
ContentAlignment
.MiddleLeft)]
336
public override
ContentAlignment
TextAlign
System\Windows\Forms\Controls\Buttons\RadioButton.cs (12)
27
private const
ContentAlignment
AnyRight =
ContentAlignment
.TopRight |
ContentAlignment
.MiddleRight |
ContentAlignment
.BottomRight;
33
private
ContentAlignment
_checkAlign =
ContentAlignment
.MiddleLeft;
48
TextAlign =
ContentAlignment
.MiddleLeft;
120
[DefaultValue(
ContentAlignment
.MiddleLeft)]
122
public
ContentAlignment
CheckAlign
208
ContentAlignment
align = RtlTranslateContent(CheckAlign);
305
[DefaultValue(
ContentAlignment
.MiddleLeft)]
306
public override
ContentAlignment
TextAlign
System\Windows\Forms\Controls\DataGridView\DataGridViewUtilities.cs (11)
20
internal static
ContentAlignment
ComputeDrawingContentAlignmentForCellStyleAlignment(DataGridViewContentAlignment alignment) =>
24
DataGridViewContentAlignment.TopLeft =>
ContentAlignment
.TopLeft,
25
DataGridViewContentAlignment.TopCenter =>
ContentAlignment
.TopCenter,
26
DataGridViewContentAlignment.TopRight =>
ContentAlignment
.TopRight,
27
DataGridViewContentAlignment.MiddleLeft =>
ContentAlignment
.MiddleLeft,
28
DataGridViewContentAlignment.MiddleCenter =>
ContentAlignment
.MiddleCenter,
29
DataGridViewContentAlignment.MiddleRight =>
ContentAlignment
.MiddleRight,
30
DataGridViewContentAlignment.BottomLeft =>
ContentAlignment
.BottomLeft,
31
DataGridViewContentAlignment.BottomCenter =>
ContentAlignment
.BottomCenter,
32
DataGridViewContentAlignment.BottomRight =>
ContentAlignment
.BottomRight,
33
_ =>
ContentAlignment
.MiddleCenter,
System\Windows\Forms\Controls\Labels\Label.cs (21)
269
case
ContentAlignment
.TopLeft:
270
case
ContentAlignment
.MiddleLeft:
271
case
ContentAlignment
.BottomLeft:
274
case
ContentAlignment
.TopRight:
275
case
ContentAlignment
.MiddleRight:
276
case
ContentAlignment
.BottomRight:
279
case
ContentAlignment
.TopCenter:
280
case
ContentAlignment
.MiddleCenter:
281
case
ContentAlignment
.BottomCenter:
546
[DefaultValue(
ContentAlignment
.MiddleCenter)]
550
public
ContentAlignment
ImageAlign
552
get => Properties.GetValueOrDefault(s_propImageAlign,
ContentAlignment
.MiddleCenter);
559
Properties.AddOrRemoveValue(s_propImageAlign, value, defaultValue:
ContentAlignment
.MiddleCenter);
692
[DefaultValue(
ContentAlignment
.TopLeft)]
694
public virtual
ContentAlignment
TextAlign
696
get => Properties.GetValueOrDefault(s_propTextAlign,
ContentAlignment
.TopLeft);
703
Properties.AddOrRemoveValue(s_propTextAlign, value, defaultValue:
ContentAlignment
.TopLeft);
873
protected Rectangle CalcImageRenderBounds(Image image, Rectangle r,
ContentAlignment
align)
966
private void DrawImage(PaintEventArgs e, Image image, Rectangle r,
ContentAlignment
align)
982
protected void DrawImage(Graphics g, Image image, Rectangle r,
ContentAlignment
align)
985
private void DrawImageInternal(Graphics g, Image image, Rectangle r,
ContentAlignment
align)
System\Windows\Forms\Controls\Labels\LinkLabel.cs (1)
372
internal static Rectangle CalcTextRenderBounds(Rectangle textRect, Rectangle clientRect,
ContentAlignment
align)
System\Windows\Forms\Controls\PropertyGrid\PropertyGridInternal\GridErrorDialog.cs (1)
147
ImageAlign =
ContentAlignment
.MiddleLeft,
System\Windows\Forms\Controls\ToolStrips\ToolStripControlHost.cs (6)
18
private
ContentAlignment
_controlAlign =
ContentAlignment
.MiddleCenter;
99
[DefaultValue(
ContentAlignment
.MiddleCenter)]
101
public
ContentAlignment
ControlAlign
259
public new
ContentAlignment
ImageAlign
411
public 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)
36
private
ContentAlignment
_imageAlign =
ContentAlignment
.MiddleCenter;
37
private
ContentAlignment
_textAlign =
ContentAlignment
.MiddleCenter;
996
[DefaultValue(
ContentAlignment
.MiddleCenter)]
1000
public
ContentAlignment
ImageAlign
1879
[DefaultValue(
ContentAlignment
.MiddleCenter)]
1883
public virtual
ContentAlignment
TextAlign
System\Windows\Forms\Controls\ToolStrips\ToolStripItem.ToolStripItemInternalLayout.cs (2)
82
internal static TextFormatFlags ContentAlignmentToTextFormat(
ContentAlignment
alignment, bool rightToLeft)
114
layoutOptions.CheckAlign =
ContentAlignment
.TopLeft;
System\Windows\Forms\Controls\ToolStrips\ToolStripItemTextRenderEventArgs.cs (1)
49
ContentAlignment
textAlign)
System\Windows\Forms\Controls\ToolStrips\ToolStripMenuItem.cs (4)
994
renderer.DrawItemText(new ToolStripItemTextRenderEventArgs(g, this, Text, InternalLayout.TextRectangle, textColor, Font, (rightToLeft) ?
ContentAlignment
.MiddleRight :
ContentAlignment
.MiddleLeft));
1003
renderer.DrawItemText(new ToolStripItemTextRenderEventArgs(g, this, GetShortcutText(), InternalLayout.TextRectangle, textColor, Font, (rightToLeft) ?
ContentAlignment
.MiddleLeft :
ContentAlignment
.MiddleRight));
System\Windows\Forms\Controls\ToolStrips\ToolStripMenuItem.ToolStripMenuItemInternalLayout.cs (2)
74
arrowRect.Y = LayoutUtils.VAlign(arrowRect.Size, _ownerItem.ClientBounds,
ContentAlignment
.MiddleCenter).Y;
130
imageRect.Y = LayoutUtils.VAlign(imageRect.Size, _ownerItem.ClientBounds,
ContentAlignment
.MiddleCenter).Y;
System\Windows\Forms\Controls\ToolStrips\ToolStripScrollButton.cs (1)
42
ImageAlign =
ContentAlignment
.MiddleCenter,
System\Windows\Forms\Controls\ToolStrips\ToolStripSeparator.cs (2)
114
public new
ContentAlignment
ImageAlign
211
public new
ContentAlignment
TextAlign
System\Windows\Forms\Dialogs\ThreadExceptionDialog.cs (1)
296
button.ImageAlign =
ContentAlignment
.MiddleLeft;
System\Windows\Forms\Internal\WinFormsUtils.cs (24)
13
public const
ContentAlignment
AnyRightAlign =
ContentAlignment
.TopRight |
ContentAlignment
.MiddleRight |
ContentAlignment
.BottomRight;
14
public const
ContentAlignment
AnyLeftAlign =
ContentAlignment
.TopLeft |
ContentAlignment
.MiddleLeft |
ContentAlignment
.BottomLeft;
15
public const
ContentAlignment
AnyTopAlign =
ContentAlignment
.TopLeft |
ContentAlignment
.TopCenter |
ContentAlignment
.TopRight;
16
public const
ContentAlignment
AnyBottomAlign =
ContentAlignment
.BottomLeft |
ContentAlignment
.BottomCenter |
ContentAlignment
.BottomRight;
17
public const
ContentAlignment
AnyMiddleAlign =
ContentAlignment
.MiddleLeft |
ContentAlignment
.MiddleCenter |
ContentAlignment
.MiddleRight;
18
public const
ContentAlignment
AnyCenterAlign =
ContentAlignment
.TopCenter |
ContentAlignment
.MiddleCenter |
ContentAlignment
.BottomCenter;
System\Windows\Forms\Layout\CommonProperties.cs (2)
26
internal const
ContentAlignment
DefaultAlignment =
ContentAlignment
.TopLeft;
System\Windows\Forms\Layout\LayoutUtils.cs (42)
18
public const
ContentAlignment
AnyTop =
ContentAlignment
.TopLeft |
ContentAlignment
.TopCenter |
ContentAlignment
.TopRight;
19
public const
ContentAlignment
AnyBottom =
ContentAlignment
.BottomLeft |
ContentAlignment
.BottomCenter |
ContentAlignment
.BottomRight;
20
public const
ContentAlignment
AnyLeft =
ContentAlignment
.TopLeft |
ContentAlignment
.MiddleLeft |
ContentAlignment
.BottomLeft;
21
public const
ContentAlignment
AnyRight =
ContentAlignment
.TopRight |
ContentAlignment
.MiddleRight |
ContentAlignment
.BottomRight;
22
public const
ContentAlignment
AnyCenter =
ContentAlignment
.TopCenter |
ContentAlignment
.MiddleCenter |
ContentAlignment
.BottomCenter;
23
public const
ContentAlignment
AnyMiddle =
ContentAlignment
.MiddleLeft |
ContentAlignment
.MiddleCenter |
ContentAlignment
.MiddleRight;
72
public static int ContentAlignmentToIndex(
ContentAlignment
alignment)
100
Debug.Assert(result != 0x00 || alignment ==
ContentAlignment
.TopLeft, "Error detected in ContentAlignmentToIndex.");
101
Debug.Assert(result != 0x01 || alignment ==
ContentAlignment
.TopCenter, "Error detected in ContentAlignmentToIndex.");
102
Debug.Assert(result != 0x02 || alignment ==
ContentAlignment
.TopRight, "Error detected in ContentAlignmentToIndex.");
104
Debug.Assert(result != 0x04 || alignment ==
ContentAlignment
.MiddleLeft, "Error detected in ContentAlignmentToIndex.");
105
Debug.Assert(result != 0x05 || alignment ==
ContentAlignment
.MiddleCenter, "Error detected in ContentAlignmentToIndex.");
106
Debug.Assert(result != 0x06 || alignment ==
ContentAlignment
.MiddleRight, "Error detected in ContentAlignmentToIndex.");
108
Debug.Assert(result != 0x08 || alignment ==
ContentAlignment
.BottomLeft, "Error detected in ContentAlignmentToIndex.");
109
Debug.Assert(result != 0x09 || alignment ==
ContentAlignment
.BottomCenter, "Error detected in ContentAlignmentToIndex.");
110
Debug.Assert(result != 0x0A || alignment ==
ContentAlignment
.BottomRight, "Error detected in ContentAlignmentToIndex.");
285
public static Rectangle Align(Size alignThis, Rectangle withinThis,
ContentAlignment
align)
306
private static Rectangle HAlign(Size alignThis, Rectangle withinThis,
ContentAlignment
align)
338
public static Rectangle VAlign(Size alignThis, Rectangle withinThis,
ContentAlignment
align)
465
public static bool IsHorizontalAlignment(
ContentAlignment
align)
476
public static bool IsVerticalAlignment(
ContentAlignment
align)
478
Debug.Assert(align !=
ContentAlignment
.MiddleCenter, "Result is ambiguous with an alignment of MiddleCenter.");
479
return (align & (
ContentAlignment
.TopCenter |
ContentAlignment
.BottomCenter)) != 0;
System\Windows\Forms\Rendering\ControlPaint.cs (19)
57
private const
ContentAlignment
AnyRight
58
=
ContentAlignment
.TopRight |
ContentAlignment
.MiddleRight |
ContentAlignment
.BottomRight;
59
private const
ContentAlignment
AnyBottom
60
=
ContentAlignment
.BottomLeft |
ContentAlignment
.BottomCenter |
ContentAlignment
.BottomRight;
61
private const
ContentAlignment
AnyCenter
62
=
ContentAlignment
.TopCenter |
ContentAlignment
.MiddleCenter |
ContentAlignment
.BottomCenter;
63
private const
ContentAlignment
AnyMiddle
64
=
ContentAlignment
.MiddleLeft |
ContentAlignment
.MiddleCenter |
ContentAlignment
.MiddleRight;
2503
internal static TextFormatFlags ConvertAlignmentToTextFormat(
ContentAlignment
alignment)
2534
ContentAlignment
textAlign,
2588
ContentAlignment
alignment,
System.Windows.Forms.Design (54)
System\ComponentModel\Design\DesignerActionPanel.CheckBoxPropertyLine.cs (2)
21
CheckAlign =
ContentAlignment
.MiddleLeft,
22
TextAlign =
ContentAlignment
.MiddleLeft,
System\ComponentModel\Design\DesignerActionPanel.MethodLine.cs (1)
26
TextAlign =
ContentAlignment
.MiddleLeft,
System\ComponentModel\Design\DesignerActionPanel.PanelHeaderLine.cs (2)
27
TextAlign =
ContentAlignment
.MiddleLeft,
35
TextAlign =
ContentAlignment
.MiddleLeft,
System\ComponentModel\Design\DesignerActionPanel.TextBoxPropertyLine.cs (2)
28
TextAlign =
ContentAlignment
.MiddleLeft,
37
TextAlign =
ContentAlignment
.TopLeft,
System\ComponentModel\Design\DesignerActionPanel.TextLine.cs (1)
24
TextAlign =
ContentAlignment
.MiddleLeft,
System\Drawing\Design\ContentAlignmentEditor.ContentUI.cs (21)
30
private
ContentAlignment
Align
36
return
ContentAlignment
.TopLeft;
40
return
ContentAlignment
.TopCenter;
44
return
ContentAlignment
.TopRight;
48
return
ContentAlignment
.MiddleLeft;
52
return
ContentAlignment
.MiddleCenter;
56
return
ContentAlignment
.MiddleRight;
60
return
ContentAlignment
.BottomLeft;
64
return
ContentAlignment
.BottomCenter;
68
return
ContentAlignment
.BottomRight;
75
case
ContentAlignment
.TopLeft:
78
case
ContentAlignment
.TopCenter:
81
case
ContentAlignment
.TopRight:
84
case
ContentAlignment
.MiddleLeft:
87
case
ContentAlignment
.MiddleCenter:
90
case
ContentAlignment
.MiddleRight:
93
case
ContentAlignment
.BottomLeft:
96
case
ContentAlignment
.BottomCenter:
99
case
ContentAlignment
.BottomRight:
453
=> Align = Value is
ContentAlignment
contentAligment ? contentAligment :
ContentAlignment
.MiddleLeft;
System\Windows\Forms\Design\ButtonBaseDesigner.cs (5)
52
ContentAlignment
alignment =
ContentAlignment
.MiddleCenter;
108
private static int CheckboxBaselineOffset(
ContentAlignment
alignment, FlatStyle flatStyle)
164
private static int RadiobuttonBaselineOffset(
ContentAlignment
alignment, FlatStyle flatStyle)
195
private static int DefaultBaselineOffset(
ContentAlignment
alignment, FlatStyle flatStyle)
System\Windows\Forms\Design\ComboBoxDesigner.cs (1)
35
int baseline = DesignerUtils.GetTextBaseline(Control, Drawing.
ContentAlignment
.TopLeft);
System\Windows\Forms\Design\DateTimePickerDesigner.cs (1)
27
int baseline = DesignerUtils.GetTextBaseline(Control,
ContentAlignment
.MiddleLeft);
System\Windows\Forms\Design\DesignBindingPicker.cs (4)
150
TextAlign =
ContentAlignment
.MiddleLeft,
189
TextAlign =
ContentAlignment
.TopLeft,
277
TextAlign =
ContentAlignment
.MiddleLeft,
321
TextAlign =
ContentAlignment
.TopLeft,
System\Windows\Forms\Design\DesignerUtils.cs (9)
107
public const
ContentAlignment
AnyTopAlignment =
ContentAlignment
.TopLeft |
ContentAlignment
.TopCenter |
ContentAlignment
.TopRight;
108
public const
ContentAlignment
AnyMiddleAlignment =
ContentAlignment
.MiddleLeft |
ContentAlignment
.MiddleCenter |
ContentAlignment
.MiddleRight;
524
public static unsafe int GetTextBaseline(Control ctrl,
ContentAlignment
alignment)
System\Windows\Forms\Design\LabelDesigner.cs (3)
33
ContentAlignment
alignment =
ContentAlignment
.TopLeft;
99
private static int LabelBaselineOffset(
ContentAlignment
alignment, BorderStyle borderStyle)
System\Windows\Forms\Design\TextBoxBaseDesigner.cs (1)
29
int baseline = DesignerUtils.GetTextBaseline(Control, Drawing.
ContentAlignment
.TopLeft);
System\Windows\Forms\Design\UpDownBaseDesigner.cs (1)
45
int 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)
60
int expectedBaseline = DesignerUtils.GetTextBaseline(_numericUpDown, Drawing.
ContentAlignment
.TopLeft) + expectedBaselineOffset;
System.Windows.Forms.Tests (352)
System\Windows\Forms\ButtonBaseTests.cs (66)
74
Assert.Equal(
ContentAlignment
.MiddleCenter, control.ImageAlign);
111
Assert.Equal(
ContentAlignment
.MiddleCenter, control.TextAlign);
182
foreach (
ContentAlignment
textAlign in Enum.GetValues(typeof(
ContentAlignment
)))
190
yield return new object[] { FlatStyle.System, RightToLeft.Yes,
ContentAlignment
.BottomLeft, 0x56012A00, 0x6000 };
191
yield return new object[] { FlatStyle.System, RightToLeft.Yes,
ContentAlignment
.BottomCenter, 0x56012B00, 0x6000 };
192
yield return new object[] { FlatStyle.System, RightToLeft.Yes,
ContentAlignment
.BottomRight, 0x56012900, 0x6000 };
193
yield return new object[] { FlatStyle.System, RightToLeft.Yes,
ContentAlignment
.MiddleLeft, 0x56012E00, 0x6000 };
194
yield return new object[] { FlatStyle.System, RightToLeft.Yes,
ContentAlignment
.MiddleCenter, 0x56012F00, 0x6000 };
195
yield return new object[] { FlatStyle.System, RightToLeft.Yes,
ContentAlignment
.MiddleRight, 0x56012D00, 0x6000 };
196
yield return new object[] { FlatStyle.System, RightToLeft.Yes,
ContentAlignment
.TopLeft, 0x56012600, 0x6000 };
197
yield return new object[] { FlatStyle.System, RightToLeft.Yes,
ContentAlignment
.TopCenter, 0x56012700, 0x6000 };
198
yield return new object[] { FlatStyle.System, RightToLeft.Yes,
ContentAlignment
.TopRight, 0x56012500, 0x6000 };
200
yield return new object[] { FlatStyle.System, RightToLeft.No,
ContentAlignment
.BottomLeft, 0x56012900, 0 };
201
yield return new object[] { FlatStyle.System, RightToLeft.No,
ContentAlignment
.BottomCenter, 0x56012B00, 0 };
202
yield return new object[] { FlatStyle.System, RightToLeft.No,
ContentAlignment
.BottomRight, 0x56012A00, 0 };
203
yield return new object[] { FlatStyle.System, RightToLeft.No,
ContentAlignment
.MiddleLeft, 0x56012D00, 0 };
204
yield return new object[] { FlatStyle.System, RightToLeft.No,
ContentAlignment
.MiddleCenter, 0x56012F00, 0 };
205
yield return new object[] { FlatStyle.System, RightToLeft.No,
ContentAlignment
.MiddleRight, 0x56012E00, 0 };
206
yield return new object[] { FlatStyle.System, RightToLeft.No,
ContentAlignment
.TopLeft, 0x56012500, 0 };
207
yield return new object[] { FlatStyle.System, RightToLeft.No,
ContentAlignment
.TopCenter, 0x56012700, 0 };
208
yield return new object[] { FlatStyle.System, RightToLeft.No,
ContentAlignment
.TopRight, 0x56012600, 0 };
210
yield return new object[] { FlatStyle.System, RightToLeft.Inherit,
ContentAlignment
.BottomLeft, 0x56012900, 0 };
211
yield return new object[] { FlatStyle.System, RightToLeft.Inherit,
ContentAlignment
.BottomCenter, 0x56012B00, 0 };
212
yield return new object[] { FlatStyle.System, RightToLeft.Inherit,
ContentAlignment
.BottomRight, 0x56012A00, 0 };
213
yield return new object[] { FlatStyle.System, RightToLeft.Inherit,
ContentAlignment
.MiddleLeft, 0x56012D00, 0 };
214
yield return new object[] { FlatStyle.System, RightToLeft.Inherit,
ContentAlignment
.MiddleCenter, 0x56012F00, 0 };
215
yield return new object[] { FlatStyle.System, RightToLeft.Inherit,
ContentAlignment
.MiddleRight, 0x56012E00, 0 };
216
yield return new object[] { FlatStyle.System, RightToLeft.Inherit,
ContentAlignment
.TopLeft, 0x56012500, 0 };
217
yield return new object[] { FlatStyle.System, RightToLeft.Inherit,
ContentAlignment
.TopCenter, 0x56012700, 0 };
218
yield return new object[] { FlatStyle.System, RightToLeft.Inherit,
ContentAlignment
.TopRight, 0x56012600, 0 };
223
public void ButtonBase_CreateParams_GetTextAlign_ReturnsExpected(FlatStyle flatStyle, RightToLeft rightToLeft,
ContentAlignment
textAlign, int expectedStyle, int expectedExStyle)
1841
foreach (
ContentAlignment
value in Enum.GetValues(typeof(
ContentAlignment
)))
1850
public void ButtonBase_ImageAlign_Set_GetReturnsExpected(bool autoSize,
ContentAlignment
value)
1873
foreach (
ContentAlignment
value in Enum.GetValues(typeof(
ContentAlignment
)))
1875
int expectedCallCount = value ==
ContentAlignment
.MiddleCenter ? 0 : 1;
1883
public void ButtonBase_ImageAlign_SetWithParent_GetReturnsExpected(bool autoSize,
ContentAlignment
value, int expectedParentLayoutCallCount)
1931
foreach (
ContentAlignment
value in Enum.GetValues(typeof(
ContentAlignment
)))
1933
int expectedCallCount = value ==
ContentAlignment
.MiddleCenter ? 0 : 1;
1941
public void ButtonBase_ImageAlign_SetWithHandle_GetReturnsExpected(bool autoSize,
ContentAlignment
value, int expectedInvalidatedCallCount)
1977
foreach (
ContentAlignment
value in Enum.GetValues(typeof(
ContentAlignment
)))
1979
int expectedCallCount = value ==
ContentAlignment
.MiddleCenter ? 0 : 1;
1987
public void ButtonBase_ImageAlign_SetWithParentWithHandle_GetReturnsExpected(bool autoSize,
ContentAlignment
value, int expectedParentLayoutCallCount, int expectedInvalidatedCallCount)
2046
[InvalidEnumData<
ContentAlignment
>]
2047
public void ButtonBase_ImageAlign_SetInvalid_ThrowsInvalidEnumArgumentException(
ContentAlignment
value)
3266
foreach (
ContentAlignment
value in Enum.GetValues(typeof(
ContentAlignment
)))
3276
public void ButtonBase_TextAlign_Set_GetReturnsExpected(bool autoSize, FlatStyle flatStyle,
ContentAlignment
value)
3302
foreach (
ContentAlignment
value in Enum.GetValues(typeof(
ContentAlignment
)))
3304
int expectedCallCount = value ==
ContentAlignment
.MiddleCenter ? 0 : 1;
3313
public void ButtonBase_TextAlign_SetWithParent_GetReturnsExpected(bool autoSize, FlatStyle flatStyle,
ContentAlignment
value, int expectedParentLayoutCallCount)
3362
foreach (
ContentAlignment
value in Enum.GetValues(typeof(
ContentAlignment
)))
3364
int expectedCallCount = value ==
ContentAlignment
.MiddleCenter ? 0 : 1;
3375
public void ButtonBase_TextAlign_SetWithHandle_GetReturnsExpected(bool autoSize, FlatStyle flatStyle,
ContentAlignment
value, int expectedInvalidatedCallCount, int expectedStyleChangedCallCount)
3412
foreach (
ContentAlignment
value in Enum.GetValues(typeof(
ContentAlignment
)))
3414
int expectedCallCount = value ==
ContentAlignment
.MiddleCenter ? 0 : 1;
3429
public void ButtonBase_TextAlign_SetWithParentWithHandle_GetReturnsExpected(bool autoSize, FlatStyle flatStyle,
ContentAlignment
value, int expectedParentLayoutCallCount, int expectedInvalidatedCallCount, int expectedStyleChangedCallCount)
3489
[InvalidEnumData<
ContentAlignment
>]
3490
public void ButtonBase_TextAlign_SetInvalidValue_ThrowsInvalidEnumArgumentException(
ContentAlignment
value)
System\Windows\Forms\ButtonTests.cs (32)
77
Assert.Equal(
ContentAlignment
.MiddleCenter, control.ImageAlign);
109
Assert.Equal(
ContentAlignment
.MiddleCenter, control.TextAlign);
204
foreach (
ContentAlignment
textAlign in Enum.GetValues(typeof(
ContentAlignment
)))
212
yield return new object[] { FlatStyle.System, RightToLeft.Yes,
ContentAlignment
.BottomLeft, 0x56012A00, 0x6000 };
213
yield return new object[] { FlatStyle.System, RightToLeft.Yes,
ContentAlignment
.BottomCenter, 0x56012B00, 0x6000 };
214
yield return new object[] { FlatStyle.System, RightToLeft.Yes,
ContentAlignment
.BottomRight, 0x56012900, 0x6000 };
215
yield return new object[] { FlatStyle.System, RightToLeft.Yes,
ContentAlignment
.MiddleLeft, 0x56012E00, 0x6000 };
216
yield return new object[] { FlatStyle.System, RightToLeft.Yes,
ContentAlignment
.MiddleCenter, 0x56012F00, 0x6000 };
217
yield return new object[] { FlatStyle.System, RightToLeft.Yes,
ContentAlignment
.MiddleRight, 0x56012D00, 0x6000 };
218
yield return new object[] { FlatStyle.System, RightToLeft.Yes,
ContentAlignment
.TopLeft, 0x56012600, 0x6000 };
219
yield return new object[] { FlatStyle.System, RightToLeft.Yes,
ContentAlignment
.TopCenter, 0x56012700, 0x6000 };
220
yield return new object[] { FlatStyle.System, RightToLeft.Yes,
ContentAlignment
.TopRight, 0x56012500, 0x6000 };
222
yield return new object[] { FlatStyle.System, RightToLeft.No,
ContentAlignment
.BottomLeft, 0x56012900, 0 };
223
yield return new object[] { FlatStyle.System, RightToLeft.No,
ContentAlignment
.BottomCenter, 0x56012B00, 0 };
224
yield return new object[] { FlatStyle.System, RightToLeft.No,
ContentAlignment
.BottomRight, 0x56012A00, 0 };
225
yield return new object[] { FlatStyle.System, RightToLeft.No,
ContentAlignment
.MiddleLeft, 0x56012D00, 0 };
226
yield return new object[] { FlatStyle.System, RightToLeft.No,
ContentAlignment
.MiddleCenter, 0x56012F00, 0 };
227
yield return new object[] { FlatStyle.System, RightToLeft.No,
ContentAlignment
.MiddleRight, 0x56012E00, 0 };
228
yield return new object[] { FlatStyle.System, RightToLeft.No,
ContentAlignment
.TopLeft, 0x56012500, 0 };
229
yield return new object[] { FlatStyle.System, RightToLeft.No,
ContentAlignment
.TopCenter, 0x56012700, 0 };
230
yield return new object[] { FlatStyle.System, RightToLeft.No,
ContentAlignment
.TopRight, 0x56012600, 0 };
232
yield return new object[] { FlatStyle.System, RightToLeft.Inherit,
ContentAlignment
.BottomLeft, 0x56012900, 0 };
233
yield return new object[] { FlatStyle.System, RightToLeft.Inherit,
ContentAlignment
.BottomCenter, 0x56012B00, 0 };
234
yield return new object[] { FlatStyle.System, RightToLeft.Inherit,
ContentAlignment
.BottomRight, 0x56012A00, 0 };
235
yield return new object[] { FlatStyle.System, RightToLeft.Inherit,
ContentAlignment
.MiddleLeft, 0x56012D00, 0 };
236
yield return new object[] { FlatStyle.System, RightToLeft.Inherit,
ContentAlignment
.MiddleCenter, 0x56012F00, 0 };
237
yield return new object[] { FlatStyle.System, RightToLeft.Inherit,
ContentAlignment
.MiddleRight, 0x56012E00, 0 };
238
yield return new object[] { FlatStyle.System, RightToLeft.Inherit,
ContentAlignment
.TopLeft, 0x56012500, 0 };
239
yield return new object[] { FlatStyle.System, RightToLeft.Inherit,
ContentAlignment
.TopCenter, 0x56012700, 0 };
240
yield return new object[] { FlatStyle.System, RightToLeft.Inherit,
ContentAlignment
.TopRight, 0x56012600, 0 };
245
public void Button_CreateParams_GetTextAlign_ReturnsExpected(FlatStyle flatStyle, RightToLeft rightToLeft,
ContentAlignment
textAlign, int expectedStyle, int expectedExStyle)
System\Windows\Forms\CheckBoxTests.cs (11)
42
Assert.Equal(
ContentAlignment
.MiddleLeft, control.CheckAlign);
78
Assert.Equal(
ContentAlignment
.MiddleCenter, control.ImageAlign);
111
Assert.Equal(
ContentAlignment
.MiddleLeft, control.TextAlign);
184
[EnumData<
ContentAlignment
>]
185
public void CheckBox_CheckAlign_Set_GetReturnsExpected(
ContentAlignment
value)
201
[InvalidEnumData<
ContentAlignment
>]
202
public void CheckBox_CheckAlign_SetInvalidValue_ThrowsInvalidEnumArgumentException(
ContentAlignment
value)
421
[EnumData<
ContentAlignment
>]
422
public void CheckBox_TextAlign_Set_GetReturnsExpected(
ContentAlignment
value)
438
[InvalidEnumData<
ContentAlignment
>]
439
public void CheckBox_TextAlign_SetInvalidValue_ThrowsInvalidEnumArgumentException(
ContentAlignment
value)
System\Windows\Forms\ControlTests.cs (4)
1416
public new
ContentAlignment
RtlTranslateAlignment(
ContentAlignment
align) => base.RtlTranslateAlignment(align);
1418
public new
ContentAlignment
RtlTranslateContent(
ContentAlignment
align) => base.RtlTranslateContent(align);
System\Windows\Forms\ControlTests.Methods.cs (24)
6859
public void Control_RtlTranslateAlignment_InvokeContentAlignment_ReturnsExpected(RightToLeft rightToLeft,
ContentAlignment
align,
ContentAlignment
expected)
6907
foreach (
ContentAlignment
align in Enum.GetValues(typeof(
ContentAlignment
)))
6913
yield return new object[] { RightToLeft.Yes,
ContentAlignment
.BottomCenter,
ContentAlignment
.BottomCenter };
6914
yield return new object[] { RightToLeft.Yes,
ContentAlignment
.BottomLeft,
ContentAlignment
.BottomRight };
6915
yield return new object[] { RightToLeft.Yes,
ContentAlignment
.BottomRight,
ContentAlignment
.BottomLeft };
6916
yield return new object[] { RightToLeft.Yes,
ContentAlignment
.MiddleCenter,
ContentAlignment
.MiddleCenter };
6917
yield return new object[] { RightToLeft.Yes,
ContentAlignment
.MiddleLeft,
ContentAlignment
.MiddleRight };
6918
yield return new object[] { RightToLeft.Yes,
ContentAlignment
.MiddleRight,
ContentAlignment
.MiddleLeft };
6919
yield return new object[] { RightToLeft.Yes,
ContentAlignment
.TopCenter,
ContentAlignment
.TopCenter };
6920
yield return new object[] { RightToLeft.Yes,
ContentAlignment
.TopLeft,
ContentAlignment
.TopRight };
6921
yield return new object[] { RightToLeft.Yes,
ContentAlignment
.TopRight,
ContentAlignment
.TopLeft };
6926
public void Control_RtlTranslateContent_Invoke_ReturnsExpected(RightToLeft rightToLeft,
ContentAlignment
align,
ContentAlignment
expected)
System\Windows\Forms\LabelTests.cs (23)
70
Assert.Equal(
ContentAlignment
.MiddleCenter, control.ImageAlign);
105
Assert.Equal(
ContentAlignment
.TopLeft, control.TextAlign);
242
[InvalidEnumData<
ContentAlignment
>]
243
public void Label_ImageAlign_SetInvalidValue_ThrowsInvalidEnumArgumentException(
ContentAlignment
value)
253
foreach (
ContentAlignment
value in Enum.GetValues(typeof(
ContentAlignment
)))
262
public 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)]
390
public void Label_TextAlign_Set_GetReturnsExpected(
ContentAlignment
alignment)
403
label.TextAlign =
ContentAlignment
.TopLeft;
408
label.TextAlign =
ContentAlignment
.TopLeft;
416
label.TextAlign =
ContentAlignment
.TopLeft;
421
label.TextAlign =
ContentAlignment
.MiddleCenter;
838
label.TextAlign =
ContentAlignment
.BottomCenter;
842
label.TextAlign =
ContentAlignment
.BottomLeft;
System\Windows\Forms\RadioButtonTests.cs (25)
42
Assert.Equal(
ContentAlignment
.MiddleLeft, control.CheckAlign);
77
Assert.Equal(
ContentAlignment
.MiddleCenter, control.ImageAlign);
109
Assert.Equal(
ContentAlignment
.MiddleLeft, control.TextAlign);
168
[InvalidEnumData<
ContentAlignment
>]
169
public void RadioButton_CheckAlign_SetInvalidValue_ThrowsInvalidEnumArgumentException(
ContentAlignment
value)
175
public static TheoryData<
ContentAlignment
> CheckAlignData => new()
177
ContentAlignment
.TopLeft,
178
ContentAlignment
.TopRight,
179
ContentAlignment
.BottomCenter,
180
ContentAlignment
.BottomLeft,
181
ContentAlignment
.BottomRight,
182
ContentAlignment
.MiddleLeft,
183
ContentAlignment
.MiddleRight,
184
ContentAlignment
.TopCenter,
185
ContentAlignment
.MiddleCenter
190
public void RadioButton_CheckAlign_Set_GetReturnsExpected(
ContentAlignment
value)
304
foreach (
ContentAlignment
value in Enum.GetValues(typeof(
ContentAlignment
)))
314
public void RadioRadioButton_TextAlign_Set_GetReturnsExpected(bool autoSize, FlatStyle flatStyle,
ContentAlignment
value)
340
foreach (
ContentAlignment
value in Enum.GetValues(typeof(
ContentAlignment
)))
342
int expectedCallCount = value ==
ContentAlignment
.MiddleLeft ? 0 : 1;
353
public void RadioRadioButton_TextAlign_SetWithHandle_GetReturnsExpected(bool autoSize, FlatStyle flatStyle,
ContentAlignment
value, int expectedInvalidatedCallCount, int expectedStyleChangedCallCount)
389
[InvalidEnumData<
ContentAlignment
>]
390
public void RadioRadioButton_TextAlign_SetInvalidValue_ThrowsInvalidEnumArgumentException(
ContentAlignment
value)
System\Windows\Forms\ToolStripButtonTests.cs (44)
60
Assert.Equal(
ContentAlignment
.MiddleCenter, item.ImageAlign);
86
Assert.Equal(
ContentAlignment
.MiddleCenter, item.TextAlign);
141
Assert.Equal(
ContentAlignment
.MiddleCenter, item.ImageAlign);
167
Assert.Equal(
ContentAlignment
.MiddleCenter, item.TextAlign);
228
Assert.Equal(
ContentAlignment
.MiddleCenter, item.ImageAlign);
254
Assert.Equal(
ContentAlignment
.MiddleCenter, item.TextAlign);
318
Assert.Equal(
ContentAlignment
.MiddleCenter, item.ImageAlign);
344
Assert.Equal(
ContentAlignment
.MiddleCenter, item.TextAlign);
406
Assert.Equal(
ContentAlignment
.MiddleCenter, item.ImageAlign);
432
Assert.Equal(
ContentAlignment
.MiddleCenter, item.TextAlign);
504
Assert.Equal(
ContentAlignment
.MiddleCenter, item.ImageAlign);
530
Assert.Equal(
ContentAlignment
.MiddleCenter, item.TextAlign);
1225
yield return new object[] {
ContentAlignment
.MiddleCenter, RightToLeft.No, ToolStripItemDisplayStyle.None, 0, 0, TextFormatFlags.HorizontalCenter | TextFormatFlags.VerticalCenter | TextFormatFlags.HidePrefix };
1226
yield return new object[] {
ContentAlignment
.MiddleCenter, RightToLeft.No, ToolStripItemDisplayStyle.Image, 1, 0, TextFormatFlags.HorizontalCenter | TextFormatFlags.VerticalCenter | TextFormatFlags.HidePrefix };
1227
yield return new object[] {
ContentAlignment
.MiddleCenter, RightToLeft.No, ToolStripItemDisplayStyle.ImageAndText, 1, 1, TextFormatFlags.HorizontalCenter | TextFormatFlags.VerticalCenter | TextFormatFlags.HidePrefix };
1229
yield return new object[] {
ContentAlignment
.TopLeft, RightToLeft.Yes, ToolStripItemDisplayStyle.Text, 0, 1, TextFormatFlags.Left | TextFormatFlags.Top | TextFormatFlags.HidePrefix | TextFormatFlags.RightToLeft };
1230
yield return new object[] {
ContentAlignment
.TopLeft, RightToLeft.Inherit, ToolStripItemDisplayStyle.Text, 0, 1, TextFormatFlags.Left | TextFormatFlags.Top | TextFormatFlags.HidePrefix };
1231
yield return new object[] {
ContentAlignment
.TopLeft, RightToLeft.No, ToolStripItemDisplayStyle.Text, 0, 1, TextFormatFlags.Left | TextFormatFlags.Top | TextFormatFlags.HidePrefix };
1232
yield return new object[] {
ContentAlignment
.TopCenter, RightToLeft.Yes, ToolStripItemDisplayStyle.Text, 0, 1, TextFormatFlags.HorizontalCenter | TextFormatFlags.Top | TextFormatFlags.HidePrefix | TextFormatFlags.RightToLeft };
1233
yield return new object[] {
ContentAlignment
.TopCenter, RightToLeft.Inherit, ToolStripItemDisplayStyle.Text, 0, 1, TextFormatFlags.HorizontalCenter | TextFormatFlags.Top | TextFormatFlags.HidePrefix };
1234
yield return new object[] {
ContentAlignment
.TopCenter, RightToLeft.No, ToolStripItemDisplayStyle.Text, 0, 1, TextFormatFlags.HorizontalCenter | TextFormatFlags.Top | TextFormatFlags.HidePrefix };
1235
yield return new object[] {
ContentAlignment
.TopRight, RightToLeft.Yes, ToolStripItemDisplayStyle.Text, 0, 1, TextFormatFlags.Right | TextFormatFlags.Top | TextFormatFlags.HidePrefix | TextFormatFlags.RightToLeft };
1236
yield return new object[] {
ContentAlignment
.TopRight, RightToLeft.Inherit, ToolStripItemDisplayStyle.Text, 0, 1, TextFormatFlags.Right | TextFormatFlags.Top | TextFormatFlags.HidePrefix };
1237
yield return new object[] {
ContentAlignment
.TopRight, RightToLeft.No, ToolStripItemDisplayStyle.Text, 0, 1, TextFormatFlags.Right | TextFormatFlags.Top | TextFormatFlags.HidePrefix };
1239
yield return new object[] {
ContentAlignment
.MiddleLeft, RightToLeft.Yes, ToolStripItemDisplayStyle.Text, 0, 1, TextFormatFlags.Left | TextFormatFlags.VerticalCenter | TextFormatFlags.HidePrefix | TextFormatFlags.RightToLeft };
1240
yield return new object[] {
ContentAlignment
.MiddleLeft, RightToLeft.Inherit, ToolStripItemDisplayStyle.Text, 0, 1, TextFormatFlags.Left | TextFormatFlags.VerticalCenter | TextFormatFlags.HidePrefix };
1241
yield return new object[] {
ContentAlignment
.MiddleLeft, RightToLeft.No, ToolStripItemDisplayStyle.Text, 0, 1, TextFormatFlags.Left | TextFormatFlags.VerticalCenter | TextFormatFlags.HidePrefix };
1242
yield return new object[] {
ContentAlignment
.MiddleCenter, RightToLeft.Yes, ToolStripItemDisplayStyle.Text, 0, 1, TextFormatFlags.HorizontalCenter | TextFormatFlags.VerticalCenter | TextFormatFlags.HidePrefix | TextFormatFlags.RightToLeft };
1243
yield return new object[] {
ContentAlignment
.MiddleCenter, RightToLeft.Inherit, ToolStripItemDisplayStyle.Text, 0, 1, TextFormatFlags.HorizontalCenter | TextFormatFlags.VerticalCenter | TextFormatFlags.HidePrefix };
1244
yield return new object[] {
ContentAlignment
.MiddleCenter, RightToLeft.No, ToolStripItemDisplayStyle.Text, 0, 1, TextFormatFlags.HorizontalCenter | TextFormatFlags.VerticalCenter | TextFormatFlags.HidePrefix };
1245
yield return new object[] {
ContentAlignment
.MiddleRight, RightToLeft.Yes, ToolStripItemDisplayStyle.Text, 0, 1, TextFormatFlags.Right | TextFormatFlags.VerticalCenter | TextFormatFlags.HidePrefix | TextFormatFlags.RightToLeft };
1246
yield return new object[] {
ContentAlignment
.MiddleRight, RightToLeft.Inherit, ToolStripItemDisplayStyle.Text, 0, 1, TextFormatFlags.Right | TextFormatFlags.VerticalCenter | TextFormatFlags.HidePrefix };
1247
yield return new object[] {
ContentAlignment
.MiddleRight, RightToLeft.No, ToolStripItemDisplayStyle.Text, 0, 1, TextFormatFlags.Right | TextFormatFlags.VerticalCenter | TextFormatFlags.HidePrefix };
1249
yield return new object[] {
ContentAlignment
.BottomLeft, RightToLeft.Yes, ToolStripItemDisplayStyle.Text, 0, 1, TextFormatFlags.Left | TextFormatFlags.Bottom | TextFormatFlags.HidePrefix | TextFormatFlags.RightToLeft };
1250
yield return new object[] {
ContentAlignment
.BottomLeft, RightToLeft.Inherit, ToolStripItemDisplayStyle.Text, 0, 1, TextFormatFlags.Left | TextFormatFlags.Bottom | TextFormatFlags.HidePrefix };
1251
yield return new object[] {
ContentAlignment
.BottomLeft, RightToLeft.No, ToolStripItemDisplayStyle.Text, 0, 1, TextFormatFlags.Left | TextFormatFlags.Bottom | TextFormatFlags.HidePrefix };
1252
yield return new object[] {
ContentAlignment
.BottomCenter, RightToLeft.Yes, ToolStripItemDisplayStyle.Text, 0, 1, TextFormatFlags.HorizontalCenter | TextFormatFlags.Bottom | TextFormatFlags.HidePrefix | TextFormatFlags.RightToLeft };
1253
yield return new object[] {
ContentAlignment
.BottomCenter, RightToLeft.Inherit, ToolStripItemDisplayStyle.Text, 0, 1, TextFormatFlags.HorizontalCenter | TextFormatFlags.Bottom | TextFormatFlags.HidePrefix };
1254
yield return new object[] {
ContentAlignment
.BottomCenter, RightToLeft.No, ToolStripItemDisplayStyle.Text, 0, 1, TextFormatFlags.HorizontalCenter | TextFormatFlags.Bottom | TextFormatFlags.HidePrefix };
1255
yield return new object[] {
ContentAlignment
.BottomRight, RightToLeft.Yes, ToolStripItemDisplayStyle.Text, 0, 1, TextFormatFlags.Right | TextFormatFlags.Bottom | TextFormatFlags.HidePrefix | TextFormatFlags.RightToLeft };
1256
yield return new object[] {
ContentAlignment
.BottomRight, RightToLeft.Inherit, ToolStripItemDisplayStyle.Text, 0, 1, TextFormatFlags.Right | TextFormatFlags.Bottom | TextFormatFlags.HidePrefix };
1257
yield return new object[] {
ContentAlignment
.BottomRight, RightToLeft.No, ToolStripItemDisplayStyle.Text, 0, 1, TextFormatFlags.Right | TextFormatFlags.Bottom | TextFormatFlags.HidePrefix };
1262
public void ToolStripButton_OnPaint_InvokeWithOwner_DoesNotCallPaint(
ContentAlignment
textAlign, RightToLeft rightToLeft, ToolStripItemDisplayStyle displayStyle, int expectedRenderItemImageCallCount, int expectedRenderItemTextCallCount, TextFormatFlags expectedTextFormat)
1353
public void ToolStripButton_OnPaint_InvokeWithOwnerCantShowKeyboardCues_DoesNotCallPaint(
ContentAlignment
textAlign, RightToLeft rightToLeft, ToolStripItemDisplayStyle displayStyle, int expectedRenderItemImageCallCount, int expectedRenderItemTextCallCount, TextFormatFlags expectedTextFormat)
System\Windows\Forms\ToolStripControlHostTests.cs (25)
70
Assert.Equal(
ContentAlignment
.MiddleCenter, item.ControlAlign);
89
Assert.Equal(
ContentAlignment
.MiddleCenter, item.ImageAlign);
115
Assert.Equal(
ContentAlignment
.MiddleCenter, item.TextAlign);
695
[EnumData<
ContentAlignment
>]
696
public void ToolStripControlHost_ControlAlign_Set_GetReturnsExpected(
ContentAlignment
value)
720
[EnumData<
ContentAlignment
>]
721
public void ToolStripControlHost_ControlAlign_SetDisposed_GetReturnsExpected(
ContentAlignment
value)
738
[InvalidEnumData<
ContentAlignment
>]
739
[InlineData((
ContentAlignment
)int.MaxValue)]
740
[InlineData((
ContentAlignment
)int.MinValue)]
741
public void ToolStripControlHost_ControlAlign_SetInvalid_ThrowsInvalidEnumArgumentException(
ContentAlignment
value)
1239
[EnumData<
ContentAlignment
>]
1240
public void ToolStripControlHost_ImageAlign_Set_GetReturnsExpected(
ContentAlignment
value)
1257
[InvalidEnumData<
ContentAlignment
>]
1258
[InlineData((
ContentAlignment
)int.MaxValue)]
1259
[InlineData((
ContentAlignment
)int.MinValue)]
1260
public void ToolStripControlHost_ImageAlign_SetInvalid_ThrowsInvalidEnumArgumentException(
ContentAlignment
value)
2302
[EnumData<
ContentAlignment
>]
2303
public void ToolStripControlHost_TextAlign_Set_GetReturnsExpected(
ContentAlignment
value)
2318
[InvalidEnumData<
ContentAlignment
>]
2319
[InlineData((
ContentAlignment
)int.MaxValue)]
2320
[InlineData((
ContentAlignment
)int.MinValue)]
2321
public void ToolStripControlHost_TextAlign_SetInvalid_ThrowsInvalidEnumArgumentException(
ContentAlignment
value)
2765
[EnumData<
ContentAlignment
>]
2766
public void ToolStripControlHost_OnBoundsChanged_Invoke_Success(
ContentAlignment
controlAlign)
System\Windows\Forms\ToolStripDropDownItemTests.cs (8)
60
Assert.Equal(
ContentAlignment
.MiddleCenter, item.ImageAlign);
86
Assert.Equal(
ContentAlignment
.MiddleCenter, item.TextAlign);
149
Assert.Equal(
ContentAlignment
.MiddleCenter, item.ImageAlign);
175
Assert.Equal(
ContentAlignment
.MiddleCenter, item.TextAlign);
248
Assert.Equal(
ContentAlignment
.MiddleCenter, item.ImageAlign);
274
Assert.Equal(
ContentAlignment
.MiddleCenter, item.TextAlign);
356
Assert.Equal(
ContentAlignment
.MiddleCenter, item.ImageAlign);
382
Assert.Equal(
ContentAlignment
.MiddleCenter, item.TextAlign);
System\Windows\Forms\ToolStripItemTests.cs (66)
59
Assert.Equal(
ContentAlignment
.MiddleCenter, item.ImageAlign);
85
Assert.Equal(
ContentAlignment
.MiddleCenter, item.TextAlign);
144
Assert.Equal(
ContentAlignment
.MiddleCenter, item.ImageAlign);
170
Assert.Equal(
ContentAlignment
.MiddleCenter, item.TextAlign);
239
Assert.Equal(
ContentAlignment
.MiddleCenter, item.ImageAlign);
265
Assert.Equal(
ContentAlignment
.MiddleCenter, item.TextAlign);
4171
[EnumData<
ContentAlignment
>]
4172
public 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)]
4195
public 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)]
4242
public void ToolStripItem_ImageAlign_SetWithOwnerWithHandle_GetReturnsExpected(
ContentAlignment
value, int expectedParentLayoutCallCount)
4293
[EnumData<
ContentAlignment
>]
4294
public void ToolStripItem_ImageAlign_SetWithParent_GetReturnsExpected(
ContentAlignment
value)
4325
[EnumData<
ContentAlignment
>]
4326
public void ToolStripItem_ImageAlign_SetWithParentWithHandle_GetReturnsExpected(
ContentAlignment
value)
4370
[InvalidEnumData<
ContentAlignment
>]
4371
[InlineData((
ContentAlignment
)int.MaxValue)]
4372
[InlineData((
ContentAlignment
)int.MinValue)]
4373
public void ToolStripItem_ImageAlign_SetInvalid_ThrowsInvalidEnumArgumentException(
ContentAlignment
value)
8287
[EnumData<
ContentAlignment
>]
8288
public 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)]
8311
public 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)]
8358
public void ToolStripItem_TextAlign_SetWithOwnerWithHandle_GetReturnsExpected(
ContentAlignment
value, int expectedParentLayoutCallCount)
8409
[EnumData<
ContentAlignment
>]
8410
public void ToolStripItem_TextAlign_SetWithParent_GetReturnsExpected(
ContentAlignment
value)
8441
[EnumData<
ContentAlignment
>]
8442
public void ToolStripItem_TextAlign_SetWithParentWithHandle_GetReturnsExpected(
ContentAlignment
value)
8486
[InvalidEnumData<
ContentAlignment
>]
8487
[InlineData((
ContentAlignment
)int.MaxValue)]
8488
[InlineData((
ContentAlignment
)int.MinValue)]
8489
public void ToolStripItem_TextAlign_SetInvalid_ThrowsInvalidEnumArgumentException(
ContentAlignment
value)
System\Windows\Forms\ToolStripItemTextRenderEventArgsTests.cs (6)
37
yield return new object[] { new ToolStripButton(), null, Rectangle.Empty, Color.Empty, null,
ContentAlignment
.TopLeft - 1, TextFormatFlags.Default | TextFormatFlags.Top | TextFormatFlags.HidePrefix };
38
yield 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 };
39
yield 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 };
40
yield 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 };
45
public void Ctor_ToolStripItem_String_Rectangle_Color_Font_ContentAlignment(ToolStripItem item, string text, Rectangle textRectangle, Color textColor, Font textFont,
ContentAlignment
textAlign, TextFormatFlags expectedTextFormat)
67
Assert.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)
64
Assert.Equal(
ContentAlignment
.MiddleCenter, item.ImageAlign);
95
Assert.Equal(
ContentAlignment
.MiddleCenter, item.TextAlign);
289
ImageAlign =
ContentAlignment
.BottomCenter,
303
TextAlign =
ContentAlignment
.BottomRight,
System\Windows\Forms\ToolStripSeparatorTests.cs (14)
57
Assert.Equal(
ContentAlignment
.MiddleCenter, item.ImageAlign);
83
Assert.Equal(
ContentAlignment
.MiddleCenter, item.TextAlign);
446
[EnumData<
ContentAlignment
>]
447
public void ToolStripSeparator_ImageAlign_Set_GetReturnsExpected(
ContentAlignment
value)
461
[InvalidEnumData<
ContentAlignment
>]
462
[InlineData((
ContentAlignment
)int.MaxValue)]
463
[InlineData((
ContentAlignment
)int.MinValue)]
464
public void ToolStripSeparator_ImageAlign_SetInvalid_ThrowsInvalidEnumArgumentException(
ContentAlignment
value)
623
[EnumData<
ContentAlignment
>]
624
public void ToolStripSeparator_TextAlign_Set_GetReturnsExpected(
ContentAlignment
value)
638
[InvalidEnumData<
ContentAlignment
>]
639
[InlineData((
ContentAlignment
)int.MaxValue)]
640
[InlineData((
ContentAlignment
)int.MinValue)]
641
public void ToolStripSeparator_TextAlign_SetInvalid_ThrowsInvalidEnumArgumentException(
ContentAlignment
value)
WinFormsControlsTest (4)
DesignTimeAligned.Designer.cs (3)
50
this.label1.TextAlign = System.Drawing.
ContentAlignment
.MiddleRight;
61
this.label2.TextAlign = System.Drawing.
ContentAlignment
.MiddleRight;
71
this.button1.TextAlign = System.Drawing.
ContentAlignment
.MiddleLeft;
FormOwnerTestForm.cs (1)
50
TextAlign =
ContentAlignment
.MiddleCenter