コード例 #1
0
 public void SetPageUrl(string currentUrlWithQueryString)
 {
     if (!currentUrlWithQueryString.Contains("?"))
     {
         PageUrl = currentUrlWithQueryString + "?p=" + Page;
     }
     else
     {
         if (rgx.Match(currentUrlWithQueryString).Success)
         {
             PageUrl = rgx.Replace(currentUrlWithQueryString, ("p=" + Page));
         }
         else
         {
             PageUrl = currentUrlWithQueryString + ("&p=" + Page);
         }
     }
     if (NextPage >= 1)
     {
         NextPageUrl = rgx.Replace(PageUrl, ("p=" + NextPage.ToString()));
     }
     if (PrevPage >= 1)
     {
         PrevPageUrl = rgx.Replace(PageUrl, ("p=" + PrevPage.ToString()));
     }
     PageUrlTemplate = rgx.Replace(PageUrl, ("p={{page}}"));
 }
コード例 #2
0
ファイル: Giohang.aspx.cs プロジェクト: DoManhQuang/ASP.NET
    protected void Page_Load(object sender, EventArgs e)
    {
        NextPage next = new NextPage("web_datmua.aspx");

        Session["nextpage"] = next;
        ShoppingCart cart = null;

        if (Session["cart"] != null)
        {
            List <InfoThucPham> lstThucpham = (List <InfoThucPham>)Session["cart"];
            cart = new ShoppingCart(lstThucpham);
            ListDataTables listData  = new ListDataTables();
            DataTable      dataTable = listData.ShoppingCart(cart);
            gvGiohang.DataSource = dataTable;
            gvGiohang.DataBind();
            lblTongtien.Text = string.Format("{0:#,0 VND}", Convert.ToInt32(cart.getTongTien().ToString()));
        }
        else
        {
            lblTongtien.Text = "0.000 VND";
        }

        string   web      = "Giohang.aspx";
        NextPage nextPage = new NextPage(web);

        Session["nextpage"] = nextPage;
    }
コード例 #3
0
ファイル: BaseClass.cs プロジェクト: ZheKokha/TA-lab-tasks
        public void HeadersToListAllPages()
        {
            for (int i = 1; i < 10; i++)
            {
                List <IWebElement> listOfTitles = ArticleHeaders.ToList();

                int iterator = 0;
                foreach (IWebElement item in listOfTitles)
                {
                    if (item.Text.Contains(companyName))
                    {
                        MakeScreenshot("C:/temp/", imageName);
                        int numPage = i;
                        i = 9;
                        break;
                    }
                    else
                    {
                        iterator++;
                    }
                }
                if (iterator == listOfTitles.Count)
                {
                    NextPage.Click();
                }
                iterator = 0;
            }
        }
コード例 #4
0
        /// <summary>
        /// Gets the hash code
        /// </summary>
        /// <returns>Hash code</returns>
        public override int GetHashCode()
        {
            unchecked // Overflow is fine, just wrap
            {
                var hashCode = 41;
                // Suitable nullity checks etc, of course :)
                if (Class != null)
                {
                    hashCode = hashCode * 59 + Class.GetHashCode();
                }
                if (Links != null)
                {
                    hashCode = hashCode * 59 + Links.GetHashCode();
                }
                if (Items != null)
                {
                    hashCode = hashCode * 59 + Items.GetHashCode();
                }

                hashCode = hashCode * 59 + LastPage.GetHashCode();

                hashCode = hashCode * 59 + NextPage.GetHashCode();

                hashCode = hashCode * 59 + PageSize.GetHashCode();
                return(hashCode);
            }
        }
