BaseDataList.cs 2.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146
  1. /**
  2. * Namespace: System.Web.UI.WebControls
  3. * Class: BaseDataList
  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 abstract class BaseDataList: WebControl
  17. {
  18. private int cellPadding = -1;
  19. private int cellSpacing = 0;
  20. private object dataSource = null;
  21. private string dataKeyField = String.Empty;
  22. private DataKeyCollection dataKeys; // TODO: From where do get the values into it?
  23. private string dataMember = String.Empty;
  24. private GridLines gridLines = GridLines.Both;
  25. private HorizontalAlign hAlign = HorizontalAlign.NotSet;
  26. public BaseDataList()
  27. {
  28. // TODO Something
  29. }
  30. public static bool IsBindableType(Type type)
  31. {
  32. //TODO: To see what has to be here
  33. return false; //for the time being, to be able to make it compile
  34. }
  35. public virtual int CellPadding
  36. {
  37. get
  38. {
  39. return cellPadding;
  40. }
  41. set
  42. {
  43. cellPadding = value;
  44. }
  45. }
  46. public virtual int CellSpacing
  47. {
  48. get
  49. {
  50. return cellSpacing;
  51. }
  52. set
  53. {
  54. cellSpacing = value;
  55. }
  56. }
  57. public virtual string DataKeyField
  58. {
  59. get
  60. {
  61. return dataKeyField;
  62. }
  63. set
  64. {
  65. dataKeyField = value;
  66. }
  67. }
  68. public DataKeysCollection DataKeys
  69. {
  70. get
  71. {
  72. return dataKeys;
  73. }
  74. }
  75. public string DataMember
  76. {
  77. get
  78. {
  79. return dataMember;
  80. }
  81. set
  82. {
  83. dataMember = value;
  84. }
  85. }
  86. public virtual object DataSource
  87. {
  88. get
  89. {
  90. return dataSource;
  91. }
  92. set
  93. {
  94. dataSource = value;
  95. }
  96. }
  97. public virtual GridLines GridLines
  98. {
  99. get
  100. {
  101. return gridLines;
  102. }
  103. set
  104. {
  105. gridLines = value;
  106. }
  107. }
  108. public virtual HorizontalAlign HorizontalAlign
  109. {
  110. get
  111. {
  112. return hAlign;
  113. }
  114. set
  115. {
  116. hAlign = value;
  117. }
  118. }
  119. public override void DataBind()
  120. {
  121. // TODO: have to write the implementation
  122. // I am not sure of whether it will be of any use here since
  123. // I am an abstract class, and have no identity of myself.
  124. }
  125. //TODO: Check - where are the following abstract methods?
  126. /*
  127. * CreateControlHierarchy(bool)
  128. * PrepareControlHierarchy()
  129. */
  130. }
  131. }