72 instantiations of TableLayoutPanelCellPosition
System.Windows.Forms (6)
System\Windows\Forms\Layout\TableLayout.cs (3)
1328
return new
TableLayoutPanelCellPosition
(-1, -1);
1337
return new
TableLayoutPanelCellPosition
(-1, -1);
1347
return new
TableLayoutPanelCellPosition
(layoutInfo.ColumnStart, layoutInfo.RowStart);
System\Windows\Forms\Panels\TableLayoutPanel\TableLayoutPanelCellPositionTypeConverter.cs (2)
58
return new
TableLayoutPanelCellPosition
(values[0], values[1]);
82
return new
TableLayoutPanelCellPosition
(
System\Windows\Forms\Panels\TableLayoutPanel\TableLayoutSettings.cs (1)
355
return new
TableLayoutPanelCellPosition
(GetColumn(control), GetRow(control));
System.Windows.Forms.Design (2)
System\Windows\Forms\Design\TableLayoutPanelDesigner.cs (2)
598
Table.SetCellPosition(control, new
TableLayoutPanelCellPosition
(newControlPosition.X, newControlPosition.Y));
1258
Table.SetCellPosition(e.Control, new
TableLayoutPanelCellPosition
(-1, -1));
System.Windows.Forms.Tests (64)
System\Windows\Forms\Layout\TableLayoutSettingsTests.cs (25)
162
Assert.Equal(new
TableLayoutPanelCellPosition
(-1, -1), settings.GetCellPosition(child));
171
Assert.Equal(new
TableLayoutPanelCellPosition
(-1, -1), settings.GetCellPosition(child));
203
Assert.Equal(new
TableLayoutPanelCellPosition
(-1, -1), settings.GetCellPosition("control"));
212
settings.SetCellPosition(child, new
TableLayoutPanelCellPosition
{ Column = -2 });
222
settings.SetCellPosition(child, new
TableLayoutPanelCellPosition
{ Column = -2 });
232
settings.SetCellPosition(child, new
TableLayoutPanelCellPosition
{ Row = -2 });
242
settings.SetCellPosition(child, new
TableLayoutPanelCellPosition
{ Row = -2 });
449
yield return new object[] { new
TableLayoutPanelCellPosition
(-1, -1) };
450
yield return new object[] { new
TableLayoutPanelCellPosition
(0, -1) };
451
yield return new object[] { new
TableLayoutPanelCellPosition
(-1, 0) };
452
yield return new object[] { new
TableLayoutPanelCellPosition
(0, 0) };
453
yield return new object[] { new
TableLayoutPanelCellPosition
(1, 2) };
486
yield return new object[] { new
TableLayoutPanelCellPosition
(-1, -1), 1 };
487
yield return new object[] { new
TableLayoutPanelCellPosition
(0, -1), 1 };
488
yield return new object[] { new
TableLayoutPanelCellPosition
(-1, 0), 1 };
489
yield return new object[] { new
TableLayoutPanelCellPosition
(0, 0), 1 };
490
yield return new object[] { new
TableLayoutPanelCellPosition
(1, 2), 1 };
622
settings.SetCellPosition(child, new
TableLayoutPanelCellPosition
(1, 1));
623
Assert.Equal(new
TableLayoutPanelCellPosition
(1, 1), settings.GetCellPosition(child));
625
settings.SetCellPosition(child, new
TableLayoutPanelCellPosition
(2, 2));
626
Assert.Equal(new
TableLayoutPanelCellPosition
(2, 2), settings.GetCellPosition(child));
636
settings.SetCellPosition(child, new
TableLayoutPanelCellPosition
(1, 1));
637
Assert.Equal(new
TableLayoutPanelCellPosition
(1, 1), settings.GetCellPosition(child));
639
settings.SetCellPosition(child, new
TableLayoutPanelCellPosition
(2, 2));
640
Assert.Equal(new
TableLayoutPanelCellPosition
(2, 2), settings.GetCellPosition(child));
System\Windows\Forms\TableLayoutPanelCellPositionTests.cs (18)
27
TableLayoutPanelCellPosition style =
new
(column, row);
35
Assert.Throws<ArgumentOutOfRangeException>("column", () => new
TableLayoutPanelCellPosition
(-2, 0));
41
Assert.Throws<ArgumentOutOfRangeException>("row", () => new
TableLayoutPanelCellPosition
(0, -2));
48
TableLayoutPanelCellPosition style =
new
()
59
TableLayoutPanelCellPosition style =
new
()
68
yield return new object[] { new
TableLayoutPanelCellPosition
(1, 2), new
TableLayoutPanelCellPosition
(1, 2), true };
69
yield return new object[] { new
TableLayoutPanelCellPosition
(1, 2), new
TableLayoutPanelCellPosition
(2, 2), false };
70
yield return new object[] { new
TableLayoutPanelCellPosition
(1, 2), new
TableLayoutPanelCellPosition
(1, 3), false };
72
yield return new object[] { new
TableLayoutPanelCellPosition
(1, 2), new(), false };
73
yield return new object[] { new
TableLayoutPanelCellPosition
(1, 2), null, false };
93
TableLayoutPanelCellPosition position =
new
(1, 2);
112
yield return new object[] { "1,2", new
TableLayoutPanelCellPosition
(1, 2) };
113
yield return new object[] { " 1 , 2 ", new
TableLayoutPanelCellPosition
(1, 2) };
175
InstanceDescriptor descriptor = Assert.IsType<InstanceDescriptor>(converter.ConvertTo(new
TableLayoutPanelCellPosition
(1, 2), typeof(InstanceDescriptor)));
213
Assert.Equal(new
TableLayoutPanelCellPosition
(1, 2), position);
System\Windows\Forms\TableLayoutPanelTests.cs (21)
648
Assert.Equal(new
TableLayoutPanelCellPosition
(-1, -1), control.GetCellPosition(child));
663
control.SetCellPosition(child, new
TableLayoutPanelCellPosition
{ Column = -2 });
672
control.SetCellPosition(child, new
TableLayoutPanelCellPosition
{ Row = -2 });
896
Assert.Equal(new
TableLayoutPanelCellPosition
(1, 2), control.GetPositionFromControl(child));
908
Assert.Equal(new
TableLayoutPanelCellPosition
(1, 2), control.GetPositionFromControl(child));
919
Assert.Equal(new
TableLayoutPanelCellPosition
(-1, -1), control.GetPositionFromControl(child));
926
Assert.Equal(new
TableLayoutPanelCellPosition
(-1, -1), control.GetPositionFromControl(null));
1544
yield return new object[] { new
TableLayoutPanelCellPosition
(-1, -1) };
1545
yield return new object[] { new
TableLayoutPanelCellPosition
(0, -1) };
1546
yield return new object[] { new
TableLayoutPanelCellPosition
(-1, 0) };
1547
yield return new object[] { new
TableLayoutPanelCellPosition
(0, 0) };
1548
yield return new object[] { new
TableLayoutPanelCellPosition
(1, 2) };
1580
yield return new object[] { new
TableLayoutPanelCellPosition
(-1, -1), 1 };
1581
yield return new object[] { new
TableLayoutPanelCellPosition
(0, -1), 1 };
1582
yield return new object[] { new
TableLayoutPanelCellPosition
(-1, 0), 1 };
1583
yield return new object[] { new
TableLayoutPanelCellPosition
(0, 0), 1 };
1584
yield return new object[] { new
TableLayoutPanelCellPosition
(1, 2), 1 };
1644
control.SetCellPosition(child, new
TableLayoutPanelCellPosition
(1, 1));
1645
Assert.Equal(new
TableLayoutPanelCellPosition
(1, 1), control.GetCellPosition(child));
1647
control.SetCellPosition(child, new
TableLayoutPanelCellPosition
(2, 2));
1648
Assert.Equal(new
TableLayoutPanelCellPosition
(2, 2), control.GetCellPosition(child));
81 references to TableLayoutPanelCellPosition
System.Windows.Forms (22)
System\Windows\Forms\Layout\TableLayout.cs (1)
1324
internal static
TableLayoutPanelCellPosition
GetPositionFromControl(IArrangedElement? container, IArrangedElement? child)
System\Windows\Forms\Panels\TableLayoutPanel\TableLayoutPanel.cs (4)
222
[DefaultValue(typeof(
TableLayoutPanelCellPosition
), "-1,-1")] // if change this value, also change the SerializeViaAdd in TableLayoutControlCollectionCodeDomSerializer
227
public
TableLayoutPanelCellPosition
GetCellPosition(Control control) =>
231
public void SetCellPosition(Control control,
TableLayoutPanelCellPosition
position) =>
255
public
TableLayoutPanelCellPosition
GetPositionFromControl(Control? control) =>
System\Windows\Forms\Panels\TableLayoutPanel\TableLayoutPanelCellPosition.cs (7)
9
public struct TableLayoutPanelCellPosition : IEquatable<
TableLayoutPanelCellPosition
>
26
if (other is not
TableLayoutPanelCellPosition
otherCellPosition)
34
public readonly bool Equals(
TableLayoutPanelCellPosition
other)
37
public static bool operator ==(
TableLayoutPanelCellPosition
p1,
TableLayoutPanelCellPosition
p2)
42
public static bool operator !=(
TableLayoutPanelCellPosition
p1,
TableLayoutPanelCellPosition
p2)
System\Windows\Forms\Panels\TableLayoutPanel\TableLayoutPanelCellPositionTypeConverter.cs (7)
66
if (destinationType == typeof(InstanceDescriptor) && value is
TableLayoutPanelCellPosition
cellPosition)
69
typeof(
TableLayoutPanelCellPosition
).GetConstructor([typeof(int), typeof(int)]),
83
(int)propertyValues[nameof(
TableLayoutPanelCellPosition
.Column)]!,
84
(int)propertyValues[nameof(
TableLayoutPanelCellPosition
.Row)]!);
102
PropertyDescriptorCollection props = TypeDescriptor.GetProperties(typeof(
TableLayoutPanelCellPosition
), attributes);
103
return props.Sort([nameof(
TableLayoutPanelCellPosition
.Column), nameof(
TableLayoutPanelCellPosition
.Row)]);
System\Windows\Forms\Panels\TableLayoutPanel\TableLayoutSettings.cs (3)
351
public
TableLayoutPanelCellPosition
GetCellPosition(object control)
364
public void SetCellPosition(object control,
TableLayoutPanelCellPosition
cellPosition)
460
internal
TableLayoutPanelCellPosition
GetPositionFromControl(IArrangedElement? element)
System.Windows.Forms.Design (1)
System\Windows\Forms\Design\TableLayoutPanelDesigner.cs (1)
1050
TableLayoutPanelCellPosition
pos = Table.GetPositionFromControl(control);
System.Windows.Forms.Tests (58)
System\Windows\Forms\Layout\TableLayoutSettingsTests.cs (4)
458
public void TableLayoutPanel_SetCellPosition_Invoke_GetReturnsExpected(
TableLayoutPanelCellPosition
value)
495
public void TableLayoutPanel_SetCellPosition_InvokeControlWithParent_GetReturnsExpected(
TableLayoutPanelCellPosition
value, int expectedParentLayoutCallCount)
548
public void TableLayoutPanel_SetCellPosition_InvokeStub_GetReturnsExpected(
TableLayoutPanelCellPosition
value)
570
public void TableLayoutPanel_SetCellPosition_InvokeStubWithParent_GetReturnsExpected(
TableLayoutPanelCellPosition
value)
System\Windows\Forms\PaddingConverterTests.cs (1)
65
[InlineData(typeof(
TableLayoutPanelCellPosition
), false)]
System\Windows\Forms\TableLayoutPanelCellPositionTests.cs (50)
16
TableLayoutPanelCellPosition
style = default;
27
TableLayoutPanelCellPosition
style = new(column, row);
48
TableLayoutPanelCellPosition
style = new()
59
TableLayoutPanelCellPosition
style = new()
78
public void TableLayoutPanelCellPosition_Equals_Invoke_ReturnsExpected(
TableLayoutPanelCellPosition
position, object other, bool expected)
80
if (other is
TableLayoutPanelCellPosition
otherPosition)
93
TableLayoutPanelCellPosition
position = new(1, 2);
106
TypeConverter converter = TypeDescriptor.GetConverter(typeof(
TableLayoutPanelCellPosition
));
122
TypeConverter converter = TypeDescriptor.GetConverter(typeof(
TableLayoutPanelCellPosition
));
132
TypeConverter converter = TypeDescriptor.GetConverter(typeof(
TableLayoutPanelCellPosition
));
141
TypeConverter converter = TypeDescriptor.GetConverter(typeof(
TableLayoutPanelCellPosition
));
148
TypeConverter converter = TypeDescriptor.GetConverter(typeof(
TableLayoutPanelCellPosition
));
155
TypeConverter converter = TypeDescriptor.GetConverter(typeof(
TableLayoutPanelCellPosition
));
162
[InlineData(typeof(
TableLayoutPanelCellPosition
), false)]
167
TypeConverter converter = TypeDescriptor.GetConverter(typeof(
TableLayoutPanelCellPosition
));
174
TypeConverter converter = TypeDescriptor.GetConverter(typeof(
TableLayoutPanelCellPosition
));
176
Assert.Equal(typeof(
TableLayoutPanelCellPosition
).GetConstructor([typeof(int), typeof(int)]), descriptor.MemberInfo);
184
TypeConverter converter = TypeDescriptor.GetConverter(typeof(
TableLayoutPanelCellPosition
));
191
TypeConverter converter = TypeDescriptor.GetConverter(typeof(
TableLayoutPanelCellPosition
));
196
[InlineData(typeof(
TableLayoutPanelCellPosition
))]
200
TypeConverter converter = TypeDescriptor.GetConverter(typeof(
TableLayoutPanelCellPosition
));
201
Assert.Throws<NotSupportedException>(() => converter.ConvertTo(default(
TableLayoutPanelCellPosition
), destinationType));
207
TypeConverter converter = TypeDescriptor.GetConverter(typeof(
TableLayoutPanelCellPosition
));
208
TableLayoutPanelCellPosition
position = Assert.IsType<
TableLayoutPanelCellPosition
>(converter.CreateInstance(null, new Dictionary<string, object>
210
{ nameof(
TableLayoutPanelCellPosition
.Column), 1 },
211
{ nameof(
TableLayoutPanelCellPosition
.Row), 2 }
219
TypeConverter converter = TypeDescriptor.GetConverter(typeof(
TableLayoutPanelCellPosition
));
229
{ nameof(
TableLayoutPanelCellPosition
.Row), new object() },
230
{ nameof(
TableLayoutPanelCellPosition
.Column), 2 },
237
{ nameof(
TableLayoutPanelCellPosition
.Row), null },
238
{ nameof(
TableLayoutPanelCellPosition
.Column), 2 },
245
{ nameof(
TableLayoutPanelCellPosition
.Column), 2 }
253
{ nameof(
TableLayoutPanelCellPosition
.Row), 1 },
254
{ nameof(
TableLayoutPanelCellPosition
.Column), new object() }
261
{ nameof(
TableLayoutPanelCellPosition
.Row), 1 },
262
{ nameof(
TableLayoutPanelCellPosition
.Column), null }
269
{ nameof(
TableLayoutPanelCellPosition
.Row), 1 }
278
TypeConverter converter = TypeDescriptor.GetConverter(typeof(
TableLayoutPanelCellPosition
));
285
TypeConverter converter = TypeDescriptor.GetConverter(typeof(
TableLayoutPanelCellPosition
));
288
{ nameof(
TableLayoutPanelCellPosition
.Column), -2 },
289
{ nameof(
TableLayoutPanelCellPosition
.Row), 2 }
296
TypeConverter converter = TypeDescriptor.GetConverter(typeof(
TableLayoutPanelCellPosition
));
299
{ nameof(
TableLayoutPanelCellPosition
.Column), 1 },
300
{ nameof(
TableLayoutPanelCellPosition
.Row), -2 }
307
TypeConverter converter = TypeDescriptor.GetConverter(typeof(
TableLayoutPanelCellPosition
));
314
TypeConverter converter = TypeDescriptor.GetConverter(typeof(
TableLayoutPanelCellPosition
));
317
Assert.Equal(nameof(
TableLayoutPanelCellPosition
.Column), properties[0].Name);
318
Assert.Equal(nameof(
TableLayoutPanelCellPosition
.Row), properties[1].Name);
324
TypeConverter converter = TypeDescriptor.GetConverter(typeof(
TableLayoutPanelCellPosition
));
System\Windows\Forms\TableLayoutPanelTests.cs (2)
1553
public void TableLayoutPanel_SetCellPosition_Invoke_GetReturnsExpected(
TableLayoutPanelCellPosition
value)
1589
public void TableLayoutPanel_SetCellPosition_InvokeControlWithParent_GetReturnsExpected(
TableLayoutPanelCellPosition
value, int expectedParentLayoutCallCount)
System\Windows\Forms\TableLayoutStyleTests.cs (1)
167
[InlineData(typeof(
TableLayoutPanelCellPosition
))]