當前位置: 首頁>>代碼示例>>C#>>正文


C# TestDataList.CreateCH方法代碼示例

本文整理匯總了C#中MonoTests.System.Web.UI.WebControls.TestDataList.CreateCH方法的典型用法代碼示例。如果您正苦於以下問題:C# TestDataList.CreateCH方法的具體用法?C# TestDataList.CreateCH怎麽用?C# TestDataList.CreateCH使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在MonoTests.System.Web.UI.WebControls.TestDataList的用法示例。


在下文中一共展示了TestDataList.CreateCH方法的9個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的C#代碼示例。

示例1: RepeatInfo3

		public void RepeatInfo3 ()
		{
			TestDataList dl = new TestDataList ();
			dl.ShowHeader = true;
			dl.HeaderTemplate = new Templ ();
			dl.ShowFooter = true;
			dl.FooterTemplate = new Templ ();
			dl.SeparatorTemplate = new Templ ();
			dl.DataSource = GetData (6);
			dl.CreateCH ();
			IRepeatInfoUser repeater = (IRepeatInfoUser) dl;
			Style style = repeater.GetItemStyle (ListItemType.Header, -1);
			DataListItem header = (DataListItem) dl.Controls [0];
			Assert.IsNull (style, "#01");

			style = repeater.GetItemStyle (ListItemType.Footer, -1);
			DataListItem footer = (DataListItem) dl.Controls [13];
			Assert.IsNull (style, "#02");
			for (int i = 0; i < 6; i++) {
				style = repeater.GetItemStyle (ListItemType.Item, i);
				Assert.IsNull (style, String.Format ("#02-{0}", i));
			}
		}
開發者ID:whereisaaron,項目名稱:mono,代碼行數:23,代碼來源:DataListTest.cs

示例2: RepeatInfo4

		public void RepeatInfo4 ()
		{
			TestDataList dl = new TestDataList ();
			dl.DataSource = GetData (6);
			dl.ItemStyle.ForeColor = Color.Blue;
			dl.CreateCH ();
			dl.PrepareCH (); // removing this causes all the GetItemStyle calls to return null
			IRepeatInfoUser repeater = (IRepeatInfoUser) dl;
			for (int i = 0; i < 6; i++) {
				Style style = repeater.GetItemStyle (ListItemType.Item, i);
				DataListItem item = (DataListItem) dl.Controls [i];
				Assert.AreEqual (style, item.ControlStyle, String.Format ("#01-{0}", i));
			}
		}
開發者ID:whereisaaron,項目名稱:mono,代碼行數:14,代碼來源:DataListTest.cs

示例3: RepeatInfo1

		public void RepeatInfo1 ()
		{
			TestDataList dl = new TestDataList ();
			dl.ShowHeader = true;
			dl.HeaderTemplate = new Templ ();
			dl.ShowFooter = true;
			dl.FooterTemplate = new Templ ();
			dl.SeparatorTemplate = new Templ ();
			dl.DataSource = GetData (6);
			dl.CreateCH ();
			IRepeatInfoUser repeater = (IRepeatInfoUser) dl;
			Assert.AreEqual (true, repeater.HasHeader, "#01");
			Assert.AreEqual (true, repeater.HasFooter, "#02");
			Assert.AreEqual (true, repeater.HasSeparators, "#03");
			Assert.AreEqual (6, repeater.RepeatedItemCount, "#04");
		}
開發者ID:whereisaaron,項目名稱:mono,代碼行數:16,代碼來源:DataListTest.cs

示例4: RepeatInfo2

		public void RepeatInfo2 ()
		{
			TestDataList dl = new TestDataList ();
			dl.ShowHeader = true;
			dl.HeaderTemplate = new Templ ();
			dl.ShowFooter = true;
			dl.FooterTemplate = new Templ ();
			dl.SeparatorTemplate = new Templ ();
			dl.DataSource = GetData (6);
			dl.CreateCH ();
			IRepeatInfoUser repeater = (IRepeatInfoUser) dl;
			Style style = repeater.GetItemStyle (ListItemType.Pager, -1);
			Assert.IsNull (style, "#01");
			style = repeater.GetItemStyle (ListItemType.Pager, 0);
			Assert.IsNull (style, "#02");
			style = repeater.GetItemStyle (ListItemType.Pager, 15);
			Assert.IsNull (style, "#03");
		}
