409 references to DataGridViewCellStyle
PresentationUI (2)
MS\Internal\Documents\RMPublishingDialog.RightsTable.cs (2)
461_textCellStyle = new DataGridViewCellStyle 469_boolCellStyle = new DataGridViewCellStyle
System.Windows.Forms (22)
System\Windows\Forms\Controls\DataGridView\DataGridView.cs (6)
802_alternatingRowsDefaultCellStyle = new DataGridViewCellStyle(); 1539DataGridViewCellStyle defaultStyle = new DataGridViewCellStyle 2052DataGridViewCellStyle defaultCellStyle = new DataGridViewCellStyle 2089DataGridViewCellStyle defaultStyle = new DataGridViewCellStyle 3048internal DataGridViewCellStyle PlaceholderCellStyle => _placeholderCellStyle ??= new DataGridViewCellStyle(); 3493_rowsDefaultCellStyle = new DataGridViewCellStyle();
System\Windows\Forms\Controls\DataGridView\DataGridView.Methods.cs (4)
19347DataGridViewCellStyle inheritedCellStyle = new(); 19680DataGridViewCellStyle inheritedCellStyle = new(); 28134DataGridViewCellStyle defaultStyle = new(); 28155DataGridViewCellStyle defaultStyle = new();
System\Windows\Forms\Controls\DataGridView\DataGridViewBand.cs (1)
87style = new DataGridViewCellStyle();
System\Windows\Forms\Controls\DataGridView\DataGridViewButtonColumn.cs (1)
19DataGridViewCellStyle defaultCellStyle = new DataGridViewCellStyle
System\Windows\Forms\Controls\DataGridView\DataGridViewCell.cs (1)
624dataGridViewCellStyle = new DataGridViewCellStyle();
System\Windows\Forms\Controls\DataGridView\DataGridViewCheckBoxColumn.cs (1)
20DataGridViewCellStyle defaultCellStyle = new DataGridViewCellStyle
System\Windows\Forms\Controls\DataGridView\DataGridViewColumn.cs (1)
441DataGridViewCellStyle inheritedCellStyleTmp = new();
System\Windows\Forms\Controls\DataGridView\DataGridViewColumnHeaderCell.cs (1)
284DataGridViewCellStyle inheritedCellStyleTmp = inheritedCellStyle ?? new DataGridViewCellStyle();
System\Windows\Forms\Controls\DataGridView\DataGridViewImageColumn.cs (1)
25DataGridViewCellStyle defaultCellStyle = new()
System\Windows\Forms\Controls\DataGridView\DataGridViewRow.cs (4)
236DataGridViewCellStyle inheritedRowStyle = new(); 1427DataGridViewCellStyle inheritedRowStyle = new(); 1511DataGridViewCellStyle inheritedCellStyle = new(); 1712DataGridViewCellStyle inheritedCellStyle = new();
System\Windows\Forms\Controls\DataGridView\DataGridViewRowHeaderCell.cs (1)
309DataGridViewCellStyle inheritedCellStyleTmp = inheritedCellStyle ?? new DataGridViewCellStyle();
System.Windows.Forms.Design.Tests (2)
System\Windows\Forms\Design\DataGridViewCellStyleBuilderTests.cs (1)
19builder.CellStyle = new DataGridViewCellStyle { BackColor = Color.Red };
System\Windows\Forms\Design\FormatStringEditorTests.cs (1)
25_cellStyle = new() { Format = "Initial" };
System.Windows.Forms.Tests (381)
System\Windows\Forms\DataGridViewButtonColumnTests.cs (2)
152DataGridViewCellStyle newStyle = new DataGridViewCellStyle { Alignment = DataGridViewContentAlignment.BottomRight }; 178_column.DefaultCellStyle = new DataGridViewCellStyle { Alignment = DataGridViewContentAlignment.BottomRight };
System\Windows\Forms\DataGridViewCellFormattingEventArgsTests.cs (5)
14yield return new object[] { 0, 0, "value", typeof(string), new DataGridViewCellStyle() }; 15yield return new object[] { 1, 2, "value", typeof(string), new DataGridViewCellStyle() }; 46yield return new object[] { new DataGridViewCellStyle() }; 53DataGridViewCellFormattingEventArgs e = new(1, 2, "value", typeof(string), new DataGridViewCellStyle()) 65DataGridViewCellFormattingEventArgs e = new(1, 2, "value", typeof(string), new DataGridViewCellStyle())
System\Windows\Forms\DataGridViewCellPaintingEventArgsTests.cs (18)
14yield return new object[] { Rectangle.Empty, Rectangle.Empty, -2, -2, DataGridViewElementStates.Displayed, null, null, null, new DataGridViewCellStyle(), null, DataGridViewPaintParts.All }; 15yield return new object[] { new Rectangle(-1, -2, -3, -4), new Rectangle(-1, -2, -3, -4), -1, -1, DataGridViewElementStates.Displayed, "value", "formattedValue", "", new DataGridViewCellStyle(), new DataGridViewAdvancedBorderStyle(), DataGridViewPaintParts.All }; 16yield return new object[] { new Rectangle(1, 2, 3, 4), new Rectangle(2, 3, 4, 5), 0, 1, (DataGridViewElementStates)7, "value", "formattedValue", "errorText", new DataGridViewCellStyle(), new DataGridViewAdvancedBorderStyle(), DataGridViewPaintParts.All }; 48Assert.Throws<ArgumentNullException>("dataGridView", () => new DataGridViewCellPaintingEventArgs(null, graphics, Rectangle.Empty, Rectangle.Empty, -2, -2, DataGridViewElementStates.Displayed, null, null, null, new DataGridViewCellStyle(), null, DataGridViewPaintParts.All)); 55Assert.Throws<ArgumentNullException>("graphics", () => new DataGridViewCellPaintingEventArgs(dataGridView, null, Rectangle.Empty, Rectangle.Empty, -2, -2, DataGridViewElementStates.Displayed, null, null, null, new DataGridViewCellStyle(), null, DataGridViewPaintParts.All)); 74Assert.Throws<ArgumentException>("paintParts", () => new DataGridViewCellPaintingEventArgs(dataGridView, graphics, Rectangle.Empty, Rectangle.Empty, -2, -2, DataGridViewElementStates.Displayed, null, null, null, new DataGridViewCellStyle(), null, paintParts)); 86DataGridViewCellPaintingEventArgs e = new(dataGridView, graphics, Rectangle.Empty, Rectangle.Empty, rowIndex, columnIndex, DataGridViewElementStates.Displayed, null, null, null, new DataGridViewCellStyle(), new DataGridViewAdvancedBorderStyle(), DataGridViewPaintParts.All); 97DataGridViewCellPaintingEventArgs e = new(dataGridView, graphics, Rectangle.Empty, Rectangle.Empty, 0, 0, DataGridViewElementStates.Displayed, null, null, null, new DataGridViewCellStyle(), null, DataGridViewPaintParts.All); 110DataGridViewCellPaintingEventArgs e = new(dataGridView, graphics, Rectangle.Empty, Rectangle.Empty, rowIndex, 0, DataGridViewElementStates.Displayed, null, null, null, new DataGridViewCellStyle(), null, DataGridViewPaintParts.All); 123DataGridViewCellPaintingEventArgs e = new(dataGridView, graphics, Rectangle.Empty, Rectangle.Empty, 0, columnIndex, DataGridViewElementStates.Displayed, null, null, null, new DataGridViewCellStyle(), null, DataGridViewPaintParts.All); 136DataGridViewCellPaintingEventArgs e = new(dataGridView, graphics, Rectangle.Empty, Rectangle.Empty, rowIndex, columnIndex, DataGridViewElementStates.Displayed, null, null, null, new DataGridViewCellStyle(), new DataGridViewAdvancedBorderStyle(), DataGridViewPaintParts.All); 147DataGridViewCellPaintingEventArgs e = new(dataGridView, graphics, Rectangle.Empty, Rectangle.Empty, 0, 0, DataGridViewElementStates.Displayed, null, null, null, new DataGridViewCellStyle(), null, DataGridViewPaintParts.All); 160DataGridViewCellPaintingEventArgs e = new(dataGridView, graphics, Rectangle.Empty, Rectangle.Empty, rowIndex, 0, DataGridViewElementStates.Displayed, null, null, null, new DataGridViewCellStyle(), null, DataGridViewPaintParts.All); 173DataGridViewCellPaintingEventArgs e = new(dataGridView, graphics, Rectangle.Empty, Rectangle.Empty, 0, columnIndex, DataGridViewElementStates.Displayed, null, null, null, new DataGridViewCellStyle(), null, DataGridViewPaintParts.All); 186DataGridViewCellPaintingEventArgs e = new(dataGridView, graphics, Rectangle.Empty, Rectangle.Empty, rowIndex, columnIndex, DataGridViewElementStates.Displayed, null, null, null, new DataGridViewCellStyle(), new DataGridViewAdvancedBorderStyle(), DataGridViewPaintParts.All); 197DataGridViewCellPaintingEventArgs e = new(dataGridView, graphics, Rectangle.Empty, Rectangle.Empty, 0, 0, DataGridViewElementStates.Displayed, null, null, null, new DataGridViewCellStyle(), null, DataGridViewPaintParts.All); 210DataGridViewCellPaintingEventArgs e = new(dataGridView, graphics, Rectangle.Empty, Rectangle.Empty, rowIndex, 0, DataGridViewElementStates.Displayed, null, null, null, new DataGridViewCellStyle(), null, DataGridViewPaintParts.All); 223DataGridViewCellPaintingEventArgs e = new(dataGridView, graphics, Rectangle.Empty, Rectangle.Empty, 0, columnIndex, DataGridViewElementStates.Displayed, null, null, null, new DataGridViewCellStyle(), null, DataGridViewPaintParts.All);
System\Windows\Forms\DataGridViewCellParsingEventArgsTests.cs (5)
15yield return new object[] { 0, 0, "value", typeof(string), new DataGridViewCellStyle() }; 16yield return new object[] { 1, 2, "value", typeof(string), new DataGridViewCellStyle() }; 35yield return new object[] { new DataGridViewCellStyle() }; 42DataGridViewCellParsingEventArgs e = new(1, 2, "value", typeof(string), new DataGridViewCellStyle()) 54DataGridViewCellParsingEventArgs e = new(1, 2, "value", typeof(string), new DataGridViewCellStyle())
System\Windows\Forms\DataGridViewCellStyleConverterTests.cs (1)
17_style = new();
System\Windows\Forms\DataGridViewCellStyleTests.cs (126)
18DataGridViewCellStyle style = new(); 42DataGridViewCellStyle source = new() 82DataGridViewCellStyle source = new(); 114DataGridViewCellStyle style = new() 129DataGridViewCellStyle style = new(); 137DataGridViewCellStyle style = new() 151DataGridViewCellStyle style = new() 172DataGridViewCellStyle style = new() 189DataGridViewCellStyle style = new() 207DataGridViewCellStyle style = new() 225DataGridViewCellStyle style = new() 238DataGridViewCellStyle style = new() 250DataGridViewCellStyle style = new() 269DataGridViewCellStyle style = new() 283DataGridViewCellStyle style = new() 295DataGridViewCellStyle style = new() 309DataGridViewCellStyle style = new() 321DataGridViewCellStyle style = new() 336DataGridViewCellStyle style = new() 356DataGridViewCellStyle style = new() 372DataGridViewCellStyle style = new() 394DataGridViewCellStyle style = new() 411DataGridViewCellStyle style = new() 429DataGridViewCellStyle style = new() 447DataGridViewCellStyle style = new() 460DataGridViewCellStyle style = new() 472DataGridViewCellStyle style = new() 498DataGridViewCellStyle style = new() 513DataGridViewCellStyle style = new() 527DataGridViewCellStyle style = new() 539DataGridViewCellStyle style = new() 553DataGridViewCellStyle style = new() 565DataGridViewCellStyle style = new() 580DataGridViewCellStyle style = new() 596DataGridViewCellStyle style = new() 611DataGridViewCellStyle style = new(); 619DataGridViewCellStyle source = new() 635DataGridViewCellStyle style = new(); 661DataGridViewCellStyle source = new(); 662DataGridViewCellStyle style = new() 702DataGridViewCellStyle style = new(); 710DataGridViewCellStyle source = new() 750DataGridViewCellStyle source = new(); 776ICloneable source = new DataGridViewCellStyle 816ICloneable source = new DataGridViewCellStyle(); 843yield return new object[] { new DataGridViewCellStyle(), new DataGridViewCellStyle(), true }; 847new DataGridViewCellStyle { Alignment = DataGridViewContentAlignment.BottomCenter }, 848new DataGridViewCellStyle { Alignment = DataGridViewContentAlignment.BottomCenter }, 853new DataGridViewCellStyle { Alignment = DataGridViewContentAlignment.BottomCenter }, 854new DataGridViewCellStyle { Alignment = DataGridViewContentAlignment.BottomRight }, 859new DataGridViewCellStyle { BackColor = Color.Red }, 860new DataGridViewCellStyle { BackColor = Color.Red }, 865new DataGridViewCellStyle { BackColor = Color.Red }, 866new DataGridViewCellStyle { BackColor = Color.Blue }, 871new DataGridViewCellStyle { DataSourceNullValue = "dbNull" }, 872new DataGridViewCellStyle { DataSourceNullValue = "dbNull" }, 877new DataGridViewCellStyle { DataSourceNullValue = "dbNull" }, 878new DataGridViewCellStyle { DataSourceNullValue = "other" }, 883new DataGridViewCellStyle { DataSourceNullValue = null }, 884new DataGridViewCellStyle { DataSourceNullValue = null }, 889new DataGridViewCellStyle { DataSourceNullValue = null }, 890new DataGridViewCellStyle { DataSourceNullValue = "other" }, 895new DataGridViewCellStyle { ForeColor = Color.Red }, 896new DataGridViewCellStyle { ForeColor = Color.Red }, 901new DataGridViewCellStyle { ForeColor = Color.Red }, 902new DataGridViewCellStyle { ForeColor = Color.Blue }, 907new DataGridViewCellStyle { Font = font }, 908new DataGridViewCellStyle { Font = font }, 913new DataGridViewCellStyle { Font = font }, 914new DataGridViewCellStyle { Font = SystemFonts.MenuFont }, 919new DataGridViewCellStyle { Format = "format" }, 920new DataGridViewCellStyle { Format = "format" }, 925new DataGridViewCellStyle { Format = "format" }, 926new DataGridViewCellStyle { Format = "other" }, 931new DataGridViewCellStyle { FormatProvider = formatProvider }, 932new DataGridViewCellStyle { FormatProvider = formatProvider }, 937new DataGridViewCellStyle { FormatProvider = formatProvider }, 938new DataGridViewCellStyle { FormatProvider = CultureInfo.CurrentCulture }, 943new DataGridViewCellStyle { NullValue = "null" }, 944new DataGridViewCellStyle { NullValue = "null" }, 949new DataGridViewCellStyle { NullValue = "null" }, 950new DataGridViewCellStyle { NullValue = "other" }, 955new DataGridViewCellStyle { NullValue = null }, 956new DataGridViewCellStyle { NullValue = null }, 961new DataGridViewCellStyle { NullValue = null }, 962new DataGridViewCellStyle { NullValue = "other" }, 967new DataGridViewCellStyle { Padding = new Padding(1, 2, 3, 4) }, 968new DataGridViewCellStyle { Padding = new Padding(1, 2, 3, 4) }, 973new DataGridViewCellStyle { Padding = new Padding(1, 2, 3, 4) }, 974new DataGridViewCellStyle { Padding = new Padding(2, 3, 4, 5) }, 979new DataGridViewCellStyle { SelectionBackColor = Color.Red }, 980new DataGridViewCellStyle { SelectionBackColor = Color.Red }, 985new DataGridViewCellStyle { SelectionBackColor = Color.Red }, 986new DataGridViewCellStyle { SelectionBackColor = Color.Blue }, 991new DataGridViewCellStyle { SelectionForeColor = Color.Red }, 992new DataGridViewCellStyle { SelectionForeColor = Color.Red }, 997new DataGridViewCellStyle { SelectionForeColor = Color.Red }, 998new DataGridViewCellStyle { SelectionForeColor = Color.Blue }, 1003new DataGridViewCellStyle { Tag = "tag" }, 1004new DataGridViewCellStyle { Tag = "tag" }, 1009new DataGridViewCellStyle { Tag = "tag" }, 1010new DataGridViewCellStyle { Tag = "other" }, 1015new DataGridViewCellStyle { WrapMode = DataGridViewTriState.True }, 1016new DataGridViewCellStyle { WrapMode = DataGridViewTriState.True }, 1021new DataGridViewCellStyle { WrapMode = DataGridViewTriState.True }, 1022new DataGridViewCellStyle { WrapMode = DataGridViewTriState.False }, 1026yield return new object[] { new DataGridViewCellStyle(), new(), false }; 1027yield return new object[] { new DataGridViewCellStyle(), null, false }; 1044yield return new object[] { new DataGridViewCellStyle(), "DataGridViewCellStyle { }" }; 1047new DataGridViewCellStyle { Alignment = DataGridViewContentAlignment.BottomCenter }, 1052new DataGridViewCellStyle { BackColor = Color.Red }, 1057new DataGridViewCellStyle { DataSourceNullValue = "dbNull" }, 1062new DataGridViewCellStyle { DataSourceNullValue = null }, 1067new DataGridViewCellStyle { ForeColor = Color.Red }, 1072new DataGridViewCellStyle { Font = SystemFonts.DefaultFont }, 1077new DataGridViewCellStyle { Format = "format" }, 1082new DataGridViewCellStyle { FormatProvider = new NumberFormatInfo() }, 1087new DataGridViewCellStyle { NullValue = "null" }, 1092new DataGridViewCellStyle { NullValue = null }, 1097new DataGridViewCellStyle { Padding = new Padding(1, 2, 3, 4) }, 1102new DataGridViewCellStyle { SelectionBackColor = Color.Red }, 1107new DataGridViewCellStyle { SelectionForeColor = Color.Red }, 1112new DataGridViewCellStyle { Tag = "tag" }, 1117new DataGridViewCellStyle { WrapMode = DataGridViewTriState.True }, 1124new DataGridViewCellStyle
System\Windows\Forms\DataGridViewCellTests.cs (81)
2242yield return new object[] { null, new DataGridViewCellStyle() }; 2244DataGridViewCellStyle style = new() { Alignment = DataGridViewContentAlignment.BottomRight }; 2269DataGridViewCellStyle oldValue = new() 2309DataGridViewCellStyle oldValue = new() 2352DataGridViewCellStyle oldValue = new() 2400DataGridViewCellStyle oldValue = new() 2446DataGridViewCellStyle style1 = new() 2464DataGridViewCellStyle style2 = new() 3323Style = new DataGridViewCellStyle { Alignment = DataGridViewContentAlignment.BottomLeft }, 3356Assert.Equal(new DataGridViewCellStyle { Alignment = DataGridViewContentAlignment.BottomLeft }, cell.Style); 3393Assert.Equal(new DataGridViewCellStyle(), cell.Style); 3660yield return new object[] { new DataGridViewCellStyle(), -2 }; 3661yield return new object[] { new DataGridViewCellStyle(), -1 }; 3662yield return new object[] { new DataGridViewCellStyle(), 0 }; 3663yield return new object[] { new DataGridViewCellStyle(), 1 }; 3812yield return new object[] { new DataGridViewCellStyle(), -2 }; 3813yield return new object[] { new DataGridViewCellStyle(), -1 }; 3814yield return new object[] { new DataGridViewCellStyle(), 0 }; 3815yield return new object[] { new DataGridViewCellStyle(), 1 }; 4138yield return new object[] { "value", -2, new DataGridViewCellStyle(), new Int32Converter(), new Int32Converter(), DataGridViewDataErrorContexts.Formatting, null }; 4139yield return new object[] { "value", -1, new DataGridViewCellStyle(), new Int32Converter(), new Int32Converter(), DataGridViewDataErrorContexts.Formatting, null }; 4140yield return new object[] { "value", 0, new DataGridViewCellStyle(), new Int32Converter(), new Int32Converter(), DataGridViewDataErrorContexts.Formatting, null }; 4701Assert.Throws<InvalidOperationException>(() => cell.GetInheritedStyle(new DataGridViewCellStyle(), -1, true)); 4708Assert.Throws<InvalidOperationException>(() => cell.GetInheritedStyle(new DataGridViewCellStyle(), -1, true)); 4717Assert.Throws<InvalidOperationException>(() => cell.GetInheritedStyle(new DataGridViewCellStyle(), -1, true)); 4726Assert.Throws<InvalidOperationException>(() => cell.GetInheritedStyle(new DataGridViewCellStyle(), -1, true)); 4743Assert.Throws<ArgumentOutOfRangeException>("rowIndex", () => cell.GetInheritedStyle(new DataGridViewCellStyle(), rowIndex, true)); 5747Style = new DataGridViewCellStyle() 6031cell.PaintBorder(graphics, new Rectangle(1, 2, 3, 4), new Rectangle(1, 2, 3, 4), new DataGridViewCellStyle(), new DataGridViewAdvancedBorderStyle()); 6038Assert.Throws<ArgumentNullException>("graphics", () => cell.PaintBorder(null, new Rectangle(1, 2, 3, 4), new Rectangle(1, 2, 3, 4), new DataGridViewCellStyle(), new DataGridViewAdvancedBorderStyle())); 6089yield return new object[] { typeof(object), typeof(string), "value", new DataGridViewCellStyle(), null, null, "value" }; 6090yield return new object[] { typeof(string), typeof(string), "value", new DataGridViewCellStyle(), null, null, "value" }; 6091yield return new object[] { typeof(object), typeof(int), 1, new DataGridViewCellStyle(), null, null, 1 }; 6092yield return new object[] { typeof(int), typeof(int), 1, new DataGridViewCellStyle(), null, null, 1 }; 6095yield return new object[] { typeof(object), typeof(DBNull), DBNull.Value, new DataGridViewCellStyle(), null, null, null }; 6096yield return new object[] { typeof(string), typeof(string), "null", new DataGridViewCellStyle { NullValue = "null" }, null, null, null }; 6097yield return new object[] { typeof(object), typeof(string), "null", new DataGridViewCellStyle { NullValue = "null" }, null, null, null }; 6098yield return new object[] { typeof(object), typeof(string), "s", new DataGridViewCellStyle { NullValue = "null" }, null, null, "s" }; 6099yield return new object[] { typeof(object), typeof(string), "longer", new DataGridViewCellStyle { NullValue = "null" }, null, null, "longer" }; 6100yield return new object[] { typeof(object), typeof(string), "abcd", new DataGridViewCellStyle { NullValue = "null" }, null, null, "abcd" }; 6101yield return new object[] { typeof(object), typeof(string), "null", new DataGridViewCellStyle { NullValue = "null" }, null, null, null }; 6102yield return new object[] { typeof(int), typeof(int), 1, new DataGridViewCellStyle { NullValue = 1 }, null, null, DBNull.Value }; 6103yield return new object[] { typeof(int), typeof(int), 2, new DataGridViewCellStyle { NullValue = 1 }, null, null, 2 }; 6104yield return new object[] { typeof(string), typeof(string), "null", new DataGridViewCellStyle { NullValue = "null", DataSourceNullValue = "dbNull" }, null, null, "dbNull" }; 6105yield return new object[] { typeof(int), typeof(int), 1, new DataGridViewCellStyle { NullValue = 1, DataSourceNullValue = "dbNull" }, null, null, "dbNull" }; 6108yield return new object[] { typeof(string), typeof(int), 123, new DataGridViewCellStyle(), new Int32Converter(), new Int32Converter(), "123" }; 6109yield return new object[] { typeof(string), typeof(int), 123, new DataGridViewCellStyle(), new Int32Converter(), null, "123" }; 6110yield return new object[] { typeof(string), typeof(int), 123, new DataGridViewCellStyle(), null, new Int32Converter(), "123" }; 6111yield return new object[] { typeof(string), typeof(int?), 123, new DataGridViewCellStyle(), null, null, "123" }; 6112yield return new object[] { typeof(int), typeof(string), "123", new DataGridViewCellStyle(), null, null, 123 }; 6113yield return new object[] { typeof(int), typeof(string), "123", new DataGridViewCellStyle { FormatProvider = CultureInfo.InvariantCulture }, null, null, 123 }; 6114yield return new object[] { typeof(int), typeof(string), "123", new DataGridViewCellStyle { FormatProvider = new NumberFormatInfo() }, null, null, 123 }; 6117yield return new object[] { typeof(string), typeof(int), 123, new DataGridViewCellStyle(), new Int16Converter(), null, "123" }; 6118yield return new object[] { typeof(string), typeof(int), 123, new DataGridViewCellStyle(), null, new Int16Converter(), "123" }; 6121yield return new object[] { typeof(short), typeof(int), 123, new DataGridViewCellStyle(), null, null, (short)123 }; 6122yield return new object[] { typeof(short), typeof(int), 123, new DataGridViewCellStyle { FormatProvider = CultureInfo.InvariantCulture }, null, null, (short)123 }; 6123yield return new object[] { typeof(short), typeof(int), 123, new DataGridViewCellStyle { FormatProvider = new NumberFormatInfo() }, null, null, (short)123 }; 6124yield return new object[] { typeof(short?), typeof(int), 123, new DataGridViewCellStyle(), null, null, (short)123 }; 6125yield return new object[] { typeof(short), typeof(int?), 123, new DataGridViewCellStyle(), null, null, (short)123 }; 6128yield return new object[] { typeof(int?), typeof(int?), 123, new DataGridViewCellStyle(), null, null, 123 }; 6129yield return new object[] { typeof(int?), typeof(int), 123, new DataGridViewCellStyle(), null, null, 123 }; 6130yield return new object[] { typeof(int), typeof(int?), 123, new DataGridViewCellStyle(), null, null, 123 }; 6131yield return new object[] { typeof(string), typeof(int?), 123, new DataGridViewCellStyle(), null, null, "123" }; 6134yield return new object[] { typeof(bool), typeof(CheckState), CheckState.Indeterminate, new DataGridViewCellStyle(), null, null, DBNull.Value }; 6135yield return new object[] { typeof(bool), typeof(CheckState), CheckState.Checked, new DataGridViewCellStyle(), null, null, true }; 6136yield return new object[] { typeof(bool), typeof(CheckState), CheckState.Unchecked, new DataGridViewCellStyle(), null, null, false }; 6137yield return new object[] { typeof(bool), typeof(CheckState), CheckState.Unchecked - 1, new DataGridViewCellStyle(), null, null, false }; 6138yield return new object[] { typeof(bool), typeof(CheckState), CheckState.Indeterminate + 1, new DataGridViewCellStyle(), null, null, false }; 6139yield return new object[] { typeof(CheckState), typeof(CheckState), CheckState.Checked, new DataGridViewCellStyle(), null, null, CheckState.Checked }; 6140yield return new object[] { typeof(int), typeof(CheckState), CheckState.Checked, new DataGridViewCellStyle(), null, null, 1 }; 6141yield return new object[] { typeof(int), typeof(CheckState), CheckState.Checked, new DataGridViewCellStyle(), new EnumConverter(typeof(CheckState)), null, 1 }; 6142yield return new object[] { typeof(int), typeof(CheckState), CheckState.Checked, new DataGridViewCellStyle(), null, new EnumConverter(typeof(CheckState)), 1 }; 6171Assert.Throws<FormatException>(() => cell.ParseFormattedValue(1, new DataGridViewCellStyle(), new Int32Converter(), new Int32Converter())); 6178Assert.Throws<FormatException>(() => cell.ParseFormattedValue(1, new DataGridViewCellStyle(), new Int32Converter(), new Int32Converter())); 6185Assert.Throws<FormatException>(() => cell.ParseFormattedValue(1, new DataGridViewCellStyle(), new Int32Converter(), new Int32Converter())); 6190yield return new object[] { typeof(DataGridViewCellTests), typeof(int), 123, new DataGridViewCellStyle(), null, null }; 6191yield return new object[] { typeof(DataGridViewCell), typeof(DataGridViewCellTests), new DataGridViewCellTests(), new DataGridViewCellStyle(), null, null }; 6192yield return new object[] { typeof(int), typeof(string), "Invalid", new DataGridViewCellStyle(), null, null }; 6217Assert.Throws<ArgumentException>("formattedValue", () => cell.ParseFormattedValue(formattedValue, new DataGridViewCellStyle(), new Int32Converter(), new Int32Converter())); 6231Assert.Throws<InvalidOperationException>(() => cell.PositionEditingControl(true, true, new Rectangle(1, 2, 3, 4), new Rectangle(1, 2, 3, 4), new DataGridViewCellStyle(), true, true, true, true)); 6238Assert.Throws<InvalidOperationException>(() => cell.PositionEditingPanel(new Rectangle(1, 2, 3, 4), new Rectangle(1, 2, 3, 4), new DataGridViewCellStyle(), true, true, true, true));
System\Windows\Forms\DataGridViewColumnTests.cs (7)
740yield return new object[] { null, new DataGridViewCellStyle() }; 742DataGridViewCellStyle style1 = new() { Alignment = DataGridViewContentAlignment.MiddleCenter }; 743DataGridViewCellStyle style2 = new() { Alignment = DataGridViewContentAlignment.BottomLeft }; 769DataGridViewCellStyle oldValue = new() 816DataGridViewCellStyle oldValue = new() 861DataGridViewCellStyle style1 = new() 879DataGridViewCellStyle style2 = new()
System\Windows\Forms\DataGridViewEditingControlShowingEventArgsTests.cs (3)
13yield return new object[] { null, new DataGridViewCellStyle() }; 28DataGridViewCellStyle cellStyle = new(); 38DataGridViewEditingControlShowingEventArgs e = new(button, new DataGridViewCellStyle());
System\Windows\Forms\DataGridViewHeaderCellTests.cs (6)
2025Style = new DataGridViewCellStyle { Alignment = DataGridViewContentAlignment.BottomLeft }, 2058Assert.Equal(new DataGridViewCellStyle { Alignment = DataGridViewContentAlignment.BottomLeft }, cell.Style); 2095Assert.Equal(new DataGridViewCellStyle(), cell.Style); 2111Style = new DataGridViewCellStyle { Alignment = DataGridViewContentAlignment.BottomLeft }, 2144Assert.Equal(new DataGridViewCellStyle { Alignment = DataGridViewContentAlignment.BottomLeft }, cell.Style); 2181Assert.Equal(new DataGridViewCellStyle(), cell.Style);
System\Windows\Forms\DataGridViewRowPostPaintEventArgsTests.cs (17)
14yield return new object[] { Rectangle.Empty, Rectangle.Empty, -2, DataGridViewElementStates.Displayed, null, new DataGridViewCellStyle(), false, false }; 15yield return new object[] { new Rectangle(-1, -2, -3, -4), new Rectangle(-1, -2, -3, -4), -1, DataGridViewElementStates.Displayed, "", new DataGridViewCellStyle(), true, false }; 16yield return new object[] { new Rectangle(1, 2, 3, 4), new Rectangle(2, 3, 4, 5), 0, (DataGridViewElementStates)7, "errorText", new DataGridViewCellStyle(), true, true }; 44Assert.Throws<ArgumentNullException>("dataGridView", () => new DataGridViewRowPostPaintEventArgs(null, graphics, Rectangle.Empty, Rectangle.Empty, -2, DataGridViewElementStates.Displayed, null, new DataGridViewCellStyle(), false, false)); 51Assert.Throws<ArgumentNullException>("graphics", () => new DataGridViewRowPostPaintEventArgs(dataGridView, null, Rectangle.Empty, Rectangle.Empty, -2, DataGridViewElementStates.Displayed, null, new DataGridViewCellStyle(), false, false)); 77DataGridViewRowPostPaintEventArgs e = new(dataGridView, graphics, Rectangle.Empty, Rectangle.Empty, -2, DataGridViewElementStates.Displayed, null, new DataGridViewCellStyle(), false, false) 91DataGridViewRowPostPaintEventArgs e = new(dataGridView, graphics, Rectangle.Empty, Rectangle.Empty, 0, DataGridViewElementStates.Displayed, null, new DataGridViewCellStyle(), false, false); 104DataGridViewRowPostPaintEventArgs e = new(dataGridView, graphics, Rectangle.Empty, Rectangle.Empty, rowIndex, DataGridViewElementStates.Displayed, null, new DataGridViewCellStyle(), false, false); 115DataGridViewRowPostPaintEventArgs e = new(dataGridView, graphics, Rectangle.Empty, Rectangle.Empty, 0, DataGridViewElementStates.Displayed, null, new DataGridViewCellStyle(), false, false); 128DataGridViewRowPostPaintEventArgs e = new(dataGridView, graphics, Rectangle.Empty, Rectangle.Empty, rowIndex, DataGridViewElementStates.Displayed, null, new DataGridViewCellStyle(), false, false); 139DataGridViewRowPostPaintEventArgs e = new(dataGridView, graphics, Rectangle.Empty, Rectangle.Empty, 0, DataGridViewElementStates.Displayed, null, new DataGridViewCellStyle(), false, false); 152DataGridViewRowPostPaintEventArgs e = new(dataGridView, graphics, Rectangle.Empty, Rectangle.Empty, rowIndex, DataGridViewElementStates.Displayed, null, new DataGridViewCellStyle(), false, false); 163DataGridViewRowPostPaintEventArgs e = new(dataGridView, graphics, Rectangle.Empty, Rectangle.Empty, 0, DataGridViewElementStates.Displayed, null, new DataGridViewCellStyle(), false, false); 176DataGridViewRowPostPaintEventArgs e = new(dataGridView, graphics, Rectangle.Empty, Rectangle.Empty, rowIndex, DataGridViewElementStates.Displayed, null, new DataGridViewCellStyle(), false, false); 187DataGridViewRowPostPaintEventArgs e = new(dataGridView, graphics, Rectangle.Empty, Rectangle.Empty, 0, DataGridViewElementStates.Displayed, null, new DataGridViewCellStyle(), false, false); 200DataGridViewRowPostPaintEventArgs e = new(dataGridView, graphics, Rectangle.Empty, Rectangle.Empty, 0, DataGridViewElementStates.Displayed, null, new DataGridViewCellStyle(), false, false); 213DataGridViewRowPostPaintEventArgs e = new(dataGridView, graphics, Rectangle.Empty, Rectangle.Empty, rowIndex, DataGridViewElementStates.Displayed, null, new DataGridViewCellStyle(), false, false);
System\Windows\Forms\DataGridViewRowPrePaintEventArgsTests.cs (19)
17yield return new object[] { new DataGridView(), graphics, Rectangle.Empty, Rectangle.Empty, -2, DataGridViewElementStates.Displayed, null, new DataGridViewCellStyle(), false, false }; 18yield return new object[] { new DataGridView(), graphics, new Rectangle(-1, -2, -3, -4), new Rectangle(-1, -2, -3, -4), -1, DataGridViewElementStates.Displayed, "", new DataGridViewCellStyle(), true, false }; 19yield return new object[] { new DataGridView(), graphics, new Rectangle(1, 2, 3, 4), new Rectangle(2, 3, 4, 5), 0, (DataGridViewElementStates)7, "errorText", new DataGridViewCellStyle(), true, true }; 45Assert.Throws<ArgumentNullException>("dataGridView", () => new DataGridViewRowPrePaintEventArgs(null, graphics, Rectangle.Empty, Rectangle.Empty, -2, DataGridViewElementStates.Displayed, null, new DataGridViewCellStyle(), false, false)); 52Assert.Throws<ArgumentNullException>("graphics", () => new DataGridViewRowPrePaintEventArgs(dataGridView, null, Rectangle.Empty, Rectangle.Empty, -2, DataGridViewElementStates.Displayed, null, new DataGridViewCellStyle(), false, false)); 78DataGridViewRowPrePaintEventArgs e = new(dataGridView, graphics, Rectangle.Empty, Rectangle.Empty, -2, DataGridViewElementStates.Displayed, null, new DataGridViewCellStyle(), false, false) 93DataGridViewRowPrePaintEventArgs e = new(dataGridView, graphics, Rectangle.Empty, Rectangle.Empty, -2, DataGridViewElementStates.Displayed, null, new DataGridViewCellStyle(), false, false) 107DataGridViewRowPrePaintEventArgs e = new(dataGridView, graphics, Rectangle.Empty, Rectangle.Empty, -2, DataGridViewElementStates.Displayed, null, new DataGridViewCellStyle(), false, false); 118DataGridViewRowPrePaintEventArgs e = new(dataGridView, graphics, Rectangle.Empty, Rectangle.Empty, 0, DataGridViewElementStates.Displayed, null, new DataGridViewCellStyle(), false, false); 131DataGridViewRowPrePaintEventArgs e = new(dataGridView, graphics, Rectangle.Empty, Rectangle.Empty, rowIndex, DataGridViewElementStates.Displayed, null, new DataGridViewCellStyle(), false, false); 142DataGridViewRowPrePaintEventArgs e = new(dataGridView, graphics, Rectangle.Empty, Rectangle.Empty, 0, DataGridViewElementStates.Displayed, null, new DataGridViewCellStyle(), false, false); 155DataGridViewRowPrePaintEventArgs e = new(dataGridView, graphics, Rectangle.Empty, Rectangle.Empty, rowIndex, DataGridViewElementStates.Displayed, null, new DataGridViewCellStyle(), false, false); 166DataGridViewRowPrePaintEventArgs e = new(dataGridView, graphics, Rectangle.Empty, Rectangle.Empty, 0, DataGridViewElementStates.Displayed, null, new DataGridViewCellStyle(), false, false); 179DataGridViewRowPrePaintEventArgs e = new(dataGridView, graphics, Rectangle.Empty, Rectangle.Empty, rowIndex, DataGridViewElementStates.Displayed, null, new DataGridViewCellStyle(), false, false); 190DataGridViewRowPrePaintEventArgs e = new(dataGridView, graphics, Rectangle.Empty, Rectangle.Empty, 0, DataGridViewElementStates.Displayed, null, new DataGridViewCellStyle(), false, false); 203DataGridViewRowPrePaintEventArgs e = new(dataGridView, graphics, Rectangle.Empty, Rectangle.Empty, rowIndex, DataGridViewElementStates.Displayed, null, new DataGridViewCellStyle(), false, false); 214DataGridViewRowPrePaintEventArgs e = new(dataGridView, graphics, Rectangle.Empty, Rectangle.Empty, 0, DataGridViewElementStates.Displayed, null, new DataGridViewCellStyle(), false, false); 227DataGridViewRowPrePaintEventArgs e = new(dataGridView, graphics, Rectangle.Empty, Rectangle.Empty, 0, DataGridViewElementStates.Displayed, null, new DataGridViewCellStyle(), false, false); 240DataGridViewRowPrePaintEventArgs e = new(dataGridView, graphics, Rectangle.Empty, Rectangle.Empty, rowIndex, DataGridViewElementStates.Displayed, null, new DataGridViewCellStyle(), false, false);
System\Windows\Forms\DataGridViewRowTests.cs (25)
390yield return new object[] { null, new DataGridViewCellStyle() }; 392DataGridViewCellStyle style1 = new() { Alignment = DataGridViewContentAlignment.MiddleCenter }; 393DataGridViewCellStyle style2 = new() { Alignment = DataGridViewContentAlignment.BottomLeft }; 419DataGridViewCellStyle oldValue = new() 465DataGridViewCellStyle oldValue = new() 508DataGridViewCellStyle style1 = new() 526DataGridViewCellStyle style2 = new() 570Assert.Throws<InvalidOperationException>(() => row.DefaultCellStyle = new DataGridViewCellStyle()); 2063DataGridViewCellStyle complete1 = new() 2079DataGridViewCellStyle complete2 = new() 21021, new DataGridViewCellStyle(), complete1, null, null, 21121, null, new DataGridViewCellStyle(), complete1, null, 21221, null, null, new DataGridViewCellStyle(), complete1, 21322, null, null, new DataGridViewCellStyle(), complete1, 3926DataGridViewCellStyle style = new() { Alignment = DataGridViewContentAlignment.BottomRight }; 3966DataGridViewCellStyle style = new() 4009DataGridViewCellStyle style = new() 4186yield return new object[] { Rectangle.Empty, Rectangle.Empty, -1, DataGridViewElementStates.None, new DataGridViewCellStyle(), false }; 4187yield return new object[] { Rectangle.Empty, Rectangle.Empty, 0, DataGridViewElementStates.None, new DataGridViewCellStyle(), false }; 4188yield return new object[] { new Rectangle(1, 2, 3, 4), new Rectangle(1, 2, 3, 4), 1, DataGridViewElementStates.Selected, new DataGridViewCellStyle { BackColor = Color.Blue, SelectionBackColor = Color.Red }, true }; 4189yield return new object[] { new Rectangle(1, 2, 3, 4), new Rectangle(1, 2, 3, 4), 1, DataGridViewElementStates.Selected, new DataGridViewCellStyle { BackColor = Color.Blue, SelectionBackColor = Color.Red }, true }; 4190yield return new object[] { new Rectangle(1, 2, 3, 4), new Rectangle(1, 2, 3, 4), 1, DataGridViewElementStates.None, new DataGridViewCellStyle { BackColor = Color.Blue, SelectionBackColor = Color.Red }, true }; 4191yield return new object[] { new Rectangle(1, 2, 3, 4), new Rectangle(1, 2, 3, 4), 1, DataGridViewElementStates.None, new DataGridViewCellStyle { BackColor = Color.Blue, SelectionBackColor = Color.Red }, false }; 4217Assert.Throws<InvalidOperationException>(() => row.DrawFocus(graphics, new Rectangle(1, 2, 3, 4), new Rectangle(1, 2, 3, 4), -1, DataGridViewElementStates.None, new DataGridViewCellStyle(), true)); 4231Assert.Throws<ArgumentNullException>("graphics", () => row.DrawFocus(null, new Rectangle(1, 2, 3, 4), new Rectangle(1, 2, 3, 4), -1, DataGridViewElementStates.None, new DataGridViewCellStyle(), true));
System\Windows\Forms\DataGridViewTests.cs (21)
794yield return new object[] { new DataGridViewCellStyle() }; 795yield return new object[] { new DataGridViewCellStyle { BackColor = Color.Empty } }; 796yield return new object[] { new DataGridViewCellStyle { ForeColor = Color.Empty } }; 797yield return new object[] { new DataGridViewCellStyle { SelectionBackColor = Color.Empty } }; 798yield return new object[] { new DataGridViewCellStyle { SelectionForeColor = Color.Empty } }; 799yield return new object[] { new DataGridViewCellStyle { Font = null } }; 800yield return new object[] { new DataGridViewCellStyle { Alignment = DataGridViewContentAlignment.NotSet } }; 801yield return new object[] { new DataGridViewCellStyle { WrapMode = DataGridViewTriState.NotSet } }; 2332DataGridViewCellStyle defaultCellStyle = new() 2350ColumnHeadersDefaultCellStyle = new DataGridViewCellStyle { Font = customFont2 }, 2351RowHeadersDefaultCellStyle = new DataGridViewCellStyle { Font = customFont3 } 3049_dataGridView.AlternatingRowsDefaultCellStyle = new() { BackColor = Color.AliceBlue }; 3053_dataGridView.AlternatingRowsDefaultCellStyle = new(); 3169_dataGridView.ColumnHeadersDefaultCellStyle = new() { BackColor = Color.Red }; 3173_dataGridView.ColumnHeadersDefaultCellStyle = new(); 3229_dataGridView.DefaultCellStyle = new() { BackColor = Color.Red }; 3233_dataGridView.DefaultCellStyle = new(); 3349_dataGridView.RowHeadersDefaultCellStyle = new(); 3353_dataGridView.RowHeadersDefaultCellStyle = new(); 3369_dataGridView.RowsDefaultCellStyle = new() { BackColor = Color.Red }; 3373_dataGridView.RowsDefaultCellStyle = new();
System\Windows\Forms\DataGridViewTests.Rendering.cs (3)
117DataGridViewCellStyle defaultCellStyle = new() 135ColumnHeadersDefaultCellStyle = new DataGridViewCellStyle { Font = customColumnHeaderFont }, 136RowHeadersDefaultCellStyle = new DataGridViewCellStyle { Font = customRowHeaderFont },
System\Windows\Forms\DataGridViewTextBoxEditingControlTests.cs (42)
548yield return new object[] { new DataGridViewCellStyle(), null, Color.FromArgb(0xFF, 0x00, 0x00, 0x00), SystemColors.WindowText, false, HorizontalAlignment.Left, false }; 551DataGridViewCellStyle customStyle = new() 559DataGridViewCellStyle transparentStyle = new() 569new DataGridViewCellStyle 578new DataGridViewCellStyle 587new DataGridViewCellStyle 596new DataGridViewCellStyle 605new DataGridViewCellStyle 614new DataGridViewCellStyle 624new DataGridViewCellStyle 633new DataGridViewCellStyle 642new DataGridViewCellStyle 651new DataGridViewCellStyle 660new DataGridViewCellStyle 669new DataGridViewCellStyle 679new DataGridViewCellStyle 688new DataGridViewCellStyle 697new DataGridViewCellStyle 706new DataGridViewCellStyle 715new DataGridViewCellStyle 724new DataGridViewCellStyle 757yield return new object[] { new DataGridViewCellStyle(), null, Color.FromArgb(0xFF, 0x00, 0x00, 0x00), Color.FromArgb(0xFF, 0x00, 0x00, 0x00), SystemColors.WindowText, false, HorizontalAlignment.Left, false }; 760DataGridViewCellStyle customStyle = new() 768DataGridViewCellStyle transparentStyle = new() 778new DataGridViewCellStyle 787new DataGridViewCellStyle 796new DataGridViewCellStyle 805new DataGridViewCellStyle 814new DataGridViewCellStyle 823new DataGridViewCellStyle 833new DataGridViewCellStyle 842new DataGridViewCellStyle 851new DataGridViewCellStyle 860new DataGridViewCellStyle 869new DataGridViewCellStyle 878new DataGridViewCellStyle 888new DataGridViewCellStyle 897new DataGridViewCellStyle 906new DataGridViewCellStyle 915new DataGridViewCellStyle 924new DataGridViewCellStyle 933new DataGridViewCellStyle
WinFormsControlsTest (2)
DataGridViewTest.Designer.cs (2)
34System.Windows.Forms.DataGridViewCellStyle dataGridViewCellStyle1 = new(); 35System.Windows.Forms.DataGridViewCellStyle dataGridViewCellStyle3 = new();