private static void UpdateLGChooseGameLEFT() { Input.ResetInputLimit(); init_debugger_Audio.PlaySound(0); if (LastPage != null && !LastPage.IsDisposed) { LastPage.Dispose(); CurrentLastPageLoc = Vector2.Zero; } if (OffScreenBuffer != null && !OffScreenBuffer.IsDisposed) { lock (OffScreenBuffer) { LastPage = new Texture2D(Memory.graphics.GraphicsDevice, OffScreenBuffer.Width, OffScreenBuffer.Height); lock (LastPage) { Color[] texdata = new Color[OffScreenBuffer.Width * OffScreenBuffer.Height]; OffScreenBuffer.GetData(texdata); LastPage.SetData(texdata); LastPageTarget = new Vector2(vp_per.X, CurrentPageLoc.Y); CurrentPageLoc = new Vector2(-PageSize.X, CurrentPageLoc.Y); } } } Blockpage--; }
/// <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); } }
internal override void Serialize(XmlSerializer serializer) { bool hasPrimary = HasHeaderFooter(HeaderFooterIndex.Primary); bool hasEvenPage = HasHeaderFooter(HeaderFooterIndex.EvenPage); bool hasFirstPage = HasHeaderFooter(HeaderFooterIndex.FirstPage); bool hasLastPage = HasHeaderFooter(HeaderFooterIndex.LastPage); // \primary... if (hasPrimary) { Primary.Serialize(serializer, "Primary"); } // \even... if (hasEvenPage) { EvenPage.Serialize(serializer, "Evenpage"); } // \firstpage... if (hasFirstPage) { FirstPage.Serialize(serializer, "Firstpage"); } if (hasLastPage) { LastPage.Serialize(serializer, "Lastpage"); } }
public void DeleteRecords() { //go to the last page and click Thread.Sleep(1000); LastPage.Click(); Thread.Sleep(1500); //get the maxmun value of the page: //get the text of ul string pageNumber = PageNumber.Text; //split pageNumber into string arr string[] arrPage = pageNumber.Split(Environment.NewLine.ToCharArray()); //browser each page from last page to the first page for (int i = 1; i < int.Parse(arrPage[arrPage.Length - 1]); i++) { //the current page number int pageNow = int.Parse(arrPage[arrPage.Length - 1]) - i + 1; Thread.Sleep(1000); //get the table and tr location var trs = Table.FindElements(By.TagName("tr")); // go through all the tr in table foreach (var tr in trs) { Thread.Sleep(1000); //get td in this tr var tds = tr.FindElements(By.TagName("td")); //get the text of each td and conpare to what you want foreach (var td in tds) { string tdString = td.Text; //find the record row if (tdString == Properties.code) { //click and the alert shows up 相对路径 tr.FindElement(By.XPath(".//td[5]/a[2]")).Click(); //move to alert IAlert iAlert = Properties.driver.SwitchTo().Alert(); //click OK iAlert.Accept(); Console.WriteLine("Delete" + pageNow); Thread.Sleep(1000); return; } } } //go to the previous page PreviousPage.Click(); } }
public void InitPageInfo() { lblPageCount.Text = LastPage.ToString(); lblPageIndex.Text = (CurrentPage).ToString(); txtNewPageIndex.Text = (CurrentPage).ToString(); btnFirst.Enabled = (CurrentPage == 1 ? false : true); btnPrev.Enabled = (CurrentPage == 1 ? false : true); btnLast.Enabled = (CurrentPage == LastPage ? false : true); btnNext.Enabled = (CurrentPage == LastPage ? false : true); }
public void PicksMaxPageBasedOnTopAndTotalCountSupplied(int totalCount, int top, int minPageCount, int expectedLastPage) { int actualLastPage = new LastPage(totalCount, top, minPageCount); actualLastPage .Should() .Be(expectedLastPage); }
private void GetPreviousPage() { if (PageIndex == 1) { PageIndex = LastPage; } else { PageIndex--; } LoadData(); Pagination = PageIndex.ToString() + "/" + LastPage.ToString(); }
private void GetNextPage() { if (PageIndex == LastPage) { PageIndex = 1; } else { PageIndex++; } LoadData(); Pagination = PageIndex.ToString() + "/" + LastPage.ToString(); }
public void CheckRecords() { //go to the last page and click Thread.Sleep(1000); LastPage.Click(); Thread.Sleep(1500); //get the maxmun value of the page: //get the text of ul string pageNumber = PageNumber.Text; //split pageNumber into string arr string[] arrPage = pageNumber.Split(Environment.NewLine.ToCharArray()); //browser each page from last page to the first page for (int i = 1; i < int.Parse(arrPage[arrPage.Length - 1]); i++) { //the current page number int pageNow = int.Parse(arrPage[arrPage.Length - 1]) - i + 1; Thread.Sleep(1000); //get the table and tr location var trs = Table.FindElements(By.TagName("tr")); // go through all the tr in table foreach (var tr in trs) { //get td in this tr var tds = tr.FindElements(By.TagName("td")); //get the text of each td and conpare to what you want foreach (var td in tds) { string tdString = td.Text; if (tdString == Properties.code) { Console.WriteLine("PASS----Find the input Code on page :" + pageNow); } } } //go to the previous page PreviousPage.Click(); } }
/// <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) )); }
public CapQuyenHoiNghiViewModel(HOINGHI HoiNghi, String type) { this.HoiNghi = HoiNghi; this.LoaiAdmin = type; this.PageIndex = 1; using (DBQuanLiHoiNghiEntities db = new DBQuanLiHoiNghiEntities()) { float count = db.USERs.Where(u => u.LOAIUSER.Equals("1")).Count(); LastPage = (int)Math.Ceiling(count / USER_PER_PAGE); Pagination = PageIndex.ToString() + "/" + LastPage.ToString(); } this.ListCapQuyenUser = new ObservableCollection <CapQuyenUser>(); LoadData(); PreviousPageCommand = new RelayCommand(GetPreviousPage); NextPageCommand = new RelayCommand(GetNextPage); }
private void ComputePages() { Pages.Clear(); bool leftDotPage = false; bool rightDotPage = false; if (LastPage > 15) { rightDotPage = true; } // если страниц меньше чем 15(вкл) или текущая страница меньше 8(вкл), то покажем все начальные страницы if (LastPage <= 15) { for (int i = 1; i <= LastPage; i++) { Pages.Add(new Page { Value = i, Caption = i.ToString(), IsCurrenPage = i == CurrentPage, RouteValues = Merge(new Dictionary <string, object> { { "controller", ControllerName }, { "action", ActionName }, { "Page", i } }, RouteParams, Params) }); } } else if (CurrentPage <= 8) { for (int i = 1; i <= 15; i++) { Pages.Add(new Page { Value = i, Caption = i.ToString(), IsCurrenPage = i == CurrentPage, RouteValues = Merge(new Dictionary <string, object> { { "controller", ControllerName }, { "action", ActionName }, { "Page", i } }, RouteParams, Params) }); } } // иначе сдвигаем страницы на разницу текущей страницы от 8 else { leftDotPage = true; int n = LastPage - 15; // количество позиций на которые можно сдвинуть влево int c = CurrentPage - 8; // количество позиций относительно текущей страницы if (c > n) { c = n; rightDotPage = false; } for (int i = 1 + c, l = c + 15; i <= l; i++) { Pages.Add(new Page { Value = i, Caption = i.ToString(), IsCurrenPage = i == CurrentPage, RouteValues = Merge(new Dictionary <string, object> { { "controller", ControllerName }, { "action", ActionName }, { "Page", i } }, RouteParams, Params) }); } } // если не нужно показывать первые и последние страницы, то покажем просто точки. Картина будет такая: // ____ ___ ___ ___ ___ ____ // | .. | 6 | 7 | 8 | 9 | .. | // if (!ShowLastAndFirstPages) { for (var i = 0; i < Pages.Count; i++) { if (i == 0 && leftDotPage || i == 14 && rightDotPage) { Pages[i].Caption = ".."; } } } // если нужно показывать первые и последние страницы, то покажем 1, 2, предпоследнюю и последнюю страницы. То есть картина будет такая: // ___ ___ ____ ___ ___ ___ ___ ____ ____ ____ // | 1 | 2 | .. | 6 | 7 | 8 | 9 | .. | 14 | 15 | // else { for (var i = 0; i < Pages.Count; i++) { if (i <= 2 && leftDotPage) { if (i == 0) { Pages[i].Caption = "1"; Pages[i].Value = 1; Pages[i].RouteValues = Merge(new Dictionary <string, object> { { "controller", ControllerName }, { "action", ActionName }, { "Page", 1 } }, RouteParams, Params); } else if (i == 1) { Pages[i].Caption = "2"; Pages[i].Value = 2; Pages[i].RouteValues = Merge(new Dictionary <string, object> { { "controller", ControllerName }, { "action", ActionName }, { "Page", 2 } }, RouteParams, Params); } else if (i == 2) { Pages[i].Caption = ".."; } } else if (i >= 12 && rightDotPage) { if (i == 14) { Pages[i].Caption = LastPage.ToString(); Pages[i].Value = LastPage; Pages[i].RouteValues = Merge(new Dictionary <string, object> { { "controller", ControllerName }, { "action", ActionName }, { "Page", LastPage } }, RouteParams, Params); } else if (i == 13) { Pages[i].Caption = (LastPage - 1).ToString(); Pages[i].Value = LastPage - 1; Pages[i].RouteValues = Merge(new Dictionary <string, object> { { "controller", ControllerName }, { "action", ActionName }, { "Page", LastPage - 1 } }, RouteParams, Params); } else if (i == 12) { Pages[i].Caption = ".."; } } } } // добавим предыдущую и следующую странцы. Получится картина такая: // ____ ___ ___ ____ ___ ___ ___ ___ ____ ____ ____ ____ // | << | 1 | 2 | .. | 6 | 7 | 8 | 9 | .. | 14 | 15 | >> | // PrevPage = CurrentPage - 1; if (PrevPage <= 0) { PrevPage = 1; } Pages.Insert(0, new Page { Value = PrevPage, Caption = "«", Disabled = PrevPage == CurrentPage, RouteValues = Merge(new Dictionary <string, object> { { "controller", ControllerName }, { "action", ActionName }, { "Page", PrevPage } }, RouteParams, Params) }); NextPage = CurrentPage + 1; if (NextPage >= LastPage) { NextPage = LastPage; } Pages.Add(new Page { Value = NextPage, Caption = "»", Disabled = NextPage == LastPage, RouteValues = Merge(new Dictionary <string, object> { { "controller", ControllerName }, { "action", ActionName }, { "Page", NextPage } }, RouteParams, Params) }); }
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); }
private static void DrawLGSGChooseGame(FF8String topright, FF8String help) { Rectangle dst = new Rectangle { X = (int)(vp_per.X * 0.171875f), Y = (int)(vp_per.Y * 0.266666666666667f), Width = (int)(vp_per.X * 0.65625f), Height = (int)(vp_per.Y * 0.6625f), }; DrawLGSGHeader(strLoadScreen[Litems.GameFolderSlot1 + SlotLoc].Text, topright, help); if (LastPage == null || LastPage.IsDisposed) { Entry e = Memory.Icons.GetEntry(Icons.ID.Arrow_Left); Rectangle arrow = new Rectangle { X = (int)(dst.X - ((e.Width - 2) * 3f)), Y = (dst.Y + dst.Height / 2) }; Memory.Icons.Draw(Icons.ID.Arrow_Left, 1, arrow, new Vector2(3f), fade); Memory.Icons.Draw(Icons.ID.Arrow_Left, 2, arrow, new Vector2(3f), fade * blink_Amount); arrow = new Rectangle { X = (int)((dst.X + dst.Width) + -2 * 3f), Y = arrow.Y }; Memory.Icons.Draw(Icons.ID.Arrow_Right2, 1, arrow, new Vector2(3f), fade); Memory.Icons.Draw(Icons.ID.Arrow_Right2, 2, arrow, new Vector2(3f), fade * blink_Amount); } float speed = .17f; if (OffScreenBuffer != null && !OffScreenBuffer.IsDisposed) { dst.Location = (dst.Location.ToVector2()).ToPoint(); PageTarget = dst.Location.ToVector2(); dst.Size = (dst.Size.ToVector2()).ToPoint(); PageSize = dst.Size.ToVector2(); CurrentPageLoc = CurrentPageLoc == Vector2.Zero ? PageTarget : Vector2.SmoothStep(CurrentPageLoc, PageTarget, speed).FloorOrCeiling(PageTarget); dst.Location = CurrentPageLoc.RoundedPoint(); Memory.spriteBatch.Draw(OffScreenBuffer, dst, Color.White * fade); } if (LastPage != null && !LastPage.IsDisposed) { CurrentLastPageLoc = CurrentLastPageLoc == Vector2.Zero ? PageTarget : Vector2.SmoothStep(CurrentLastPageLoc, LastPageTarget, speed).FloorOrCeiling(LastPageTarget); if (LastPageTarget == CurrentLastPageLoc) { LastPage.Dispose(); CurrentLastPageLoc = Vector2.Zero; } else { dst.Location = CurrentLastPageLoc.RoundedPoint(); Memory.spriteBatch.Draw(LastPage, dst, Color.White * fade); } } else //if(BlockLocs[BlockLoc] != null) { Point ptr = BlockLocs[BlockLoc].Item2; DrawPointer(ptr); } }
internal void FireLastPage() => LastPage?.Invoke(this, EventArgs.Empty);
/// <summary> /// last page /// </summary> public void SelectLastPage() { LastPage.Click(); }