List.cs 6.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300
  1. //
  2. // Permission is hereby granted, free of charge, to any person obtaining
  3. // a copy of this software and associated documentation files (the
  4. // "Software"), to deal in the Software without restriction, including
  5. // without limitation the rights to use, copy, modify, merge, publish,
  6. // distribute, sublicense, and/or sell copies of the Software, and to
  7. // permit persons to whom the Software is furnished to do so, subject to
  8. // the following conditions:
  9. //
  10. // The above copyright notice and this permission notice shall be
  11. // included in all copies or substantial portions of the Software.
  12. //
  13. // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
  14. // EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
  15. // MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
  16. // NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
  17. // LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
  18. // OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
  19. // WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
  20. //
  21. /**
  22. * Project : Mono
  23. * Namespace : System.Web.UI.MobileControls
  24. * Class : List
  25. * Author : Gaurav Vaish
  26. *
  27. * Copyright : 2003 with Gaurav Vaish, and with
  28. * Ximian Inc
  29. */
  30. using System.Collections;
  31. using System.Web.UI;
  32. using System.Web.Mobile;
  33. namespace System.Web.UI.MobileControls
  34. {
  35. public class List : PagedControl, INamingContainer, IListControl,
  36. ITemplateable, IPostBackEventHandler
  37. {
  38. private static readonly object ItemDataBindEvent = new object();
  39. private static readonly object ItemCommandEvent = new object();
  40. private ListDecoration decoration = ListDecoration.None;
  41. public List()
  42. {
  43. }
  44. public event ListCommandEventHandler ItemCommand
  45. {
  46. add
  47. {
  48. Events.AddHandler(ItemCommandEvent, value);
  49. }
  50. remove
  51. {
  52. Events.RemoveHandler(ItemCommandEvent, value);
  53. }
  54. }
  55. public event ListDataBindEventHandler ItemDataBind
  56. {
  57. add
  58. {
  59. Events.AddHandler(ItemDataBindEvent, value);
  60. }
  61. remove
  62. {
  63. Events.RemoveHandler(ItemDataBindEvent, value);
  64. }
  65. }
  66. private void CreateChildControls(bool doDataBind)
  67. {
  68. if(IsTemplated)
  69. {
  70. throw new NotImplementedException();
  71. }
  72. ChildControlsCreated = true;
  73. }
  74. public virtual string DataMember
  75. {
  76. get
  77. {
  78. throw new NotImplementedException();
  79. }
  80. set
  81. {
  82. throw new NotImplementedException();
  83. }
  84. }
  85. public virtual object DataSource
  86. {
  87. get
  88. {
  89. throw new NotImplementedException();
  90. }
  91. set
  92. {
  93. throw new NotImplementedException();
  94. }
  95. }
  96. public string DataTextField
  97. {
  98. get
  99. {
  100. throw new NotImplementedException();
  101. }
  102. set
  103. {
  104. throw new NotImplementedException();
  105. }
  106. }
  107. public string DataValueField
  108. {
  109. get
  110. {
  111. throw new NotImplementedException();
  112. }
  113. set
  114. {
  115. throw new NotImplementedException();
  116. }
  117. }
  118. public ListDecoration Decoration
  119. {
  120. get
  121. {
  122. return decoration;
  123. }
  124. set
  125. {
  126. decoration = value;
  127. }
  128. }
  129. public bool HasItemCommandHandler
  130. {
  131. get
  132. {
  133. return (Events[ItemCommandEvent] != null);
  134. }
  135. }
  136. protected override int InternalItemCount
  137. {
  138. get
  139. {
  140. throw new NotImplementedException();
  141. }
  142. }
  143. public MobileListItemCollection Items
  144. {
  145. get
  146. {
  147. throw new NotImplementedException();
  148. }
  149. }
  150. public bool ItemsAsLinks
  151. {
  152. get
  153. {
  154. throw new NotImplementedException();
  155. }
  156. set
  157. {
  158. throw new NotImplementedException();
  159. }
  160. }
  161. private void CreateControlItem(MobileListItemType itemType,
  162. ITemplate itemTemplate, bool doDataBind)
  163. {
  164. // Create control.
  165. // Add control at the end of this "List".
  166. throw new NotImplementedException();
  167. }
  168. private int TranslateVirtualItemIndex(int itemIndex)
  169. {
  170. throw new NotImplementedException();
  171. }
  172. protected override void AddParsedSubObject(object obj)
  173. {
  174. if(obj is LiteralControl || obj is MobileControl)
  175. {
  176. throw new NotImplementedException();
  177. }
  178. }
  179. protected override void CreateChildControls()
  180. {
  181. CreateChildControls(true);
  182. }
  183. protected virtual void CreateItems(IEnumerable dataSource)
  184. {
  185. throw new NotImplementedException();
  186. }
  187. protected override void LoadViewState(object state)
  188. {
  189. throw new NotImplementedException();
  190. }
  191. protected override bool OnBubbleEvent(object sender, EventArgs e)
  192. {
  193. if(e is ListCommandEventArgs)
  194. {
  195. OnItemCommand((ListCommandEventArgs)e);
  196. return true;
  197. }
  198. return false;
  199. }
  200. protected override void OnDataBinding(EventArgs e)
  201. {
  202. base.OnDataBinding(e);
  203. throw new NotImplementedException();
  204. }
  205. protected void OnItemDataBind(ListDataBindEventArgs e)
  206. {
  207. ListDataBindEventHandler ldbeh = (ListDataBindEventHandler)(Events[ItemDataBindEvent]);
  208. if(ldbeh != null)
  209. ldbeh(this, e);
  210. }
  211. protected virtual void OnItemCommand(ListCommandEventArgs e)
  212. {
  213. ListCommandEventHandler lceh = (ListCommandEventHandler)(Events[ItemCommandEvent]);
  214. if(lceh != null)
  215. lceh(this, e);
  216. }
  217. protected override void OnLoadItems(LoadItemsEventArgs e)
  218. {
  219. throw new NotImplementedException();
  220. }
  221. protected override void OnPageChange(int oldPageIndex,
  222. int newPageIndex)
  223. {
  224. base.OnPageChange(oldPageIndex, newPageIndex);
  225. throw new NotImplementedException();
  226. }
  227. protected override void OnPreRender(EventArgs e)
  228. {
  229. throw new NotImplementedException();
  230. }
  231. protected override object SaveViewState()
  232. {
  233. throw new NotImplementedException();
  234. }
  235. protected override void TrackViewState()
  236. {
  237. throw new NotImplementedException();
  238. }
  239. public override void CreateDefaultTemplatedUI(bool doDataBind)
  240. {
  241. throw new NotImplementedException();
  242. }
  243. public override void EnsureTemplatedUI()
  244. {
  245. EnsureChildControls();
  246. }
  247. void IPostBackEventHandler.RaisePostBackEvent(string eventArgument)
  248. {
  249. throw new NotImplementedException();
  250. }
  251. void IListControl.OnItemDataBind(ListDataBindEventArgs e)
  252. {
  253. OnItemDataBind(e);
  254. }
  255. bool IListControl.TrackingViewState
  256. {
  257. get
  258. {
  259. return IsTrackingViewState;
  260. }
  261. }
  262. }
  263. }