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


C# CollectionView.MoveCurrentToNext方法代碼示例

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


在下文中一共展示了CollectionView.MoveCurrentToNext方法的7個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的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: CurrentChanged_Should_Not_Be_Raised_If_Cancelled

        public void CurrentChanged_Should_Not_Be_Raised_If_Cancelled()
        {
            List<int> source = new List<int> { 1, 2, 3 };
            CollectionView target = new CollectionView(source);
            bool eventRaised = false;

            target.CurrentChanging += (s, e) => e.Cancel = true;
            target.CurrentChanged += (s, e) => eventRaised = true;
            target.MoveCurrentToNext();

            Assert.IsFalse(eventRaised);
        }
開發者ID:modulexcite,項目名稱:Avalonia,代碼行數:12,代碼來源:CollectionViewTests.cs

示例3: MoveCurrentToNext_Returns_False_When_No_Item_Available

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

            Assert.IsTrue(target.MoveCurrentToNext());
            Assert.IsFalse(target.MoveCurrentToNext());
            Assert.AreEqual(null, target.CurrentItem);
            Assert.AreEqual(2, target.CurrentPosition);
        }
開發者ID:modulexcite,項目名稱:Avalonia,代碼行數:10,代碼來源:CollectionViewTests.cs

示例4: MoveCurrentToNext_Returns_True_When_Added_Item_Available

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

            source.Add(1);

            Assert.IsTrue(target.MoveCurrentToNext());
            Assert.AreEqual(1, target.CurrentItem);
            Assert.AreEqual(0, target.CurrentPosition);
        }
開發者ID:modulexcite,項目名稱:Avalonia,代碼行數:11,代碼來源:CollectionViewTests.cs

示例5: MoveCurrentToNext_Returns_False_For_Empty_Collection

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

            Assert.IsFalse(target.MoveCurrentToNext());
            Assert.IsNull(target.CurrentItem);
            Assert.AreEqual(-1, target.CurrentPosition);
        }
開發者ID:modulexcite,項目名稱:Avalonia,代碼行數:9,代碼來源:CollectionViewTests.cs

示例6: 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

示例7: MoveCurrentToNext

		public void MoveCurrentToNext ()
		{
			CollectionView c = new CollectionView (new object [] { 1, 2 });
			Assert.IsTrue (c.MoveCurrentToNext (), "1");
			Assert.AreEqual (c.CurrentItem, 2, "2");
			Assert.AreEqual (c.CurrentPosition, 1, "3");
			Assert.IsFalse (c.MoveCurrentToNext (), "4");
			Assert.IsNull (c.CurrentItem, "5");
			// Why?
			Assert.AreEqual (c.CurrentPosition, 2, "6");
			c.MoveCurrentToFirst ();
			Assert.IsTrue (c.MoveCurrentToNext (), "7");
			Assert.IsFalse (c.MoveCurrentToNext (), "8");
		}
開發者ID:JianwenSun,項目名稱:mono-soc-2007,代碼行數:14,代碼來源:CollectionViewTest.cs


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