PageRenderTime 46ms CodeModel.GetById 13ms RepoModel.GetById 0ms app.codeStats 0ms

/mojoPortal.Web.Controls/DatePicker/jsCalendarDatePickerAdapter.cs

#
C# | 181 lines | 131 code | 34 blank | 16 comment | 0 complexity | c6fb8427791007a9e976e480be8308df MD5 | raw file
Possible License(s): LGPL-2.1, Apache-2.0, BSD-3-Clause, CPL-1.0, CC-BY-SA-3.0, GPL-2.0
  1. // Author: Joe Audette
  2. // Created: 2007-11-07
  3. // Last Modified: 2011-08-15
  4. //
  5. // Licensed under the terms of the GNU Lesser General Public License:
  6. // http://www.opensource.org/licenses/lgpl-license.php
  7. //
  8. // You must not remove this notice, or any other, from this software.
  9. //
  10. using System;
  11. using System.Collections.Generic;
  12. using System.Text;
  13. using System.Web.UI;
  14. using System.Web.UI.WebControls;
  15. using mojoPortal.Web.Controls;
  16. namespace mojoPortal.Web.Controls.DatePicker
  17. {
  18. public class jsCalendarDatePickerAdapter : IDatePicker
  19. {
  20. private jsCalendarDatePicker control;
  21. #region Constructors
  22. public jsCalendarDatePickerAdapter()
  23. {
  24. InitializeAdapter();
  25. }
  26. #endregion
  27. public string ControlID
  28. {
  29. get
  30. {
  31. return control.ID;
  32. }
  33. set
  34. {
  35. control.ID = value;
  36. }
  37. }
  38. public string Text
  39. {
  40. get
  41. {
  42. return control.Text;
  43. }
  44. set
  45. {
  46. control.Text = value;
  47. }
  48. }
  49. public string ButtonImageUrl
  50. {
  51. get
  52. {
  53. return control.ButtonImageUrl;
  54. }
  55. set
  56. {
  57. control.ButtonImageUrl = value;
  58. }
  59. }
  60. public Unit Width
  61. {
  62. get
  63. {
  64. return control.Width;
  65. }
  66. set
  67. {
  68. control.Width = value;
  69. }
  70. }
  71. public bool ShowTime
  72. {
  73. get
  74. {
  75. return control.ShowTime;
  76. }
  77. set
  78. {
  79. control.ShowTime = value;
  80. }
  81. }
  82. public string ClockHours
  83. {
  84. get
  85. {
  86. return control.ClockHours;
  87. }
  88. set
  89. {
  90. control.ClockHours = value;
  91. }
  92. }
  93. // *** added by ghalib ghniem Aug-14-2011 ChangeMonth: bool ,ChangeYear: bool, YearRange: string
  94. // notes by Joe Audette
  95. // these are added only becuase we must support all properties of IDataPicker
  96. // but these properties are not used in this datepicker, they are used in the jQueryUI datepicker
  97. private bool showMonthList = false;
  98. public bool ShowMonthList
  99. {
  100. get { return showMonthList; }
  101. set { showMonthList = value; }
  102. }
  103. private bool showYearList = false;
  104. public bool ShowYearList
  105. {
  106. get { return showYearList; }
  107. set { showYearList = value; }
  108. }
  109. private string yearRange = string.Empty;
  110. public string YearRange
  111. {
  112. get { return yearRange; }
  113. set { yearRange = value; }
  114. }
  115. // not really implemented in this datepicker but needed to support chanfges in IDatePicker so we can use more of jQuery Datepicker features
  116. private string calculateWeek = string.Empty;
  117. public string CalculateWeek
  118. {
  119. get { return calculateWeek; }
  120. set { calculateWeek = value; }
  121. }
  122. // not really implemented in this datepicker but needed to support chanfges in IDatePicker so we can use more of jQuery Datepicker features
  123. private int firstDay = -1; //-1 mean use default don't set it by script
  124. public int FirstDay
  125. {
  126. get { return firstDay; }
  127. set { firstDay = value; }
  128. }
  129. // not really implemented in this datepicker but needed to support chanfges in IDatePicker so we can use more of jQuery Datepicker features
  130. private bool showWeek = false;
  131. public bool ShowWeek
  132. {
  133. get { return showWeek; }
  134. set { showWeek = value; }
  135. }
  136. private void InitializeAdapter()
  137. {
  138. control = new jsCalendarDatePicker();
  139. }
  140. #region Public Methods
  141. public Control GetControl()
  142. {
  143. return control;
  144. }
  145. #endregion
  146. }
  147. }