DataList.cs 3.1 KB

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