コード例 #5
0
 public IEnumerator TurnPage(int direction)
 {
     turningPage = true;
     if (direction < 0)
     {
         PageIndex--;
         turningScale = -1f;
         dotTarget   -= 1f;
         Page.Redraw(CurrentPageBuffer);
         NextPage.Redraw(NextPageBuffer);
         while ((turningScale = Calc.Approach(turningScale, 1f, Engine.DeltaTime * 8f)) < 1f)
         {
             yield return(null);
         }
     }
     else
     {
         NextPage.Redraw(NextPageBuffer);
         turningScale = 1f;
         dotTarget   += 1f;
         while ((turningScale = Calc.Approach(turningScale, -1f, Engine.DeltaTime * 8f)) > -1f)
         {
             yield return(null);
         }
         PageIndex++;
         Page.Redraw(CurrentPageBuffer);
     }
     turningScale = 1f;
     turningPage  = false;
     yield break;
 }
コード例 #6
0
 private void OnToPreferencesCommand()
 {
     try
     {
         _model.Validate();
         NextPage?.Invoke(this, null);
     } catch { }
 }
コード例 #7
0
 public HomePageViewModel()
 {
     GoNextCommand = new Command(() =>
     {
         INavigation navigation = (App.Current.MainPage as NavigationPage).Navigation;
         Page page = new NextPage(Message);
         navigation.PushAsync(page);
     });
 }
コード例 #8
0
    /**
     * Used to hide/show the previous/next buttons.
     */
    void Update()
    {
        var meshPro = Description.GetComponent <TextMeshPro>();

        // If we are at Page < PageCount, we can go a step further so display the NextPage-Button.
        NextPage.SetActive(meshPro.pageToDisplay < meshPro.textInfo.pageCount);

        // If we are at Page > 1, we can go a step back so display the PreviousPage-Button.
        PreviousPage.SetActive(meshPro.pageToDisplay > 1);
    }
コード例 #9
0
    protected void Page_Load(object sender, EventArgs e)
    {
        string web  = "Chitietthucpham.aspx";
        string matp = Request.QueryString["MaTP"];

        web = web + "?MaTP=" + matp;
        NextPage nextPage = new NextPage(web);

        Session["nextpage"] = nextPage;
    }
コード例 #10
0
 private void OnToRunCommand()
 {
     try
     {
         NextPage?.Invoke(this, null);
     }
     catch (Exception)
     {
     }
 }
コード例 #11
0
    protected void Page_Load(object sender, EventArgs e)
    {
        CollectionPager();
        string web    = "Danhsachthucphamtheoloai.aspx";
        string maloai = Request.QueryString["Maloai"];

        web = web + "?Maloai=" + maloai;
        NextPage nextPage = new NextPage(web);

        Session["nextpage"] = nextPage;
    }
コード例 #12
0
 public void GoToNextPage()
 {
     if (NextPage.isEnabled())
     {
         NextPage.Click();
     }
     else
     {
         BRLogger.LogInfo("User is on the Last page.");
     }
 }
コード例 #13
0
    public void ProgressAll(int page, float time, NextPage nextPage)
    {
        if (running)
        {
            return;
        }

        ReleasePick();

        running = true;
        StartCoroutine(Progress(page, time, nextPage));
    }
コード例 #14
0
ファイル: SignUpWindow.xaml.cs プロジェクト: Redi22/Edir-
 public SignUpWindow()
 {
     InitializeComponent();
     index      = 0;
     _context   = new EdirDbContext();
     essentials = new Essentials();
     nextPage   = new NextPage();
     thirdPage  = new ThirdPage();
     payments   = new List <long>();
     info       = new List <string>();
     admin      = _context.UserAccounts.FirstOrDefault(u => u.Id == 5);
 }
コード例 #15
0
 public override string ToString()
 {
     return("PageNumber: " + PageNumber.ToString() + "\n" +
            "PageSize: " + PageSize.ToString() + "\n" +
            "TotalPages: " + TotalPages.ToString() + "\n" +
            "TotalRecords: " + TotalRecords.ToString() + "\n" +
            "NextPage: " + NextPage.ToString() + "\n" +
            "PreviousPage: " + PreviousPage.ToString() + "\n" +
            "Data: " + Data + "\n" +
            "Succeeded: " + Succeeded.ToString() + "\n" +
            "Errors: " + Errors.ToString() + "\n");
 }
