195 references to IsEmpty
System.ComponentModel.TypeConverter (1)
System\Drawing\ColorConverter.cs (1)
101
if (c.
IsEmpty
)
System.Drawing.Common.Tests (2)
System\Drawing\Drawing2D\LinearGradientBrushTests.cs (2)
504
brush.InterpolationColors.Colors[0].
IsEmpty
.Should().BeTrue();
528
brush.InterpolationColors.Colors[0].
IsEmpty
.Should().BeTrue();
System.Drawing.Primitives (4)
System\Drawing\ColorTranslator.cs (4)
253
if (c.
IsEmpty
&& string.Equals(htmlColor, "LightGrey", StringComparison.OrdinalIgnoreCase))
259
if (c.
IsEmpty
)
270
if (c.
IsEmpty
)
292
if (c.
IsEmpty
)
System.Windows.Forms (177)
System\Windows\Forms\Control.cs (11)
777
if (!c.
IsEmpty
)
797
if (c.
IsEmpty
)
806
return !c.
IsEmpty
&& IsValidBackColor(c) ? c : DefaultBackColor;
2003
if (!color.
IsEmpty
)
2018
if (color.
IsEmpty
)
2027
return !color.
IsEmpty
? color : DefaultForeColor;
2392
private bool IsValidBackColor(Color c) => c.
IsEmpty
|| GetStyle(ControlStyles.SupportsTransparentBackColor) || c.A == 255;
6905
if (backColor.
IsEmpty
)
7038
if (foreColor.
IsEmpty
)
10467
return !backColor.
IsEmpty
;
10486
internal virtual bool ShouldSerializeForeColor() => !Properties.GetValueOrDefault<Color>(s_foreColorProperty).
IsEmpty
;
System\Windows\Forms\Controls\Buttons\ButtonBase.cs (1)
1265
get => (_isEnableVisualStyleBackgroundSet || (RawBackColor.
IsEmpty
&& (BackColor == SystemColors.Control)))
System\Windows\Forms\Controls\Buttons\ButtonInternal\ButtonFlatAdapter.cs (13)
23
bool hasCustomBorder = Control.FlatAppearance.BorderSize != BorderSize || !Control.FlatAppearance.BorderColor.
IsEmpty
;
27
up: !Control.FlatAppearance.CheckedBackColor.
IsEmpty
33
if (!Control.FlatAppearance.BorderColor.
IsEmpty
)
42
if (!Control.FlatAppearance.CheckedBackColor.
IsEmpty
)
116
bool hasCustomBorder = (Control.FlatAppearance.BorderSize != BorderSize || !Control.FlatAppearance.BorderColor.
IsEmpty
);
120
!Control.FlatAppearance.CheckedBackColor.
IsEmpty
126
if (!Control.FlatAppearance.BorderColor.
IsEmpty
)
135
if (!Control.FlatAppearance.MouseDownBackColor.
IsEmpty
)
210
bool hasCustomBorder = Control.FlatAppearance.BorderSize != BorderSize || !Control.FlatAppearance.BorderColor.
IsEmpty
;
214
up: !Control.FlatAppearance.CheckedBackColor.
IsEmpty
|| state == CheckState.Unchecked,
219
if (!Control.FlatAppearance.BorderColor.
IsEmpty
)
227
if (!Control.FlatAppearance.MouseOverBackColor.
IsEmpty
)
231
else if (!Control.FlatAppearance.CheckedBackColor.
IsEmpty
)
System\Windows\Forms\Controls\DataGridView\DataGridView.cs (2)
1015
if (value.
IsEmpty
)
2640
if (value.
IsEmpty
)
System\Windows\Forms\Controls\DataGridView\DataGridView.Methods.cs (8)
2808
if (cellStyle is not null && !cellStyle.BackColor.
IsEmpty
)
2812
else if (!columnHeadersStyle.BackColor.
IsEmpty
)
2821
if (cellStyle is not null && !cellStyle.ForeColor.
IsEmpty
)
2825
else if (!columnHeadersStyle.ForeColor.
IsEmpty
)
2834
if (cellStyle is not null && !cellStyle.SelectionBackColor.
IsEmpty
)
2838
else if (!columnHeadersStyle.SelectionBackColor.
IsEmpty
)
2847
if (cellStyle is not null && !cellStyle.SelectionForeColor.
IsEmpty
)
2851
else if (!columnHeadersStyle.SelectionForeColor.
IsEmpty
)
System\Windows\Forms\Controls\DataGridView\DataGridViewButtonColumn.cs (4)
214
return (!defaultCellStyle.BackColor.
IsEmpty
||
215
!defaultCellStyle.ForeColor.
IsEmpty
||
216
!defaultCellStyle.SelectionBackColor.
IsEmpty
||
217
!defaultCellStyle.SelectionForeColor.
IsEmpty
||
System\Windows\Forms\Controls\DataGridView\DataGridViewCell.cs (24)
1930
if (cellStyle is not null && !cellStyle.BackColor.
IsEmpty
)
1934
else if (rowStyle is not null && !rowStyle.BackColor.
IsEmpty
)
1938
else if (!DataGridView.RowsDefaultCellStyle.BackColor.
IsEmpty
&&
1939
(rowIndex % 2 == 0 || DataGridView.AlternatingRowsDefaultCellStyle.BackColor.
IsEmpty
))
1943
else if (rowIndex % 2 == 1 && !DataGridView.AlternatingRowsDefaultCellStyle.BackColor.
IsEmpty
)
1947
else if (columnStyle is not null && !columnStyle.BackColor.
IsEmpty
)
1956
if (cellStyle is not null && !cellStyle.ForeColor.
IsEmpty
)
1960
else if (rowStyle is not null && !rowStyle.ForeColor.
IsEmpty
)
1964
else if (!DataGridView.RowsDefaultCellStyle.ForeColor.
IsEmpty
&&
1965
(rowIndex % 2 == 0 || DataGridView.AlternatingRowsDefaultCellStyle.ForeColor.
IsEmpty
))
1969
else if (rowIndex % 2 == 1 && !DataGridView.AlternatingRowsDefaultCellStyle.ForeColor.
IsEmpty
)
1973
else if (columnStyle is not null && !columnStyle.ForeColor.
IsEmpty
)
1982
if (cellStyle is not null && !cellStyle.SelectionBackColor.
IsEmpty
)
1986
else if (rowStyle is not null && !rowStyle.SelectionBackColor.
IsEmpty
)
1990
else if (!DataGridView.RowsDefaultCellStyle.SelectionBackColor.
IsEmpty
&&
1991
(rowIndex % 2 == 0 || DataGridView.AlternatingRowsDefaultCellStyle.SelectionBackColor.
IsEmpty
))
1995
else if (rowIndex % 2 == 1 && !DataGridView.AlternatingRowsDefaultCellStyle.SelectionBackColor.
IsEmpty
)
1999
else if (columnStyle is not null && !columnStyle.SelectionBackColor.
IsEmpty
)
2008
if (cellStyle is not null && !cellStyle.SelectionForeColor.
IsEmpty
)
2012
else if (rowStyle is not null && !rowStyle.SelectionForeColor.
IsEmpty
)
2016
else if (!DataGridView.RowsDefaultCellStyle.SelectionForeColor.
IsEmpty
&&
2017
(rowIndex % 2 == 0 || DataGridView.AlternatingRowsDefaultCellStyle.SelectionForeColor.
IsEmpty
))
2021
else if (rowIndex % 2 == 1 && !DataGridView.AlternatingRowsDefaultCellStyle.SelectionForeColor.
IsEmpty
)
2025
else if (columnStyle is not null && !columnStyle.SelectionForeColor.
IsEmpty
)
System\Windows\Forms\Controls\DataGridView\DataGridViewCellStyle.cs (4)
378
if (!dataGridViewCellStyle.BackColor.
IsEmpty
)
383
if (!dataGridViewCellStyle.ForeColor.
IsEmpty
)
388
if (!dataGridViewCellStyle.SelectionBackColor.
IsEmpty
)
393
if (!dataGridViewCellStyle.SelectionForeColor.
IsEmpty
)
System\Windows\Forms\Controls\DataGridView\DataGridViewCheckBoxColumn.cs (4)
300
return (!defaultCellStyle.BackColor.
IsEmpty
||
301
!defaultCellStyle.ForeColor.
IsEmpty
||
302
!defaultCellStyle.SelectionBackColor.
IsEmpty
||
303
!defaultCellStyle.SelectionForeColor.
IsEmpty
||
System\Windows\Forms\Controls\DataGridView\DataGridViewColumn.cs (8)
213
return (!defaultCellStyle.BackColor.
IsEmpty
||
214
!defaultCellStyle.ForeColor.
IsEmpty
||
215
!defaultCellStyle.SelectionBackColor.
IsEmpty
||
216
!defaultCellStyle.SelectionForeColor.
IsEmpty
||
445
if (columnStyle is not null && !columnStyle.BackColor.
IsEmpty
)
454
if (columnStyle is not null && !columnStyle.ForeColor.
IsEmpty
)
463
if (columnStyle is not null && !columnStyle.SelectionBackColor.
IsEmpty
)
472
if (columnStyle is not null && !columnStyle.SelectionForeColor.
IsEmpty
)
System\Windows\Forms\Controls\DataGridView\DataGridViewColumnHeaderCell.cs (8)
301
if (cellStyle is not null && !cellStyle.BackColor.
IsEmpty
)
305
else if (!columnHeadersStyle.BackColor.
IsEmpty
)
314
if (cellStyle is not null && !cellStyle.ForeColor.
IsEmpty
)
318
else if (!columnHeadersStyle.ForeColor.
IsEmpty
)
327
if (cellStyle is not null && !cellStyle.SelectionBackColor.
IsEmpty
)
331
else if (!columnHeadersStyle.SelectionBackColor.
IsEmpty
)
340
if (cellStyle is not null && !cellStyle.SelectionForeColor.
IsEmpty
)
344
else if (!columnHeadersStyle.SelectionForeColor.
IsEmpty
)
System\Windows\Forms\Controls\DataGridView\DataGridViewImageColumn.cs (4)
276
return (!defaultCellStyle.BackColor.
IsEmpty
||
277
!defaultCellStyle.ForeColor.
IsEmpty
||
278
!defaultCellStyle.SelectionBackColor.
IsEmpty
||
279
!defaultCellStyle.SelectionForeColor.
IsEmpty
||
System\Windows\Forms\Controls\DataGridView\DataGridViewRow.cs (24)
615
if (cellStyle is not null && !cellStyle.BackColor.
IsEmpty
)
619
else if (!rowHeadersStyle.BackColor.
IsEmpty
)
628
if (cellStyle is not null && !cellStyle.ForeColor.
IsEmpty
)
632
else if (!rowHeadersStyle.ForeColor.
IsEmpty
)
641
if (cellStyle is not null && !cellStyle.SelectionBackColor.
IsEmpty
)
645
else if (!rowHeadersStyle.SelectionBackColor.
IsEmpty
)
654
if (cellStyle is not null && !cellStyle.SelectionForeColor.
IsEmpty
)
658
else if (!rowHeadersStyle.SelectionForeColor.
IsEmpty
)
809
if (rowStyle is not null && !rowStyle.BackColor.
IsEmpty
)
813
else if (!rowsDefaultCellStyle.BackColor.
IsEmpty
&& (rowIndex % 2 == 0 || alternatingRowsDefaultCellStyle.BackColor.
IsEmpty
))
817
else if (rowIndex % 2 == 1 && !alternatingRowsDefaultCellStyle.BackColor.
IsEmpty
)
826
if (rowStyle is not null && !rowStyle.ForeColor.
IsEmpty
)
830
else if (!rowsDefaultCellStyle.ForeColor.
IsEmpty
&& (rowIndex % 2 == 0 || alternatingRowsDefaultCellStyle.ForeColor.
IsEmpty
))
834
else if (rowIndex % 2 == 1 && !alternatingRowsDefaultCellStyle.ForeColor.
IsEmpty
)
843
if (rowStyle is not null && !rowStyle.SelectionBackColor.
IsEmpty
)
847
else if (!rowsDefaultCellStyle.SelectionBackColor.
IsEmpty
&& (rowIndex % 2 == 0 || alternatingRowsDefaultCellStyle.SelectionBackColor.
IsEmpty
))
851
else if (rowIndex % 2 == 1 && !alternatingRowsDefaultCellStyle.SelectionBackColor.
IsEmpty
)
860
if (rowStyle is not null && !rowStyle.SelectionForeColor.
IsEmpty
)
864
else if (!rowsDefaultCellStyle.SelectionForeColor.
IsEmpty
&& (rowIndex % 2 == 0 || alternatingRowsDefaultCellStyle.SelectionForeColor.
IsEmpty
))
868
else if (rowIndex % 2 == 1 && !alternatingRowsDefaultCellStyle.SelectionForeColor.
IsEmpty
)
System\Windows\Forms\Controls\DataGridView\DataGridViewRowHeaderCell.cs (8)
326
if (cellStyle is not null && !cellStyle.BackColor.
IsEmpty
)
330
else if (!rowHeadersStyle.BackColor.
IsEmpty
)
339
if (cellStyle is not null && !cellStyle.ForeColor.
IsEmpty
)
343
else if (!rowHeadersStyle.ForeColor.
IsEmpty
)
352
if (cellStyle is not null && !cellStyle.SelectionBackColor.
IsEmpty
)
356
else if (!rowHeadersStyle.SelectionBackColor.
IsEmpty
)
365
if (cellStyle is not null && !cellStyle.SelectionForeColor.
IsEmpty
)
369
else if (!rowHeadersStyle.SelectionForeColor.
IsEmpty
)
System\Windows\Forms\Controls\DateTimePicker\DateTimePicker.cs (5)
184
if (value.
IsEmpty
)
244
if (value.
IsEmpty
)
267
if (value.
IsEmpty
)
290
if (value.
IsEmpty
)
313
if (value.
IsEmpty
)
System\Windows\Forms\Controls\Labels\LinkLabel.cs (9)
72
get => _activeLinkColor.
IsEmpty
? IEActiveLinkColor : _activeLinkColor;
90
get => _disabledLinkColor.
IsEmpty
? IEDisabledLinkColor : _disabledLinkColor;
136
if (s_iedisabledLinkColor.
IsEmpty
)
237
get => _linkColor.
IsEmpty
348
get => _visitedLinkColor.
IsEmpty
1594
internal bool ShouldSerializeActiveLinkColor() => !_activeLinkColor.
IsEmpty
;
1599
internal bool ShouldSerializeDisabledLinkColor() => !_disabledLinkColor.
IsEmpty
;
1618
internal bool ShouldSerializeLinkColor() => !_linkColor.
IsEmpty
;
1633
private bool ShouldSerializeVisitedLinkColor() => !_visitedLinkColor.
IsEmpty
;
System\Windows\Forms\Controls\Labels\LinkUtilities.cs (3)
78
if (s_ielinkColor.
IsEmpty
)
91
if (s_ieactiveLinkColor.
IsEmpty
)
104
if (s_ievisitedLinkColor.
IsEmpty
)
System\Windows\Forms\Controls\ListView\ListView.cs (2)
2842
nmcd->clrText = !haveRenderInfo || riFore.
IsEmpty
2885
nmcd->clrTextBk = !haveRenderInfo || riBack.
IsEmpty
System\Windows\Forms\Controls\ListView\ListViewInsertionMark.cs (2)
69
if (_color.
IsEmpty
)
138
if (!_color.
IsEmpty
)
System\Windows\Forms\Controls\ListView\ListViewItem.ListViewSubItem.cs (2)
115
return !style.backColor.
IsEmpty
;
133
return !style.foreColor.
IsEmpty
;
System\Windows\Forms\Controls\MonthCalendar\MonthCalendar.cs (3)
913
if (value.
IsEmpty
)
934
if (value.
IsEmpty
)
955
if (value.
IsEmpty
)
System\Windows\Forms\Controls\ToolStrips\ToolStripItem.cs (7)
510
if (!c.
IsEmpty
)
864
if (!foreColor.
IsEmpty
)
1197
if (!color.
IsEmpty
)
2882
if (backColor.
IsEmpty
)
2930
if (foreColor.
IsEmpty
)
3287
return !backColor.
IsEmpty
;
3301
return !foreColor.
IsEmpty
;
System\Windows\Forms\Controls\ToolStrips\ToolStripLabel.cs (6)
95
if (_activeLinkColor.
IsEmpty
)
166
if (_linkColor.
IsEmpty
)
210
if (_visitedLinkColor.
IsEmpty
)
299
return !_activeLinkColor.
IsEmpty
;
305
return !_linkColor.
IsEmpty
;
311
return !_visitedLinkColor.
IsEmpty
;
System\Windows\Forms\Controls\TreeView\TreeNode.cs (4)
194
if (value.
IsEmpty
)
202
if (!oldbk.
IsEmpty
)
420
if (value.
IsEmpty
)
428
if (!oldfc.
IsEmpty
)
System\Windows\Forms\Controls\TreeView\TreeView.cs (2)
2785
if (renderinfo is not null && !riFore.
IsEmpty
)
2790
if (renderinfo is not null && !riBack.
IsEmpty
)
System\Windows\Forms\Dialogs\CommonDialogs\ColorDialog.cs (1)
62
set => _color = !value.
IsEmpty
? value : Color.Black;
System\Windows\Forms\Dialogs\CommonDialogs\FontDialog.cs (1)
105
if (!value.
IsEmpty
)
System\Windows\Forms\Form.cs (2)
594
if (!c.
IsEmpty
)
6046
if (transparencyKey.
IsEmpty
)
System\Windows\Forms\OwnerDrawPropertyBag.cs (2)
64
public virtual bool IsEmpty() => Font is null && ForeColor.
IsEmpty
&& BackColor.
IsEmpty
;
System\Windows\Forms\Rendering\TextExtensions.cs (2)
69
using var textColor = foreColor.
IsEmpty
? default : new SetTextColorScope(hdc, foreColor);
72
BACKGROUND_MODE newBackGroundMode = (backColor.
IsEmpty
|| backColor == Color.Transparent)
System\Windows\Forms\ToolTip\ToolTip.cs (1)
244
if (value.
IsEmpty
)
System.Windows.Forms.Design (3)
System\ComponentModel\Design\DesignerActionPanel.EditorPropertyLine.FlyoutDialog.cs (1)
38
if (!borderColor.
IsEmpty
)
System\Windows\Forms\Design\DocumentDesigner.cs (2)
136
if (value.
IsEmpty
)
1349
if (!ShadowProperties.Contains(nameof(BackColor)) || ((Color)ShadowProperties[nameof(BackColor)]).
IsEmpty
)
System.Windows.Forms.Tests (8)
System\Windows\Forms\ButtonBaseTests.cs (2)
620
Assert.Equal(value.
IsEmpty
, control.UseVisualStyleBackColor);
626
Assert.Equal(value.
IsEmpty
, control.UseVisualStyleBackColor);
System\Windows\Forms\OwnerDrawPropertyBagTests.cs (4)
32
Assert.Equal(value.
IsEmpty
, bag.IsEmpty());
37
Assert.Equal(value.
IsEmpty
, bag.IsEmpty());
66
Assert.Equal(value.
IsEmpty
, bag.IsEmpty());
71
Assert.Equal(value.
IsEmpty
, bag.IsEmpty());
System\Windows\Forms\TabPageTests.cs (2)
755
Assert.Equal(value.
IsEmpty
, control.UseVisualStyleBackColor);
761
Assert.Equal(value.
IsEmpty
, control.UseVisualStyleBackColor);