PageItem.cs 1.7 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768
  1. namespace GDNXFD.Alert.Config.Model
  2. {
  3. using System;
  4. /// <summary>
  5. /// Page item class
  6. /// </summary>
  7. public class PageItem
  8. {
  9. private string page;
  10. private bool isCurrentPage;
  11. private bool isClickable;
  12. /// <summary>
  13. /// Constructor
  14. /// </summary>
  15. /// <param name="page">Number of page</param>
  16. /// <param name="isCurrentPage">Is current page</param>
  17. /// <param name="isClickable">Is clickable page</param>
  18. public PageItem(string page, bool isCurrentPage, bool isClickable)
  19. {
  20. this.page = page;
  21. this.isCurrentPage = isCurrentPage;
  22. this.isClickable = isClickable;
  23. }
  24. /// <summary>
  25. /// Number of page.
  26. /// </summary>
  27. public string Page
  28. {
  29. get { return this.page; }
  30. set { this.page = value; }
  31. }
  32. /// <summary>
  33. /// Is current page.
  34. /// </summary>
  35. public bool IsCurrentPage
  36. {
  37. get { return this.isCurrentPage; }
  38. set
  39. {
  40. this.isCurrentPage = value;
  41. if (value)
  42. {
  43. var tmp = PageSelected;
  44. if (tmp != null)
  45. tmp(this, new EventArgs());
  46. }
  47. }
  48. }
  49. /// <summary>
  50. /// Is clickable.
  51. /// </summary>
  52. public bool IsClickable
  53. {
  54. get { return this.isClickable; }
  55. set { this.isClickable = value; }
  56. }
  57. /// <summary>
  58. /// Page selected event.
  59. /// </summary>
  60. public event EventHandler PageSelected;
  61. }
  62. }