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