예제 #1
0
 public PaginatorState()
 {
     NumberOfPages = new IntMore0Less65535Exclsv();
     CurrentPage   = new IntMore0Less65535Exclsv();
     ItemsPerPage  = new IntMore0Less65535Exclsv();
     PagesToSkip   = new IntMore0Less65535Exclsv();
 }
예제 #2
0
        void InitPaginator()
        {
            var dbData = MOCK_InitializeData();

            DbData = dbData;
            var currentPage          = new IntMore0Less65535Exclsv(1);
            var itemsPerPageList     = MOCK_InitializeItemsPerPage().ToArray();
            var pagesToSkipList      = MOCK_InitializeItemsPagesToSkip().ToArray();
            var defauleSelectedIndex = 0;

            ComboBoxItemsPerPage.ItemsSource   = itemsPerPageList;
            ComboBoxItemsPerPage.SelectedIndex = defauleSelectedIndex;

            ComboBoxPagesToSkip.ItemsSource   = pagesToSkipList;
            ComboBoxPagesToSkip.SelectedIndex = defauleSelectedIndex;
            FSharpList <int> niceSharpList = ListModule.OfSeq(dbData);

            PaginatorCurrentState = Init(
                currentPage,
                itemsPerPageList[defauleSelectedIndex],
                pagesToSkipList[defauleSelectedIndex],
                Context.GetTotalNumberOfItemsInDB(dbData)
                );

            RenderPaginator(PaginatorCurrentState);
        }
예제 #3
0
        Init(
            IntMore0Less65535Exclsv pCurrentPage,
            IntMore0Less65535Exclsv pItemsPerPage,
            IntMore0Less65535Exclsv pPagesToSkip,
            int pTotalNumberOfItemsInDB
            )
        {
            var res = new PaginatorState();

            res.CurrentPage            = pCurrentPage;
            res.ItemsPerPage           = pItemsPerPage;
            res.PagesToSkip            = pPagesToSkip;
            res.TotalNumberOfItemsInDB = pTotalNumberOfItemsInDB;

            return(NextState(res));
        }
예제 #4
0
        public PaginatorState(
            IntMore0Less65535Exclsv pCurrentPage,
            IntMore0Less65535Exclsv pItemsPerPage,
            IntMore0Less65535Exclsv pPagesToSkip,
            IntMore0Less65535Exclsv pNumberOfPages,

            int pTotalNumberOfItemsInDB,

            bool pIsValidLeft,
            bool pIsValidLeftMore,
            bool pIsValidRight,
            bool pIsValidRightMore,

            IEnumerable <int> pDbData,

            Func <IEnumerable <int> > pPagesToShow,
            Func <IEnumerable <int> > pPagesRight,
            Func <IEnumerable <int> > pPagesRightMore,
            Func <IEnumerable <int> > pPagesLeft,
            Func <IEnumerable <int> > pPagesLeftMore
            ) : this()
        {
            NumberOfPages          = pNumberOfPages;
            CurrentPage            = pCurrentPage;
            ItemsPerPage           = pItemsPerPage;
            PagesToSkip            = pPagesToSkip;
            TotalNumberOfItemsInDB = pTotalNumberOfItemsInDB;

            IsValidLeft      = pIsValidLeft;
            IsValidLeftMore  = pIsValidLeftMore;
            IsValidRight     = pIsValidRight;
            IsValidRightMore = pIsValidRightMore;

            DbData = pDbData;

            PagesToShow    = pPagesToShow;
            PagesRight     = pPagesRight;
            PagesRightMore = pPagesRightMore;
            PagesLeft      = pPagesLeft;
            PagesLeftMore  = pPagesLeftMore;
        }
예제 #5
0
 private void UpdateUI_CurrentPageIs(IntMore0Less65535Exclsv pCurrentPage)
 {
     Name_CurrentPageIs.Text = pCurrentPage.Value.ToString();
 }