当前位置: 首页>>代码示例>>C#>>正文


C# CollectionView.MoveCurrentToLast方法代码示例

本文整理汇总了C#中CollectionView.MoveCurrentToLast方法的典型用法代码示例。如果您正苦于以下问题:C# CollectionView.MoveCurrentToLast方法的具体用法?C# CollectionView.MoveCurrentToLast怎么用?C# CollectionView.MoveCurrentToLast使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在CollectionView的用法示例。


在下文中一共展示了CollectionView.MoveCurrentToLast方法的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。

示例1: IsCurrentAfterLast_Returns_True_When_After_Last

        public void IsCurrentAfterLast_Returns_True_When_After_Last()
        {
            List<int> source = new List<int> { 1, 2 };
            CollectionView target = new CollectionView(source);

            target.MoveCurrentToLast();
            target.MoveCurrentToNext();

            Assert.IsTrue(target.IsCurrentAfterLast);
            Assert.AreEqual(2, target.CurrentPosition);
        }
开发者ID:modulexcite,项目名称:Avalonia,代码行数:11,代码来源:CollectionViewTests.cs

示例2: MoveCurrentToLast_Returns_False_For_Empty_Collection

        public void MoveCurrentToLast_Returns_False_For_Empty_Collection()
        {
            List<int> source = new List<int>();
            CollectionView target = new CollectionView(source);

            Assert.IsFalse(target.MoveCurrentToLast());
            Assert.IsNull(target.CurrentItem);
            Assert.AreEqual(-1, target.CurrentPosition);
        }
开发者ID:modulexcite,项目名称:Avalonia,代码行数:9,代码来源:CollectionViewTests.cs

示例3: IsCurrentAfterLast

		public void IsCurrentAfterLast ()
		{
			CollectionView c = new CollectionView (new object [] { 1, 2 });
			Assert.IsFalse (c.IsCurrentAfterLast, "1");
			Assert.IsFalse (c.IsCurrentBeforeFirst, "2");
			c.MoveCurrentTo (1);
			Assert.IsFalse (c.IsCurrentAfterLast, "3");
			Assert.IsFalse (c.IsCurrentBeforeFirst, "4");
			c.MoveCurrentTo (3);
			Assert.IsFalse (c.IsCurrentAfterLast, "5");
			Assert.IsTrue (c.IsCurrentBeforeFirst, "6");
			c.MoveCurrentTo (1);
			Assert.IsFalse (c.IsCurrentAfterLast, "7");
			Assert.IsFalse (c.IsCurrentBeforeFirst, "8");
			c.MoveCurrentToPrevious ();
			Assert.IsFalse (c.IsCurrentAfterLast, "9");
			Assert.IsTrue (c.IsCurrentBeforeFirst, "10");
			c.MoveCurrentToLast ();
			c.MoveCurrentToNext ();
			Assert.IsTrue (c.IsCurrentAfterLast, "11");
			Assert.IsFalse (c.IsCurrentBeforeFirst, "12");
			c.MoveCurrentToFirst ();
			Assert.IsFalse (c.IsCurrentAfterLast, "13");
			Assert.IsFalse (c.IsCurrentBeforeFirst, "14");
			c.MoveCurrentToPrevious ();
			c.MoveCurrentToNext ();
			Assert.IsFalse (c.IsCurrentAfterLast, "15");
			Assert.IsFalse (c.IsCurrentBeforeFirst, "16");
			c.MoveCurrentToLast ();
			c.MoveCurrentToNext ();
			c.MoveCurrentToPrevious ();
			Assert.IsFalse (c.IsCurrentAfterLast, "17");
			Assert.IsFalse (c.IsCurrentBeforeFirst, "18");
		}
开发者ID:JianwenSun,项目名称:mono-soc-2007,代码行数:34,代码来源:CollectionViewTest.cs

示例4: MoveCurrentToLast_Returns_True_When_Item_Available

        public void MoveCurrentToLast_Returns_True_When_Item_Available()
        {
            List<int> source = new List<int> { 1, 2 };
            CollectionView target = new CollectionView(source);

            Assert.IsTrue(target.MoveCurrentToLast());
            Assert.AreEqual(2, target.CurrentItem);
            Assert.AreEqual(1, target.CurrentPosition);
        }
开发者ID:modulexcite,项目名称:Avalonia,代码行数:9,代码来源:CollectionViewTests.cs

示例5: MoveCurrentToLast

		public void MoveCurrentToLast ()
		{
			CollectionView c = new CollectionView (new object [] { 1, 2 });
			Assert.IsTrue (c.MoveCurrentToLast (), "1");
			Assert.AreEqual (c.CurrentItem, 2, "2");
			Assert.AreEqual (c.CurrentPosition, 1, "3");
			c = new CollectionView (new object [] { });
			Assert.IsFalse (c.MoveCurrentToLast (), "4");
			Assert.IsNull (c.CurrentItem, "5");
			Assert.AreEqual (c.CurrentPosition, -1, "6");
		}
开发者ID:JianwenSun,项目名称:mono-soc-2007,代码行数:11,代码来源:CollectionViewTest.cs


注:本文中的CollectionView.MoveCurrentToLast方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。