Exemplo n.º 1
0
        /// <summary>
        /// Finds a page in the supplied <c>pages</c> collection.
        /// </summary>
        /// <param name="pages">The collection of pages to search in.</param>
        /// <param name="pageLink">A <see cref="PageReference"/> to find.</param>
        /// <returns>The <see cref="PageData"/> for the page if one could be found; otherwise <c>null</c>.</returns>
        private static PageData FindPage(PageDataCollection pages, PageReference pageLink)
        {
            if (PageReference.IsNullOrEmpty(pageLink))
            {
                return(null);
            }
            int index = pages.Find(pageLink);

            if (index != -1)
            {
                return(pages[index]);
            }
            return(null);
        }