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