// Token: 0x06001A52 RID: 6738 RVA: 0x0007D6B0 File Offset: 0x0007B8B0
        internal object ViewItem(int index)
        {
            Invariant.Assert(index >= 0 && this.View != null);
            CollectionView collectionView = this.View as CollectionView;

            if (collectionView != null)
            {
                return(collectionView.GetItemAt(index));
            }
            if (this.ViewList != null)
            {
                return(this.ViewList[index]);
            }
            return(null);
        }
Пример #2
0
        //------------------------------------------------------
        //
        //  Internal Methods
        //
        //------------------------------------------------------

        #region Internal Methods

        internal object ViewItem(int index)
        {
            Invariant.Assert(index >= 0 && View != null);

            CollectionView cv = View as CollectionView;

            if (cv != null)
            {
                return(cv.GetItemAt(index));
            }

            // As a last resort, use the IList interface or IndexedEnumerable to iterate to the nth item.
            if (ViewList != null)
            {
                return(ViewList[index]);
            }

            return(null);
        }
Пример #3
0
		public void GetItemAt ()
		{
			object[] list = { 1, 2, 3, 4, 5, 6 };
			var cv = new CollectionView (list);
			Assert.AreEqual (4, cv.GetItemAt (3), "A1");
			Assert.IsNull (cv.GetItemAt (99), "A2");
		}
Пример #4
0
		public void GetItemAtLessThan0 ()
		{
			var cv = new CollectionView (new object[] { });
			cv.GetItemAt (-1);
		}