153 references to TextImageRelation
System.Windows.Forms (55)
System\Windows\Forms\Controls\Buttons\ButtonBase.cs (4)
23private TextImageRelation _textImageRelation = TextImageRelation.Overlay; 699[DefaultValue(TextImageRelation.Overlay)] 703public TextImageRelation TextImageRelation
System\Windows\Forms\Controls\Buttons\ButtonInternal\ButtonBaseAdapter.cs (1)
584TextImageRelation = TextImageRelation.Overlay,
System\Windows\Forms\Controls\Buttons\ButtonInternal\ButtonBaseAdapter.LayoutOptions.cs (33)
38public TextImageRelation TextImageRelation { get; set; } 309private TextImageRelation RtlTranslateRelation(TextImageRelation relation) 316case TextImageRelation.ImageBeforeText: 317return TextImageRelation.TextBeforeImage; 318case TextImageRelation.TextBeforeImage: 319return TextImageRelation.ImageBeforeText; 450/// Maps an image align to the set of <see cref="Forms.TextImageRelation"/>s that represent the same edge. 451/// For example, <see cref="ContentAlignment.TopLeft"/> maps to <see cref="TextImageRelation.ImageAboveText"/> 452/// and <see cref="TextImageRelation.ImageBeforeText"/>. 454private static readonly TextImageRelation[] s_imageAlignToRelation = 456TextImageRelation.ImageAboveText | TextImageRelation.ImageBeforeText, // TopLeft 457TextImageRelation.ImageAboveText, // TopCenter 458TextImageRelation.ImageAboveText | TextImageRelation.TextBeforeImage, // TopRight 460TextImageRelation.ImageBeforeText, // MiddleLeft 462TextImageRelation.TextBeforeImage, // MiddleRight 464TextImageRelation.TextAboveImage | TextImageRelation.ImageBeforeText, // BottomLeft 465TextImageRelation.TextAboveImage, // BottomCenter 466TextImageRelation.TextAboveImage | TextImageRelation.TextBeforeImage // BottomRight 469private static TextImageRelation ImageAlignToRelation(ContentAlignment alignment) 472private static TextImageRelation TextAlignToRelation(ContentAlignment alignment) 480TextImageRelation textImageRelation = RtlTranslateRelation(TextImageRelation); 490if (ImageSize == Size.Empty || Text is null || Text.Length == 0 || textImageRelation == TextImageRelation.Overlay) 575if (textImageRelation is TextImageRelation.TextBeforeImage or TextImageRelation.ImageBeforeText) 585if (textImageRelation is TextImageRelation.TextAboveImage or TextImageRelation.ImageAboveText) 595if (textImageRelation == TextImageRelation.ImageBeforeText && layout.ImageBounds.Size.Width != 0) 604if (textImageRelation == TextImageRelation.ImageAboveText && layout.ImageBounds.Size.Height != 0)
System\Windows\Forms\Controls\ToolStrips\ToolStripControlHost.cs (1)
428public new TextImageRelation TextImageRelation
System\Windows\Forms\Controls\ToolStrips\ToolStripItem.cs (4)
38private TextImageRelation _textImageRelation = TextImageRelation.ImageBeforeText; 1929[DefaultValue(TextImageRelation.ImageBeforeText)] 1933public TextImageRelation TextImageRelation
System\Windows\Forms\Controls\ToolStrips\ToolStripSeparator.cs (1)
229public new TextImageRelation TextImageRelation
System\Windows\Forms\Layout\LayoutUtils.cs (11)
200public static TextImageRelation GetOppositeTextImageRelation(TextImageRelation relation) 202return (TextImageRelation)GetOppositeAnchor((AnchorStyles)relation); 390public static Size AddAlignedRegion(Size textSize, Size imageSize, TextImageRelation relation) 471public static bool IsHorizontalRelation(TextImageRelation relation) 473return (relation & (TextImageRelation.TextBeforeImage | TextImageRelation.ImageBeforeText)) != 0; 483public static bool IsVerticalRelation(TextImageRelation relation) 485return (relation & (TextImageRelation.TextAboveImage | TextImageRelation.ImageAboveText)) != 0; 570public static Size SubAlignedRegion(Size currentSize, Size contentSize, TextImageRelation relation)
System.Windows.Forms.Tests (98)
System\Windows\Forms\ButtonBaseTests.cs (38)
112Assert.Equal(TextImageRelation.Overlay, control.TextImageRelation); 3500foreach (TextImageRelation value in Enum.GetValues(typeof(TextImageRelation))) 3509public void ButtonBase_TextImageRelation_Set_GetReturnsExpected(bool autoSize, TextImageRelation value) 3532yield return new object[] { true, TextImageRelation.ImageAboveText, 1 }; 3533yield return new object[] { true, TextImageRelation.ImageBeforeText, 1 }; 3534yield return new object[] { true, TextImageRelation.Overlay, 0 }; 3535yield return new object[] { true, TextImageRelation.TextAboveImage, 1 }; 3536yield return new object[] { true, TextImageRelation.ImageBeforeText, 1 }; 3538yield return new object[] { false, TextImageRelation.ImageAboveText, 0 }; 3539yield return new object[] { false, TextImageRelation.ImageBeforeText, 0 }; 3540yield return new object[] { false, TextImageRelation.Overlay, 0 }; 3541yield return new object[] { false, TextImageRelation.TextAboveImage, 0 }; 3542yield return new object[] { false, TextImageRelation.ImageBeforeText, 0 }; 3547public void ButtonBase_TextImageRelation_SetWithParent_GetReturnsExpected(bool autoSize, TextImageRelation value, int expectedParentLayoutCallCount) 3595yield return new object[] { autoSize, TextImageRelation.ImageAboveText, 1 }; 3596yield return new object[] { autoSize, TextImageRelation.ImageBeforeText, 1 }; 3597yield return new object[] { autoSize, TextImageRelation.Overlay, 0 }; 3598yield return new object[] { autoSize, TextImageRelation.TextAboveImage, 1 }; 3599yield return new object[] { autoSize, TextImageRelation.ImageBeforeText, 1 }; 3605public void ButtonBase_TextImageRelation_SetWithHandle_GetReturnsExpected(bool autoSize, TextImageRelation value, int expectedInvalidatedCallCount) 3641yield return new object[] { true, TextImageRelation.ImageAboveText, 1, 1 }; 3642yield return new object[] { true, TextImageRelation.ImageBeforeText, 1, 1 }; 3643yield return new object[] { true, TextImageRelation.Overlay, 0, 0 }; 3644yield return new object[] { true, TextImageRelation.TextAboveImage, 1, 1 }; 3645yield return new object[] { true, TextImageRelation.ImageBeforeText, 1, 1 }; 3647yield return new object[] { false, TextImageRelation.ImageAboveText, 0, 1 }; 3648yield return new object[] { false, TextImageRelation.ImageBeforeText, 0, 1 }; 3649yield return new object[] { false, TextImageRelation.Overlay, 0, 0 }; 3650yield return new object[] { false, TextImageRelation.TextAboveImage, 0, 1 }; 3651yield return new object[] { false, TextImageRelation.ImageBeforeText, 0, 1 }; 3656public void ButtonBase_TextImageRelation_SetWithParentWithHandle_GetReturnsExpected(bool autoSize, TextImageRelation value, int expectedParentLayoutCallCount, int expectedInvalidatedCallCount) 3715[InvalidEnumData<TextImageRelation>] 3716[InlineData((TextImageRelation)3)] 3717[InlineData((TextImageRelation)5)] 3718[InlineData((TextImageRelation)6)] 3719[InlineData((TextImageRelation)7)] 3720public void ButtonBase_TextImageRelation_SetInvalid_ThrowsInvalidEnumArgumentException(TextImageRelation value)
System\Windows\Forms\ButtonTests.cs (1)
110Assert.Equal(TextImageRelation.Overlay, control.TextImageRelation);
System\Windows\Forms\CheckBoxTests.cs (1)
112Assert.Equal(TextImageRelation.Overlay, control.TextImageRelation);
System\Windows\Forms\RadioButtonTests.cs (1)
110Assert.Equal(TextImageRelation.Overlay, control.TextImageRelation);
System\Windows\Forms\ToolStripButtonTests.cs (6)
88Assert.Equal(TextImageRelation.ImageBeforeText, item.TextImageRelation); 169Assert.Equal(TextImageRelation.ImageBeforeText, item.TextImageRelation); 256Assert.Equal(TextImageRelation.ImageBeforeText, item.TextImageRelation); 346Assert.Equal(TextImageRelation.ImageBeforeText, item.TextImageRelation); 434Assert.Equal(TextImageRelation.ImageBeforeText, item.TextImageRelation); 532Assert.Equal(TextImageRelation.ImageBeforeText, item.TextImageRelation);
System\Windows\Forms\ToolStripControlHostTests.cs (9)
117Assert.Equal(TextImageRelation.ImageBeforeText, item.TextImageRelation); 2362[EnumData<TextImageRelation>] 2363public void ToolStripControlHost_TextImageRelation_Set_GetReturnsExpected(TextImageRelation value) 2378[InvalidEnumData<TextImageRelation>] 2379[InlineData((TextImageRelation)3)] 2380[InlineData((TextImageRelation)5)] 2381[InlineData((TextImageRelation)6)] 2382[InlineData((TextImageRelation)7)] 2383public void ToolStripControlHost_TextImageRelation_SetInvalid_ThrowsInvalidEnumArgumentException(TextImageRelation value)
System\Windows\Forms\ToolStripDropDownItemTests.cs (4)
88Assert.Equal(TextImageRelation.ImageBeforeText, item.TextImageRelation); 177Assert.Equal(TextImageRelation.ImageBeforeText, item.TextImageRelation); 276Assert.Equal(TextImageRelation.ImageBeforeText, item.TextImageRelation); 384Assert.Equal(TextImageRelation.ImageBeforeText, item.TextImageRelation);
System\Windows\Forms\ToolStripItemTests.cs (27)
87Assert.Equal(TextImageRelation.ImageBeforeText, item.TextImageRelation); 172Assert.Equal(TextImageRelation.ImageBeforeText, item.TextImageRelation); 267Assert.Equal(TextImageRelation.ImageBeforeText, item.TextImageRelation); 8818[EnumData<TextImageRelation>] 8819public void ToolStripItem_TextImageRelation_Set_GetReturnsExpected(TextImageRelation value) 8833[InlineData(TextImageRelation.Overlay, 1)] 8834[InlineData(TextImageRelation.ImageBeforeText, 0)] 8835[InlineData(TextImageRelation.TextBeforeImage, 1)] 8836[InlineData(TextImageRelation.ImageAboveText, 1)] 8837[InlineData(TextImageRelation.TextAboveImage, 1)] 8838public void ToolStripItem_TextImageRelation_SetWithOwner_GetReturnsExpected(TextImageRelation value, int expectedParentLayoutCallCount) 8876[InlineData(TextImageRelation.Overlay, 1)] 8877[InlineData(TextImageRelation.ImageBeforeText, 0)] 8878[InlineData(TextImageRelation.TextBeforeImage, 1)] 8879[InlineData(TextImageRelation.ImageAboveText, 1)] 8880[InlineData(TextImageRelation.TextAboveImage, 1)] 8881public void ToolStripItem_TextImageRelation_SetWithOwnerWithHandle_GetReturnsExpected(TextImageRelation value, int expectedParentLayoutCallCount) 8932[EnumData<TextImageRelation>] 8933public void ToolStripItem_TextImageRelation_SetWithParent_GetReturnsExpected(TextImageRelation value) 8964[EnumData<TextImageRelation>] 8965public void ToolStripItem_TextImageRelation_SetWithParentWithHandle_GetReturnsExpected(TextImageRelation value) 9009[InvalidEnumData<TextImageRelation>] 9010[InlineData((TextImageRelation)3)] 9011[InlineData((TextImageRelation)5)] 9012[InlineData((TextImageRelation)6)] 9013[InlineData((TextImageRelation)7)] 9014public void ToolStripItem_TextImageRelation_SetInvalid_ThrowsInvalidEnumArgumentException(TextImageRelation value)
System\Windows\Forms\ToolStripMenuItemTests.cs (2)
97Assert.Equal(TextImageRelation.ImageBeforeText, item.TextImageRelation); 305TextImageRelation = TextImageRelation.ImageAboveText,
System\Windows\Forms\ToolStripSeparatorTests.cs (9)
85Assert.Equal(TextImageRelation.ImageBeforeText, item.TextImageRelation); 679[EnumData<TextImageRelation>] 680public void ToolStripSeparator_TextImageRelation_Set_GetReturnsExpected(TextImageRelation value) 694[InvalidEnumData<TextImageRelation>] 695[InlineData((TextImageRelation)3)] 696[InlineData((TextImageRelation)5)] 697[InlineData((TextImageRelation)6)] 698[InlineData((TextImageRelation)7)] 699public void ToolStripSeparator_TextImageRelation_SetInvalid_ThrowsInvalidEnumArgumentException(TextImageRelation value)