本文整理汇总了C#中MonoTests.System.Web.UI.WebControls.ListViewPoker.DoAddControlToContainer方法的典型用法代码示例。如果您正苦于以下问题:C# ListViewPoker.DoAddControlToContainer方法的具体用法?C# ListViewPoker.DoAddControlToContainer怎么用?C# ListViewPoker.DoAddControlToContainer使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类MonoTests.System.Web.UI.WebControls.ListViewPoker
的用法示例。
在下文中一共展示了ListViewPoker.DoAddControlToContainer方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: ListView_AddControlToContainer
public void ListView_AddControlToContainer ()
{
var lvp = new ListViewPoker ();
Control container = new Control ();
Control control = new Control ();
control.ID = "TestControl";
lvp.DoAddControlToContainer (control, container, 0);
Assert.AreEqual (typeof (Control), container.Controls [0].GetType (), "#A1");
Assert.AreEqual ("TestControl", container.Controls [0].ID, "#A2");
container = new HtmlTable ();
lvp.DoAddControlToContainer (control, container, 0);
Assert.AreEqual ("System.Web.UI.WebControls.ListViewTableRow", container.Controls [0].GetType ().ToString (), "#B1");
Assert.AreEqual ("TestControl", container.Controls [0].Controls [0].ID, "#B2");
container = new HtmlTableRow ();
lvp.DoAddControlToContainer (control, container, 0);
Assert.AreEqual ("System.Web.UI.WebControls.ListViewTableCell", container.Controls [0].GetType ().ToString (), "#C1");
Assert.AreEqual ("TestControl", container.Controls [0].Controls [0].ID, "#C2");
container = new Control ();
lvp.DoAddControlToContainer (control, container, -1);
}
示例2: ListView_AddControlToContainer_NullContainer
public void ListView_AddControlToContainer_NullContainer ()
{
var lvp = new ListViewPoker ();
Control container = new Control ();
Control control = new Control ();
control.ID = "TestControl";
lvp.DoAddControlToContainer (control, null, 0);
Assert.AreEqual (0, container.Controls.Count, "#A2");
}