List.cs 5.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279
  1. /**
  2. * Project : Mono
  3. * Namespace : System.Web.UI.MobileControls
  4. * Class : List
  5. * Author : Gaurav Vaish
  6. *
  7. * Copyright : 2003 with Gaurav Vaish, and with
  8. * Ximian Inc
  9. */
  10. using System.Collections;
  11. using System.Web.UI;
  12. using System.Web.Mobile;
  13. namespace System.Web.UI.MobileControls
  14. {
  15. public class List : PagedControl, INamingContainer, IListControl,
  16. ITemplateable, IPostBackEventHandler
  17. {
  18. private static readonly object ItemDataBindEvent = new object();
  19. private static readonly object ItemCommandEvent = new object();
  20. private ListDecoration decoration = ListDecoration.None;
  21. public List()
  22. {
  23. }
  24. public event ListCommandEventHandler ItemCommand
  25. {
  26. add
  27. {
  28. Events.AddHandler(ItemCommandEvent, value);
  29. }
  30. remove
  31. {
  32. Events.RemoveHandler(ItemCommandEvent, value);
  33. }
  34. }
  35. public event ListDataBindEventHandler ItemDataBind
  36. {
  37. add
  38. {
  39. Events.AddHandler(ItemDataBindEvent, value);
  40. }
  41. remove
  42. {
  43. Events.RemoveHandler(ItemDataBindEvent, value);
  44. }
  45. }
  46. private void CreateChildControls(bool doDataBind)
  47. {
  48. if(IsTemplated)
  49. {
  50. throw new NotImplementedException();
  51. }
  52. ChildControlsCreated = true;
  53. }
  54. public virtual string DataMember
  55. {
  56. get
  57. {
  58. throw new NotImplementedException();
  59. }
  60. set
  61. {
  62. throw new NotImplementedException();
  63. }
  64. }
  65. public virtual object DataSource
  66. {
  67. get
  68. {
  69. throw new NotImplementedException();
  70. }
  71. set
  72. {
  73. throw new NotImplementedException();
  74. }
  75. }
  76. public string DataTextField
  77. {
  78. get
  79. {
  80. throw new NotImplementedException();
  81. }
  82. set
  83. {
  84. throw new NotImplementedException();
  85. }
  86. }
  87. public string DataValueField
  88. {
  89. get
  90. {
  91. throw new NotImplementedException();
  92. }
  93. set
  94. {
  95. throw new NotImplementedException();
  96. }
  97. }
  98. public ListDecoration Decoration
  99. {
  100. get
  101. {
  102. return decoration;
  103. }
  104. set
  105. {
  106. decoration = value;
  107. }
  108. }
  109. public bool HasItemCommandHandler
  110. {
  111. get
  112. {
  113. return (Events[ItemCommandEvent] != null);
  114. }
  115. }
  116. protected override int InternalItemCount
  117. {
  118. get
  119. {
  120. throw new NotImplementedException();
  121. }
  122. }
  123. public MobileListItemCollection Items
  124. {
  125. get
  126. {
  127. throw new NotImplementedException();
  128. }
  129. }
  130. public bool ItemsAsLinks
  131. {
  132. get
  133. {
  134. throw new NotImplementedException();
  135. }
  136. set
  137. {
  138. throw new NotImplementedException();
  139. }
  140. }
  141. private void CreateControlItem(MobileListItemType itemType,
  142. ITemplate itemTemplate, bool doDataBind)
  143. {
  144. // Create control.
  145. // Add control at the end of this "List".
  146. throw new NotImplementedException();
  147. }
  148. private int TranslateVirtualItemIndex(int itemIndex)
  149. {
  150. throw new NotImplementedException();
  151. }
  152. protected override void AddParsedSubObject(object obj)
  153. {
  154. if(obj is LiteralControl || obj is MobileControl)
  155. {
  156. throw new NotImplementedException();
  157. }
  158. }
  159. protected override void CreateChildControls()
  160. {
  161. CreateChildControls(true);
  162. }
  163. protected virtual void CreateItems(IEnumerable dataSource)
  164. {
  165. throw new NotImplementedException();
  166. }
  167. protected override void LoadViewState(object state)
  168. {
  169. throw new NotImplementedException();
  170. }
  171. protected override bool OnBubbleEvent(object sender, EventArgs e)
  172. {
  173. if(e is ListCommandEventArgs)
  174. {
  175. OnItemCommand((ListCommandEventArgs)e);
  176. return true;
  177. }
  178. return false;
  179. }
  180. protected override void OnDataBinding(EventArgs e)
  181. {
  182. base.OnDataBinding(e);
  183. throw new NotImplementedException();
  184. }
  185. protected void OnItemDataBind(ListDataBindEventArgs e)
  186. {
  187. ListDataBindEventHandler ldbeh = (ListDataBindEventHandler)(Events[ItemDataBindEvent]);
  188. if(ldbeh != null)
  189. ldbeh(this, e);
  190. }
  191. protected virtual void OnItemCommand(ListCommandEventArgs e)
  192. {
  193. ListCommandEventHandler lceh = (ListCommandEventHandler)(Events[ItemCommandEvent]);
  194. if(lceh != null)
  195. lceh(this, e);
  196. }
  197. protected override void OnLoadItems(LoadItemsEventArgs e)
  198. {
  199. throw new NotImplementedException();
  200. }
  201. protected override void OnPageChange(int oldPageIndex,
  202. int newPageIndex)
  203. {
  204. base.OnPageChange(oldPageIndex, newPageIndex);
  205. throw new NotImplementedException();
  206. }
  207. protected override void OnPreRender(EventArgs e)
  208. {
  209. throw new NotImplementedException();
  210. }
  211. protected override object SaveViewState()
  212. {
  213. throw new NotImplementedException();
  214. }
  215. protected override void TrackViewState()
  216. {
  217. throw new NotImplementedException();
  218. }
  219. public override void CreateDefaultTemplatedUI(bool doDataBind)
  220. {
  221. throw new NotImplementedException();
  222. }
  223. public override void EnsureTemplatedUI()
  224. {
  225. EnsureChildControls();
  226. }
  227. void IPostBackEventHandler.RaisePostBackEvent(string eventArgument)
  228. {
  229. throw new NotImplementedException();
  230. }
  231. void IListControl.OnItemDataBind(ListDataBindEventArgs e)
  232. {
  233. OnItemDataBind(e);
  234. }
  235. bool IListControl.TrackingViewState
  236. {
  237. get
  238. {
  239. return IsTrackingViewState;
  240. }
  241. }
  242. }
  243. }