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)
164
Assert.Equal(new
TableLayoutPanelCellPosition
(-1, -1), settings.GetCellPosition(child));
173
Assert.Equal(new
TableLayoutPanelCellPosition
(-1, -1), settings.GetCellPosition(child));
205
Assert.Equal(new
TableLayoutPanelCellPosition
(-1, -1), settings.GetCellPosition("control"));
214
settings.SetCellPosition(child, new
TableLayoutPanelCellPosition
{ Column = -2 });
224
settings.SetCellPosition(child, new
TableLayoutPanelCellPosition
{ Column = -2 });
234
settings.SetCellPosition(child, new
TableLayoutPanelCellPosition
{ Row = -2 });
244
settings.SetCellPosition(child, new
TableLayoutPanelCellPosition
{ Row = -2 });
451
yield return new object[] { new
TableLayoutPanelCellPosition
(-1, -1) };
452
yield return new object[] { new
TableLayoutPanelCellPosition
(0, -1) };
453
yield return new object[] { new
TableLayoutPanelCellPosition
(-1, 0) };
454
yield return new object[] { new
TableLayoutPanelCellPosition
(0, 0) };
455
yield return new object[] { new
TableLayoutPanelCellPosition
(1, 2) };
488
yield return new object[] { new
TableLayoutPanelCellPosition
(-1, -1), 1 };
489
yield return new object[] { new
TableLayoutPanelCellPosition
(0, -1), 1 };
490
yield return new object[] { new
TableLayoutPanelCellPosition
(-1, 0), 1 };
491
yield return new object[] { new
TableLayoutPanelCellPosition
(0, 0), 1 };
492
yield return new object[] { new
TableLayoutPanelCellPosition
(1, 2), 1 };
624
settings.SetCellPosition(child, new
TableLayoutPanelCellPosition
(1, 1));
625
Assert.Equal(new
TableLayoutPanelCellPosition
(1, 1), settings.GetCellPosition(child));
627
settings.SetCellPosition(child, new
TableLayoutPanelCellPosition
(2, 2));
628
Assert.Equal(new
TableLayoutPanelCellPosition
(2, 2), settings.GetCellPosition(child));
638
settings.SetCellPosition(child, new
TableLayoutPanelCellPosition
(1, 1));
639
Assert.Equal(new
TableLayoutPanelCellPosition
(1, 1), settings.GetCellPosition(child));
641
settings.SetCellPosition(child, new
TableLayoutPanelCellPosition
(2, 2));
642
Assert.Equal(new
TableLayoutPanelCellPosition
(2, 2), settings.GetCellPosition(child));
System\Windows\Forms\TableLayoutPanelCellPositionTests.cs (18)
29
TableLayoutPanelCellPosition style =
new
(column, row);
37
Assert.Throws<ArgumentOutOfRangeException>("column", () => new
TableLayoutPanelCellPosition
(-2, 0));
43
Assert.Throws<ArgumentOutOfRangeException>("row", () => new
TableLayoutPanelCellPosition
(0, -2));
50
TableLayoutPanelCellPosition style =
new
()
61
TableLayoutPanelCellPosition style =
new
()
70
yield return new object[] { new
TableLayoutPanelCellPosition
(1, 2), new
TableLayoutPanelCellPosition
(1, 2), true };
71
yield return new object[] { new
TableLayoutPanelCellPosition
(1, 2), new
TableLayoutPanelCellPosition
(2, 2), false };
72
yield return new object[] { new
TableLayoutPanelCellPosition
(1, 2), new
TableLayoutPanelCellPosition
(1, 3), false };
74
yield return new object[] { new
TableLayoutPanelCellPosition
(1, 2), new(), false };
75
yield return new object[] { new
TableLayoutPanelCellPosition
(1, 2), null, false };
95
TableLayoutPanelCellPosition position =
new
(1, 2);
114
yield return new object[] { "1,2", new
TableLayoutPanelCellPosition
(1, 2) };
115
yield return new object[] { " 1 , 2 ", new
TableLayoutPanelCellPosition
(1, 2) };
177
InstanceDescriptor descriptor = Assert.IsType<InstanceDescriptor>(converter.ConvertTo(new
TableLayoutPanelCellPosition
(1, 2), typeof(InstanceDescriptor)));
215
Assert.Equal(new
TableLayoutPanelCellPosition
(1, 2), position);
System\Windows\Forms\TableLayoutPanelTests.cs (21)
650
Assert.Equal(new
TableLayoutPanelCellPosition
(-1, -1), control.GetCellPosition(child));
665
control.SetCellPosition(child, new
TableLayoutPanelCellPosition
{ Column = -2 });
674
control.SetCellPosition(child, new
TableLayoutPanelCellPosition
{ Row = -2 });
898
Assert.Equal(new
TableLayoutPanelCellPosition
(1, 2), control.GetPositionFromControl(child));
910
Assert.Equal(new
TableLayoutPanelCellPosition
(1, 2), control.GetPositionFromControl(child));
921
Assert.Equal(new
TableLayoutPanelCellPosition
(-1, -1), control.GetPositionFromControl(child));
928
Assert.Equal(new
TableLayoutPanelCellPosition
(-1, -1), control.GetPositionFromControl(null));
1546
yield return new object[] { new
TableLayoutPanelCellPosition
(-1, -1) };
1547
yield return new object[] { new
TableLayoutPanelCellPosition
(0, -1) };
1548
yield return new object[] { new
TableLayoutPanelCellPosition
(-1, 0) };
1549
yield return new object[] { new
TableLayoutPanelCellPosition
(0, 0) };
1550
yield return new object[] { new
TableLayoutPanelCellPosition
(1, 2) };
1582
yield return new object[] { new
TableLayoutPanelCellPosition
(-1, -1), 1 };
1583
yield return new object[] { new
TableLayoutPanelCellPosition
(0, -1), 1 };
1584
yield return new object[] { new
TableLayoutPanelCellPosition
(-1, 0), 1 };
1585
yield return new object[] { new
TableLayoutPanelCellPosition
(0, 0), 1 };
1586
yield return new object[] { new
TableLayoutPanelCellPosition
(1, 2), 1 };
1646
control.SetCellPosition(child, new
TableLayoutPanelCellPosition
(1, 1));
1647
Assert.Equal(new
TableLayoutPanelCellPosition
(1, 1), control.GetCellPosition(child));
1649
control.SetCellPosition(child, new
TableLayoutPanelCellPosition
(2, 2));
1650
Assert.Equal(new
TableLayoutPanelCellPosition
(2, 2), control.GetCellPosition(child));
82 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.Design.Tests (1)
System\Windows\Forms\Design\TableLayoutPanelDesignerTests.cs (1)
289
TableLayoutPanelCellPosition
position = _tableLayoutPanel.GetPositionFromControl(button);
System.Windows.Forms.Tests (58)
System\Windows\Forms\Layout\TableLayoutSettingsTests.cs (4)
460
public void TableLayoutPanel_SetCellPosition_Invoke_GetReturnsExpected(
TableLayoutPanelCellPosition
value)
497
public void TableLayoutPanel_SetCellPosition_InvokeControlWithParent_GetReturnsExpected(
TableLayoutPanelCellPosition
value, int expectedParentLayoutCallCount)
550
public void TableLayoutPanel_SetCellPosition_InvokeStub_GetReturnsExpected(
TableLayoutPanelCellPosition
value)
572
public void TableLayoutPanel_SetCellPosition_InvokeStubWithParent_GetReturnsExpected(
TableLayoutPanelCellPosition
value)
System\Windows\Forms\PaddingConverterTests.cs (1)
67
[InlineData(typeof(
TableLayoutPanelCellPosition
), false)]
System\Windows\Forms\TableLayoutPanelCellPositionTests.cs (50)
18
TableLayoutPanelCellPosition
style = default;
29
TableLayoutPanelCellPosition
style = new(column, row);
50
TableLayoutPanelCellPosition
style = new()
61
TableLayoutPanelCellPosition
style = new()
80
public void TableLayoutPanelCellPosition_Equals_Invoke_ReturnsExpected(
TableLayoutPanelCellPosition
position, object other, bool expected)
82
if (other is
TableLayoutPanelCellPosition
otherPosition)
95
TableLayoutPanelCellPosition
position = new(1, 2);
108
TypeConverter converter = TypeDescriptor.GetConverter(typeof(
TableLayoutPanelCellPosition
));
124
TypeConverter converter = TypeDescriptor.GetConverter(typeof(
TableLayoutPanelCellPosition
));
134
TypeConverter converter = TypeDescriptor.GetConverter(typeof(
TableLayoutPanelCellPosition
));
143
TypeConverter converter = TypeDescriptor.GetConverter(typeof(
TableLayoutPanelCellPosition
));
150
TypeConverter converter = TypeDescriptor.GetConverter(typeof(
TableLayoutPanelCellPosition
));
157
TypeConverter converter = TypeDescriptor.GetConverter(typeof(
TableLayoutPanelCellPosition
));
164
[InlineData(typeof(
TableLayoutPanelCellPosition
), false)]
169
TypeConverter converter = TypeDescriptor.GetConverter(typeof(
TableLayoutPanelCellPosition
));
176
TypeConverter converter = TypeDescriptor.GetConverter(typeof(
TableLayoutPanelCellPosition
));
178
Assert.Equal(typeof(
TableLayoutPanelCellPosition
).GetConstructor([typeof(int), typeof(int)]), descriptor.MemberInfo);
186
TypeConverter converter = TypeDescriptor.GetConverter(typeof(
TableLayoutPanelCellPosition
));
193
TypeConverter converter = TypeDescriptor.GetConverter(typeof(
TableLayoutPanelCellPosition
));
198
[InlineData(typeof(
TableLayoutPanelCellPosition
))]
202
TypeConverter converter = TypeDescriptor.GetConverter(typeof(
TableLayoutPanelCellPosition
));
203
Assert.Throws<NotSupportedException>(() => converter.ConvertTo(default(
TableLayoutPanelCellPosition
), destinationType));
209
TypeConverter converter = TypeDescriptor.GetConverter(typeof(
TableLayoutPanelCellPosition
));
210
TableLayoutPanelCellPosition
position = Assert.IsType<
TableLayoutPanelCellPosition
>(converter.CreateInstance(null, new Dictionary<string, object>
212
{ nameof(
TableLayoutPanelCellPosition
.Column), 1 },
213
{ nameof(
TableLayoutPanelCellPosition
.Row), 2 }
221
TypeConverter converter = TypeDescriptor.GetConverter(typeof(
TableLayoutPanelCellPosition
));
231
{ nameof(
TableLayoutPanelCellPosition
.Row), new object() },
232
{ nameof(
TableLayoutPanelCellPosition
.Column), 2 },
239
{ nameof(
TableLayoutPanelCellPosition
.Row), null },
240
{ nameof(
TableLayoutPanelCellPosition
.Column), 2 },
247
{ nameof(
TableLayoutPanelCellPosition
.Column), 2 }
255
{ nameof(
TableLayoutPanelCellPosition
.Row), 1 },
256
{ nameof(
TableLayoutPanelCellPosition
.Column), new object() }
263
{ nameof(
TableLayoutPanelCellPosition
.Row), 1 },
264
{ nameof(
TableLayoutPanelCellPosition
.Column), null }
271
{ nameof(
TableLayoutPanelCellPosition
.Row), 1 }
280
TypeConverter converter = TypeDescriptor.GetConverter(typeof(
TableLayoutPanelCellPosition
));
287
TypeConverter converter = TypeDescriptor.GetConverter(typeof(
TableLayoutPanelCellPosition
));
290
{ nameof(
TableLayoutPanelCellPosition
.Column), -2 },
291
{ nameof(
TableLayoutPanelCellPosition
.Row), 2 }
298
TypeConverter converter = TypeDescriptor.GetConverter(typeof(
TableLayoutPanelCellPosition
));
301
{ nameof(
TableLayoutPanelCellPosition
.Column), 1 },
302
{ nameof(
TableLayoutPanelCellPosition
.Row), -2 }
309
TypeConverter converter = TypeDescriptor.GetConverter(typeof(
TableLayoutPanelCellPosition
));
316
TypeConverter converter = TypeDescriptor.GetConverter(typeof(
TableLayoutPanelCellPosition
));
319
Assert.Equal(nameof(
TableLayoutPanelCellPosition
.Column), properties[0].Name);
320
Assert.Equal(nameof(
TableLayoutPanelCellPosition
.Row), properties[1].Name);
326
TypeConverter converter = TypeDescriptor.GetConverter(typeof(
TableLayoutPanelCellPosition
));
System\Windows\Forms\TableLayoutPanelTests.cs (2)
1555
public void TableLayoutPanel_SetCellPosition_Invoke_GetReturnsExpected(
TableLayoutPanelCellPosition
value)
1591
public void TableLayoutPanel_SetCellPosition_InvokeControlWithParent_GetReturnsExpected(
TableLayoutPanelCellPosition
value, int expectedParentLayoutCallCount)
System\Windows\Forms\TableLayoutStyleTests.cs (1)
169
[InlineData(typeof(
TableLayoutPanelCellPosition
))]