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