コード例 #16
0
 public FizzBuzzDriver NextPageLinkShouldNotBeEnabled()
 {
     NextPage
     .GetClasses()
     .Should().Contain(
         "disabled",
         "because the next page link should look disabled on user's screen");
     NextPage
     .TagName
     .Should().Be(
         "div",
         "because the next page link should not be a hyper link");
     return(this);
 }
コード例 #17
0
 public void GoToNextPage(int count)
 {
     for (int i = 0; i < count; i++)
     {
         if (NextPage.isEnabled())
         {
             NextPage.Click();
         }
         else
         {
             BRLogger.LogInfo("User is on the Last page.");
             break;
         }
     }
 }
コード例 #18
0
        public override string ToString()
        {
            string nextPageToken = null;

            if (HasNextPage)
            {
                var nextPage = new NextPage {
                    NextPageIndex = NextPageIndex + 1
                };
                string nextPageJson = JsonConvert.SerializeObject(nextPage);

                byte[] nextPageAsBytes = Encoding.ASCII.GetBytes(nextPageJson);
                nextPageToken = Convert.ToBase64String(nextPageAsBytes);
            }

            return(nextPageToken);
        }
コード例 #19
0
        /// <summary>
        /// Returns true if GithubRepositories instances are equal
        /// </summary>
        /// <param name="other">Instance of GithubRepositories to be compared</param>
        /// <returns>Boolean</returns>
        public bool Equals(GithubRepositories other)
        {
            if (other is null)
            {
                return(false);
            }
            if (ReferenceEquals(this, other))
            {
                return(true);
            }

            return
                ((
                     Class == other.Class ||
                     Class != null &&
                     Class.Equals(other.Class)
                     ) &&
                 (
                     Links == other.Links ||
                     Links != null &&
                     Links.Equals(other.Links)
                 ) &&
                 (
                     Items == other.Items ||
                     Items != null &&
                     other.Items != null &&
                     Items.SequenceEqual(other.Items)
                 ) &&
                 (
                     LastPage == other.LastPage ||

                     LastPage.Equals(other.LastPage)
                 ) &&
                 (
                     NextPage == other.NextPage ||

                     NextPage.Equals(other.NextPage)
                 ) &&
                 (
                     PageSize == other.PageSize ||

                     PageSize.Equals(other.PageSize)
                 ));
        }
コード例 #20
0
    public IEnumerator Progress(int page, float time, NextPage nextPage)
    {
        int i = 0;
        int p = 0;

        while (true)
        {
            if (!Test.instance.waitExtinc)
            {
                frames[i].Progress();
                yield return(new WaitForSeconds(time));

                if (!Test.instance.waitExtinc)
                {
                    frames[i++].ProgressEnd();
                }
                else
                {
                    ++i;
                }
                if (i == 60)
                {
                    if (p == page - 1)
                    {
                        break;
                    }
                    i = 0;
                    ++p;
                    nextPage();
                }
            }
            else
            {
                Test.instance.waitExtinc = Test.instance.enemyCount == 0 ? false : true;
                yield return(null);
            }
        }

        Test.instance.DeleteAllGameObject();
        Test.instance.MarkerEnable();
        running = false;
    }
コード例 #21
0
        public override ExamPage OnClickFunc(IPlayContext context = null)
        {
            base.OnClickFunc(context);
            if (NextPage != null)
            {
                NextPage.SetProbability(CurrProbability);
                return(NextPage);
            }

            var probability = _numberGenerator.NextDouble01();

            if (probability > CurrProbability || probability >= 0.999)
            {
                SuccessPage = SuccessPage ?? new ExamSuccessPage();
                return(SuccessPage);
            }

            FailPage = FailPage ?? new ExamFailPage();
            return(FailPage);
        }
コード例 #22
0
 public void PrintNextPage(PrintDocument Doc, PrintPageEventArgs ppea)
 {
     if (IsPreview)
     {
         ppea.HasMorePages = true;
         NewRow?.Invoke();
         return;
     }
     if (ppea.PageSettings.PrinterSettings.PrintRange == PrintRange.SomePages)
     {
         if (!PageInRange(ppea.PageSettings.PrinterSettings.FromPage, ppea.PageSettings.PrinterSettings.ToPage))
         {
             ppea.Graphics.Clear(Color.White);
             //doc_PrintPage(Doc, ppea);
             NextPage?.Invoke(Doc, ppea);
         }
         ppea.HasMorePages = PageNumber < ppea.PageSettings.PrinterSettings.ToPage;
         return;
     }
     ppea.HasMorePages = true;
 }
