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