DataList.cs 3.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164
  1. /**
  2. * Namespace: System.Web.UI.WebControls
  3. * Class: DataList
  4. *
  5. * Author: Gaurav Vaish
  6. * Contact: <[email protected]>, <[email protected]>
  7. * Status: 20%
  8. *
  9. * (C) Gaurav Vaish (2001)
  10. */
  11. using System;
  12. using System.Web;
  13. using System.Web.UI;
  14. namespace System.Web.UI.WebControls
  15. {
  16. public class DataList: BaseDataList, INamingContainer, IRepeatInfoUser
  17. {
  18. //
  19. public const string CancelCommandName = "Cancel";
  20. public const string DeleteCommandName = "Delete";
  21. public const string EditCommandName = "Edit";
  22. public const string SelectCommandName = "Select";
  23. public const string UpdateCommandName = "Update";
  24. //TODO: From where will I update the values of the following ItemStyles?
  25. private TableItemStyle alternatingItemStyle;
  26. private TableItemStyle editItemStyle;
  27. private TableItemStyle footerStyle;
  28. private ITemplate alternatingItemTemplate;
  29. private ITemplate editItemTemplate;
  30. private ITemplate footerTemplate;
  31. private int editItemIndex;
  32. private bool extractTemplateRows;
  33. public DataList()
  34. {
  35. alternatingItemStyle = new TableItemStyle();
  36. editItemStyle = new TableItemStyle();
  37. footerStyle = new TableItemStyle();
  38. alternatingItemTemplate = null;
  39. editItemTemplate = null;
  40. footerTemplate = null;
  41. extractTemplateRows = false;
  42. }
  43. public virtual TableItemStyle AlternatingItemStyle
  44. {
  45. get
  46. {
  47. return alternatingItemStyle;
  48. }
  49. }
  50. public virtual ITemplate AlternatingItemTemplate
  51. {
  52. get
  53. {
  54. return alternatingItemTemplate;
  55. }
  56. set
  57. {
  58. alternatingItemTemplate = value;
  59. }
  60. }
  61. public virtual int EditItemIndex
  62. {
  63. get
  64. {
  65. return editItemIndex;
  66. }
  67. set
  68. {
  69. editItemIndex = value;
  70. }
  71. }
  72. public virtual TableItemStyle EditItemStyle
  73. {
  74. get
  75. {
  76. return editItemStyle;
  77. }
  78. set
  79. {
  80. editItemStyle = value;
  81. }
  82. }
  83. public virtual ITemplate EditItemTemplate
  84. {
  85. get
  86. {
  87. return editItemTemplate;
  88. }
  89. set
  90. {
  91. editItemTemplate = value;
  92. }
  93. }
  94. public virtual bool ExtractTemplateRows
  95. {
  96. get
  97. {
  98. return extractTemplateRows;
  99. }
  100. set
  101. {
  102. extractTemplateRows = value;
  103. }
  104. }
  105. public virtual TableItemStyle FooterStyle
  106. {
  107. get
  108. {
  109. return footerStyle;
  110. }
  111. }
  112. public virtual ITemplate FooterTemplate
  113. {
  114. get
  115. {
  116. return footerTemplate;
  117. }
  118. set
  119. {
  120. footerTemplate = value;
  121. }
  122. }
  123. //TODO: To implement the following functions found in the BaseDataList abstract class
  124. /*
  125. * PrepareControlHierarchy()
  126. * CreateControlHeirarchy(bool)
  127. */
  128. public void CreateControlHierarchy(bool create)
  129. {
  130. //TODO: THE LOST WORLD
  131. // Put here to get compilation going
  132. }
  133. //Impemented methods/properties of IRepeatInfoUser
  134. //TODO: Check all these implementations are valid or a total absurd
  135. public bool HasFooter
  136. {
  137. get
  138. {
  139. if(footerTemplate!=null)
  140. return true;
  141. return false;
  142. }
  143. }
  144. }
  145. }