コード例 #23
0
        private int GetPageFromParameter()
        {
            if (string.IsNullOrEmpty(PreviousPage))
            {
                return(1);
            }

            if (string.IsNullOrEmpty(NextPage))
            {
                return(TotalPages);
            }

            var dict = NextPage.GetQueryStringDict();

            if (dict.ContainsKey("page"))
            {
                return(int.Parse(dict["page"]) - 1);
            }

            return(0);
        }
コード例 #24
0
ファイル: Dangnhap.aspx.cs プロジェクト: DoManhQuang/ASP.NET
 protected void btnLogin_Click(object sender, EventArgs e)
 {
     if (Session["users"] != null)
     {
         Session.Contents.Remove("users");
     }
     Connect(txttendn.Text, txtmatkhau.Text);
     if (login == true)
     {
         if (Session["nextpage"] != null)
         {
             NextPage nextPage = (NextPage)Session["nextpage"];
             Response.Redirect(nextPage.getNextWeb());
         }
         Session.Add("userName", txttendn.Text);
         Session.Add("userPass", txtmatkhau.Text);
         Response.Redirect("Trangchu.aspx");
     }
     else
     {
         lblthongbao.Text = "Check your password and username again";
     }
 }
コード例 #25
0
 private void OnNextButtonPointerUp()
 {
     NextPage?.Invoke();
 }
コード例 #26
0
 private void OnToSetupCommand()
 {
     NextPage?.Invoke(this, null);
 }
コード例 #27
0
ファイル: StudyTest.cs プロジェクト: yczhangsjtu/Learner
 public StudyTestNode(StudyTestPage page, NextPage nextPage)
 {
     this.page     = page;
     this.nextPage = nextPage;
 }
