Exemple #1
0
        internal static VirtualPage CreateEmptyPage(VirtualList parentVirtualList, int startSourceIndex, int entryCount)
        {
            if (parentVirtualList == null)
            {
                throw new ArgumentNullException("parentVirtualList");
            }

            if (startSourceIndex < 0)
            {
                throw new ArgumentOutOfRangeException("startSourceIndex", startSourceIndex, "startSourceIndex must be greater than or equal to zero.");
            }

            if (entryCount < 0)
            {
                throw new ArgumentOutOfRangeException("entryCount", entryCount, "entryCount must be greater than or equal to zero.");
            }

            EmptyDataItem[] emptyDataItems = new EmptyDataItem[entryCount];
            for (int i = 0; i < entryCount; i++)
            {
                emptyDataItems[i] = new EmptyDataItem(startSourceIndex + i, parentVirtualList);
            }

            VirtualPage emptyDataItemPage = new VirtualPage(parentVirtualList, startSourceIndex, emptyDataItems);

            emptyDataItemPage.IsFilled = false;

            return(emptyDataItemPage);
        }
Exemple #2
0
        internal int IndexOf(object item)
        {
            if ((item == null) || (this.IsDisposed))
            {
                return(-1);
            }

            EmptyDataItem emptyDataItem = item as EmptyDataItem;

            if (emptyDataItem != null)
            {
                if ((emptyDataItem.ParentVirtualList == this) && (emptyDataItem.Index < m_virtualCount))
                {
                    return(emptyDataItem.Index);
                }

                return(-1);
            }

            return(m_tableOfContent.IndexOf(item));
        }