開發者ID:whereisaaron,項目名稱:mono,代碼行數:18,代碼來源:DataListTest.cs

示例5: NControls6

		public void NControls6 ()
		{
			TestDataList dl = new TestDataList ();
			dl.ShowHeader = true;
			dl.HeaderTemplate = new Templ ();
			dl.ShowFooter = true;
			dl.FooterTemplate = new Templ ();
			dl.SeparatorTemplate = new Templ ();
			dl.DataSource = GetData (6);
			dl.CreateCH ();
			Assert.AreEqual (14, dl.Controls.Count, "#01");

			Assert.AreEqual (ListItemType.Header, ((DataListItem) dl.Controls [0]).ItemType, "#02");
			for (int i = 0; i < 3; i++) {
				int b = (i * 4) + 1;
				DataListItem one = (DataListItem) dl.Controls [b];
				DataListItem two = (DataListItem) dl.Controls [b + 1];
				DataListItem three = (DataListItem) dl.Controls [b + 2];
				DataListItem four = (DataListItem) dl.Controls [b + 3];
				Assert.AreEqual (ListItemType.Item, one.ItemType, String.Format ("#02-{0}", b));
				Assert.AreEqual (ListItemType.Separator, two.ItemType, String.Format ("#02-{0}", b + 1));
				Assert.AreEqual (ListItemType.AlternatingItem, three.ItemType, String.Format ("#02-{0}", b + 2));
				Assert.AreEqual (ListItemType.Separator, four.ItemType, String.Format ("#02-{0}", b + 3));
				
			}
			Assert.AreEqual (ListItemType.Footer, ((DataListItem) dl.Controls [13]).ItemType, "#03");
		}
開發者ID:whereisaaron,項目名稱:mono,代碼行數:27,代碼來源:DataListTest.cs

示例6: DataSourceID

		public void DataSourceID ()
		{
			Page p = new Page();
			ObjectDataSource ds = new ObjectDataSource();
			ds.ID = "ObjectDataSource1";
			ds.TypeName = "System.Guid";
			ds.SelectMethod = "ToByteArray";
			TestDataList dl = new TestDataList ();
			dl.Page = p;
			ds.Page = p;
			p.Controls.Add(dl);
			p.Controls.Add(ds);
			dl.DataSourceID = "ObjectDataSource1";
			dl.CreateCH ();
			Assert.AreEqual (16, dl.Controls.Count, "#01");
		}
開發者ID:whereisaaron,項目名稱:mono,代碼行數:16,代碼來源:DataListTest.cs

示例7: NControls5

		public void NControls5 ()
		{
			TestDataList dl = new TestDataList ();
			dl.ShowHeader = true;
			dl.HeaderTemplate = new Templ ();
			dl.SeparatorTemplate = new Templ ();
			dl.DataSource = GetData (5);
			dl.CreateCH ();
			Assert.AreEqual (11, dl.Controls.Count, "#01");
		}
開發者ID:whereisaaron,項目名稱:mono,代碼行數:10,代碼來源:DataListTest.cs

示例8: NControls2

		public void NControls2 ()
		{
			TestDataList dl = new TestDataList ();
			dl.ShowHeader = true;
			dl.ShowFooter = true;
			dl.DataSource = GetData (5);
			dl.CreateCH ();
			Assert.AreEqual (5, dl.Controls.Count, "#01");
		}
開發者ID:whereisaaron,項目名稱:mono,代碼行數:9,代碼來源:DataListTest.cs

示例9: NControls1

		public void NControls1 ()
		{
			TestDataList dl = new TestDataList ();
			dl.DataSource = GetData (5);
			dl.CreateCH ();
			Assert.AreEqual (5, dl.Controls.Count, "#01");
		}
開發者ID:whereisaaron,項目名稱:mono,代碼行數:7,代碼來源:DataListTest.cs


注:本文中的MonoTests.System.Web.UI.WebControls.TestDataList.CreateCH方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。