コード例 #28
0
    /// <summary>
    /// Subscribing listeners to all other buttons.
    /// </summary>
    public static void SetReactionButtons()
    {
        Coroutines coroutines = GameObject.FindObjectOfType(typeof(Coroutines)) as Coroutines;

        GlobalSceneObjects.mainMenu.transform.Find("Content").Find("ButtonPlay").GetComponent <Button>().onClick.AddListener(delegate { StartGame.Invoke(); });
        GlobalSceneObjects.mainMenu.transform.Find("Content").Find("ButtonAboutUs").GetComponent <Button>().onClick.AddListener(delegate { AboutUs.Invoke(); });
        GlobalSceneObjects.mainMenu.transform.Find("Content").Find("ButtonWriteToUs").GetComponent <Button>().onClick.AddListener(delegate { WriteToUs.Invoke(); });
        GlobalSceneObjects.mainMenu.transform.Find("AchievmentButton").GetComponent <Button>().onClick.AddListener(delegate { Achievments.Invoke(); });
        GlobalSceneObjects.aboutUs.transform.Find("Frame").Find("Cross").GetComponent <Button>().onClick.AddListener(delegate { AboutUs.Exit(); });
        GlobalSceneObjects.aboutUs.transform.Find("Frame").Find("Table").Find("InstMadm1nd").GetComponent <Button>().onClick.AddListener(delegate { AboutUs.TransferURL(1); });
        GlobalSceneObjects.aboutUs.transform.Find("Frame").Find("Table").Find("InstPilgrim").GetComponent <Button>().onClick.AddListener(delegate { AboutUs.TransferURL(2); });
        GlobalSceneObjects.aboutUs.transform.Find("Frame").Find("Table").Find("CreditsButton").GetComponent <Button>().onClick.AddListener(delegate { AboutUs.TransferURL(3); });
        GlobalSceneObjects.aboutUs.transform.Find("Frame").Find("Table").Find("InstRaben_krausz").GetComponent <Button>().onClick.AddListener(delegate { AboutUs.TransferURL(4); });
        GlobalSceneObjects.aboutUs.transform.Find("Frame").Find("Table").Find("VKOleg").GetComponent <Button>().onClick.AddListener(delegate { AboutUs.TransferURL(5); });
        GlobalSceneObjects.writeToUs.transform.Find("Frame").Find("Cross").GetComponent <Button>().onClick.AddListener(delegate { WriteToUs.Exit(); });
        GlobalSceneObjects.achievmentsInCanvas.transform.Find("Frame").Find("Cross").GetComponent <Button>().onClick.AddListener(delegate { Achievments.Exit(); });
        GlobalSceneObjects.mainMenu.transform.Find("Sounds").GetComponent <Button>().onClick.AddListener(delegate { Sounds.Invoke(); SaveData.Save(); });
        GlobalSceneObjects.mainMenu.transform.Find("Language").Find("ButtonLanguageRus").GetComponent <Button>().onClick.AddListener(delegate { Language.SetRussian(); });
        GlobalSceneObjects.mainMenu.transform.Find("Language").Find("ButtonLanguageEng").GetComponent <Button>().onClick.AddListener(delegate { Language.SetEnglish(false); });

        GlobalSceneObjects.showNextPage.GetComponent <Button>().onClick.AddListener(delegate { NextPage.Invoke(); });

        GlobalSceneObjects.possessedTasks.transform.Find("BallLatestDevelopments").GetComponent <Button>().onClick.AddListener(delegate { SelectBall.Invoke("LatestDevelopments"); });
        GlobalSceneObjects.possessedTasks.transform.Find("BallMechanics").GetComponent <Button>().onClick.AddListener(delegate { SelectBall.Invoke("Mechanics"); });
        GlobalSceneObjects.possessedTasks.transform.Find("BallElementaryLaws").GetComponent <Button>().onClick.AddListener(delegate { SelectBall.Invoke("ElementaryLaws"); });
        GlobalSceneObjects.possessedTasks.transform.Find("BallSimpleLever").GetComponent <Button>().onClick.AddListener(delegate { SelectBall.Invoke("SimpleLever"); });

        GlobalSceneObjects.logicTasks.transform.Find("BallAcademicDegree").GetComponent <Button>().onClick.AddListener(delegate { SelectBall.Invoke("AcademicDegree"); });
        GlobalSceneObjects.logicTasks.transform.Find("BallExperimentalProcess").GetComponent <Button>().onClick.AddListener(delegate { SelectBall.Invoke("ExperimentalProcess"); });
        GlobalSceneObjects.logicTasks.transform.Find("BallScientistsNotes").GetComponent <Button>().onClick.AddListener(delegate { SelectBall.Invoke("ScientistsNotes"); });
        GlobalSceneObjects.logicTasks.transform.Find("BallBestPractices").GetComponent <Button>().onClick.AddListener(delegate { SelectBall.Invoke("BestPractices"); });
        GlobalSceneObjects.logicTasks.transform.Find("BallLightTests").GetComponent <Button>().onClick.AddListener(delegate { SelectBall.Invoke("LightTests"); });

        GlobalSceneObjects.mainMenuBack.GetComponent <Button>().onClick.AddListener(delegate { GlobalVariables.stateForAnimation = (int)GlobalVariables.NameAnimation.MainMenu; HideLevelContent.Invoke(); HideLevelButtons.Invoke(); });
        GlobalSceneObjects.selectLvlBack.GetComponent <Button>().onClick.AddListener(delegate { GlobalVariables.stateForAnimation = GlobalVariables.activeNameLevel; HideLevelContent.Invoke(); HideLevelButtons.Invoke(); });


        GlobalSceneObjects.continueButton.GetComponent <Button>().onClick.AddListener(delegate { ContinueButton.Press(); });

        GlobalSceneObjects.helpButton.transform.Find("CountHelp").Find("PictureHelp").GetComponent <Button>().onClick.AddListener(delegate { coroutines.InvokePressHelp(); });

        GlobalSceneObjects.helpButton.transform.Find("HelpButton").GetComponent <Button>().onClick.AddListener(delegate { HelpButton.Press(); });

        GlobalSceneObjects.skipLvl.GetComponent <Button>().onClick.AddListener(delegate { Skip.PressSkip(); });

        GlobalSceneObjects.helpBoard.transform.Find("Cross").GetComponent <Button>().onClick.AddListener(delegate
        {
            GlobalSceneObjects.helpBoard.GetComponent <Animator>().SetTrigger("HideTrigger"); GlobalVariables.stateForAnimation = (int)GlobalVariables.NameAnimation.HelpBoard;
        });

        GlobalSceneObjects.tableSkip.transform.Find("Yes").GetComponent <Button>().onClick.AddListener(delegate { Skip.PressYes(); });
        GlobalSceneObjects.tableSkip.transform.Find("No").GetComponent <Button>().onClick.AddListener(delegate { Skip.PressNo(); });

        GlobalSceneObjects.tableRate.transform.Find("Yes").GetComponent <Button>().onClick.AddListener(delegate { RateGame.PressYes(); });
        GlobalSceneObjects.tableRate.transform.Find("Later").GetComponent <Button>().onClick.AddListener(delegate { RateGame.PressLater(); });
        GlobalSceneObjects.tableRate.transform.Find("No").GetComponent <Button>().onClick.AddListener(delegate { RateGame.PressNo(); });
    }
