public virtual void PaginateRecursive(ControlPager pager) { }
public ItemPager(ControlPager pager, MobileControl control, int itemCount, int itemsPerPage, int itemWeight) {}
//********************************************************************* // // MultiPanel.PaginateRecursive Method // // PaginateRecursive is called by the framework to recursively // paginate children. For MultiPanel controls, PaginateRecursive // only paginates the active child pane. // //********************************************************************* public override void PaginateRecursive(ControlPager pager) { Control activePane = (Control) ActivePane; // Active pane may not be a mobile control (e.g. it may be // a user control). MobileControl mobileCtl = activePane as MobileControl; if (mobileCtl != null) { // Paginate the children. mobileCtl.PaginateRecursive(pager); // Set own first and last page from results of child // pagination. FirstPage = mobileCtl.FirstPage; LastPage = pager.PageCount; } else { // Call the DoPaginateChildren utility method to // paginate a non-mobile child. int firstAssignedPage = -1; DoPaginateChildren(pager, activePane, ref firstAssignedPage); // Set own first and last page from results of child // pagination. if (firstAssignedPage != -1) { FirstPage = firstAssignedPage; } else { FirstPage = pager.GetPage(100); } LastPage = pager.PageCount; } }
//********************************************************************* // // MultiPanel.DoPaginateRecursive Static Method // // The DoPaginateRecursive method paginates non-mobile child // controls, looking for mobile controls inside them. // //********************************************************************* private static void DoPaginateChildren(ControlPager pager, Control ctl, ref int firstAssignedPage) { // Search all children of the control. if (ctl.HasControls()) { foreach (Control child in ctl.Controls) { if (child.Visible) { // Look for a visible mobile control. MobileControl mobileCtl = child as MobileControl; if (mobileCtl != null) { // Paginate the mobile control. mobileCtl.PaginateRecursive(pager); // If this is the first control being paginated, // set the first assigned page. if (firstAssignedPage == -1) { firstAssignedPage = mobileCtl.FirstPage; } } else if (child is UserControl) { // Continue paginating user controls, which may contain // their own mobile children. DoPaginateChildren(pager, child, ref firstAssignedPage); } } } } }
public ItemPager(ControlPager pager, MobileControl control, int itemCount, int itemsPerPage, int itemWeight) { }