Paradox Game Engine  v1.0.0 beta06
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Events Macros Pages
SectionAdapter.cs
Go to the documentation of this file.
1 using System;
2 using System.Collections.Generic;
3 using System.Linq;
4 using System.Text;
5 
6 using Android.App;
7 using Android.Content;
8 using Android.OS;
9 using Android.Runtime;
10 using Android.Views;
11 using Android.Widget;
12 
13 namespace MonoDroid.Dialog
14 {
15  public class SectionAdapter : BaseAdapter<Element>
16  {
17  public SectionAdapter (Section section)
18  {
19  this.Section = section;
20  }
21 
22  public Context Context { get; set; }
23 
24  public Section Section { get; private set; }
25 
26  public override int Count {
27  get { return this.Section.Elements.Count; }
28  }
29 
30  public override Element this [int position] {
31  get {
32  return Section.Elements [position];
33  }
34  }
35 
36  public override int ViewTypeCount {
37  get { return this.Section.ElementViewTypeCount; }
38  }
39 
40  public override int GetItemViewType (int position)
41  {
42  return this.Section.GetElementViewType (this [position]);
43  }
44 
45  public override long GetItemId (int position)
46  {
47  return position;
48  }
49 
50  public override View GetView (int position, View convertView, ViewGroup parent)
51  {
52  var element = Section.Elements [position];
53  var view = element.GetView (this.Context, convertView, parent);
54 
55  return view;
56  }
57  }
58 }
override View GetView(int position, View convertView, ViewGroup parent)
Sections contain individual Element instances that are rendered by MonoDroid.Dialog ...
Definition: Section.cs:28
override long GetItemId(int position)
override int GetItemViewType(int position)