コード例 #29
0
 public Schema()
     : base()
 {
     InstanceType = typeof(__Paginati__);
     ClassName    = "PaginationPage";
     Properties.ClearExposed();
     Html = Add <__TString__>("Html");
     Html.DefaultValue = "/KitchenSink/PaginationPage.html";
     Html.SetCustomAccessors((_p_) => { return(((__Paginati__)_p_).__bf__Html__); }, (_p_, _v_) => { ((__Paginati__)_p_).__bf__Html__ = (System.String)_v_; }, false);
     ChangePage = Add <__TLong__>("ChangePage$");
     ChangePage.DefaultValue = 0L;
     ChangePage.Editable     = true;
     ChangePage.SetCustomAccessors((_p_) => { return(((__Paginati__)_p_).__bf__ChangePage__); }, (_p_, _v_) => { ((__Paginati__)_p_).__bf__ChangePage__ = (System.Int64)_v_; }, false);
     ChangePage.AddHandler((Json pup, Property <Int64> prop, Int64 value) => { return(new Input.ChangePage()
         {
             App = (PaginationPage)pup, Template = (TLong)prop, Value = value
         }); }, (Json pup, Starcounter.Input <Int64> input) => { ((PaginationPage)pup).Handle((Input.ChangePage)input); });
     NextPage = Add <__TLong__>("NextPage$");
     NextPage.DefaultValue = 0L;
     NextPage.Editable     = true;
     NextPage.SetCustomAccessors((_p_) => { return(((__Paginati__)_p_).__bf__NextPage__); }, (_p_, _v_) => { ((__Paginati__)_p_).__bf__NextPage__ = (System.Int64)_v_; }, false);
     NextPage.AddHandler((Json pup, Property <Int64> prop, Int64 value) => { return(new Input.NextPage()
         {
             App = (PaginationPage)pup, Template = (TLong)prop, Value = value
         }); }, (Json pup, Starcounter.Input <Int64> input) => { ((PaginationPage)pup).Handle((Input.NextPage)input); });
     PreviousPage = Add <__TLong__>("PreviousPage$");
     PreviousPage.DefaultValue = 0L;
     PreviousPage.Editable     = true;
     PreviousPage.SetCustomAccessors((_p_) => { return(((__Paginati__)_p_).__bf__PreviousPage__); }, (_p_, _v_) => { ((__Paginati__)_p_).__bf__PreviousPage__ = (System.Int64)_v_; }, false);
     PreviousPage.AddHandler((Json pup, Property <Int64> prop, Int64 value) => { return(new Input.PreviousPage()
         {
             App = (PaginationPage)pup, Template = (TLong)prop, Value = value
         }); }, (Json pup, Starcounter.Input <Int64> input) => { ((PaginationPage)pup).Handle((Input.PreviousPage)input); });
     LastPage = Add <__TLong__>("LastPage$");
     LastPage.DefaultValue = 0L;
     LastPage.Editable     = true;
     LastPage.SetCustomAccessors((_p_) => { return(((__Paginati__)_p_).__bf__LastPage__); }, (_p_, _v_) => { ((__Paginati__)_p_).__bf__LastPage__ = (System.Int64)_v_; }, false);
     LastPage.AddHandler((Json pup, Property <Int64> prop, Int64 value) => { return(new Input.LastPage()
         {
             App = (PaginationPage)pup, Template = (TLong)prop, Value = value
         }); }, (Json pup, Starcounter.Input <Int64> input) => { ((PaginationPage)pup).Handle((Input.LastPage)input); });
     FirstPage = Add <__TLong__>("FirstPage$");
     FirstPage.DefaultValue = 0L;
     FirstPage.Editable     = true;
     FirstPage.SetCustomAccessors((_p_) => { return(((__Paginati__)_p_).__bf__FirstPage__); }, (_p_, _v_) => { ((__Paginati__)_p_).__bf__FirstPage__ = (System.Int64)_v_; }, false);
     FirstPage.AddHandler((Json pup, Property <Int64> prop, Int64 value) => { return(new Input.FirstPage()
         {
             App = (PaginationPage)pup, Template = (TLong)prop, Value = value
         }); }, (Json pup, Starcounter.Input <Int64> input) => { ((PaginationPage)pup).Handle((Input.FirstPage)input); });
     Library = Add <__TArray__>("Library");
     Library.SetCustomGetElementType((arr) => { return(__PaLibraryE__.DefaultTemplate); });
     Library.SetCustomAccessors((_p_) => { return(((__Paginati__)_p_).__bf__Library__); }, (_p_, _v_) => { ((__Paginati__)_p_).__bf__Library__ = (__Arr__)_v_; }, false);
     EntriesPerPage = Add <__TLong__>("EntriesPerPage$");
     EntriesPerPage.DefaultValue = 5L;
     EntriesPerPage.Editable     = true;
     EntriesPerPage.SetCustomAccessors((_p_) => { return(((__Paginati__)_p_).__bf__EntriesPerPage__); }, (_p_, _v_) => { ((__Paginati__)_p_).__bf__EntriesPerPage__ = (System.Int64)_v_; }, false);
     EntriesPerPage.AddHandler((Json pup, Property <Int64> prop, Int64 value) => { return(new Input.EntriesPerPage()
         {
             App = (PaginationPage)pup, Template = (TLong)prop, Value = value
         }); }, (Json pup, Starcounter.Input <Int64> input) => { ((PaginationPage)pup).Handle((Input.EntriesPerPage)input); });
     PageEntries = Add <__TArray1__>("PageEntries");
     PageEntries.SetCustomGetElementType((arr) => { return(__PaPageEntr__.DefaultTemplate); });
     PageEntries.SetCustomAccessors((_p_) => { return(((__Paginati__)_p_).__bf__PageEntries__); }, (_p_, _v_) => { ((__Paginati__)_p_).__bf__PageEntries__ = (__Arr1__)_v_; }, false);
     Pages = Add <__TArray2__>("Pages");
     Pages.SetCustomGetElementType((arr) => { return(__PaPagesEle__.DefaultTemplate); });
     Pages.SetCustomAccessors((_p_) => { return(((__Paginati__)_p_).__bf__Pages__); }, (_p_, _v_) => { ((__Paginati__)_p_).__bf__Pages__ = (__Arr2__)_v_; }, false);
     TotalEntries = Add <__TLong__>("TotalEntries");
     TotalEntries.DefaultValue = 0L;
     TotalEntries.SetCustomAccessors((_p_) => { return(((__Paginati__)_p_).__bf__TotalEntries__); }, (_p_, _v_) => { ((__Paginati__)_p_).__bf__TotalEntries__ = (System.Int64)_v_; }, false);
     TotalPages = Add <__TLong__>("TotalPages");
     TotalPages.DefaultValue = 0L;
     TotalPages.SetCustomAccessors((_p_) => { return(((__Paginati__)_p_).__bf__TotalPages__); }, (_p_, _v_) => { ((__Paginati__)_p_).__bf__TotalPages__ = (System.Int64)_v_; }, false);
     CurrentPage = Add <__TLong__>("CurrentPage");
     CurrentPage.DefaultValue = 1L;
     CurrentPage.SetCustomAccessors((_p_) => { return(((__Paginati__)_p_).__bf__CurrentPage__); }, (_p_, _v_) => { ((__Paginati__)_p_).__bf__CurrentPage__ = (System.Int64)_v_; }, false);
     CurrentOffset = Add <__TLong__>("CurrentOffset");
     CurrentOffset.DefaultValue = 0L;
     CurrentOffset.SetCustomAccessors((_p_) => { return(((__Paginati__)_p_).__bf__CurrentOffset__); }, (_p_, _v_) => { ((__Paginati__)_p_).__bf__CurrentOffset__ = (System.Int64)_v_; }, false);
     DisableFirst = Add <__TBool__>("DisableFirst");
     DisableFirst.DefaultValue = true;
     DisableFirst.SetCustomAccessors((_p_) => { return(((__Paginati__)_p_).__bf__DisableFirst__); }, (_p_, _v_) => { ((__Paginati__)_p_).__bf__DisableFirst__ = (System.Boolean)_v_; }, false);
     DisableLast = Add <__TBool__>("DisableLast");
     DisableLast.DefaultValue = false;
     DisableLast.SetCustomAccessors((_p_) => { return(((__Paginati__)_p_).__bf__DisableLast__); }, (_p_, _v_) => { ((__Paginati__)_p_).__bf__DisableLast__ = (System.Boolean)_v_; }, false);
 }
