DataList.cs 3.2 KB

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