示例#1
0
		public void Copy () {
			DataGridItemCollection	c;
			ArrayList		list;
			DataGridItem[]		copy;
			DataGridItem		item;

			list = new ArrayList();
			item = new DataGridItem(0, 0, ListItemType.Item);
			list.Add(item);
			item = new DataGridItem(1, 1, ListItemType.Header);
			list.Add(item);
			item = new DataGridItem(2, 2, ListItemType.Footer);
			list.Add(item);

			c = new DataGridItemCollection(list);

			copy = new DataGridItem[3];
			Assert.AreEqual(3, c.Count, "C1");
			c.CopyTo(copy, 0);
			Assert.AreEqual(3, copy.Length, "C2");

			copy = new DataGridItem[4];
			c.CopyTo(copy, 1);
			Assert.AreEqual(4, copy.Length, "C3");
		}
示例#2
0
		public void OutOfBounds () {
			DataGridItemCollection	c;
			ArrayList		list;
			DataGridItem[]		copy;
			DataGridItem		item;

			list = new ArrayList();
			item = new DataGridItem(0, 0, ListItemType.Item);
			list.Add(item);
			item = new DataGridItem(1, 1, ListItemType.Header);
			list.Add(item);
			item = new DataGridItem(2, 2, ListItemType.Footer);
			list.Add(item);

			c = new DataGridItemCollection(list);

			copy = new DataGridItem[2];
			c.CopyTo(copy, 0);
		}