コード例 #30
0
        protected override void OnMouseWheel(MouseEventArgs e)
        {
            Point pos = e.Location; // pnlPageContanier.PointToClient(e.Location);

            if (MouseInPage(pos))
            {
                int pointY = ScrollPosition.Y;
                if (e.Delta < 0)
                {
                    pointY = ScrollPosition.Y + 120 * PageBounds.Height / ViewBounds.Height / 6;
                }
                else if (e.Delta > 0)
                {
                    pointY = ScrollPosition.Y - 120 * PageBounds.Height / ViewBounds.Height / 6;
                }
                ScrollPosition = new Point(ScrollPosition.X, pointY);
                if (vsb.Maximum == 0)
                {
                    if (e.Delta < 0)
                    {
                        if (NextPage != null)
                        {
                            NextPage.Invoke(this);
                        }
                    }
                    else
                    {
                        if (PreviousPage != null)
                        {
                            PreviousPage.Invoke(this);
                        }
                    }
                }
                else
                {
                    if (vsb.Value == vsb.Maximum)
                    {
                        //GoNext
                        _deltasCount++;
                        if (_deltasCount > 1)
                        {
                            _deltasCount = 0;
                            if (NextPage != null)
                            {
                                bHasMorePagesD = NextPage.Invoke(this);
                            }
                            bHasMorePagesT = true;
                            if (bHasMorePagesD)
                            {
                                ScrollPosition = new Point(hsb.Value, 0);
                            }
                        }
                    }
                    if (vsb.Value == 0)
                    {
                        //GoNext
                        _deltasCount++;
                        if (_deltasCount > 1)
                        {
                            _deltasCount = 0;
                            //GoBack
                            if (PreviousPage != null)
                            {
                                bHasMorePagesT = PreviousPage.Invoke(this);
                            }
                            bHasMorePagesD = true;
                            if (bHasMorePagesT)
                            {
                                ScrollPosition = new Point(hsb.Value, vsb.Maximum);
                            }
                        }
                    }
                }
            }
            base.OnMouseWheel(e);
        }