mirror of
https://github.com/mgroves/MonodroidStockPortfolio.git
synced 2024-12-26 11:19:24 +00:00
29 lines
712 B
C#
29 lines
712 B
C#
|
using System.Collections.Generic;
|
||
|
using Android.Content;
|
||
|
using Android.Widget;
|
||
|
using System.Linq;
|
||
|
|
||
|
namespace MonoStockPortfolio.Framework
|
||
|
{
|
||
|
public abstract class GenericArrayAdapter<T> : BaseAdapter<T>
|
||
|
{
|
||
|
private readonly IList<T> _items;
|
||
|
protected readonly Context Context;
|
||
|
|
||
|
protected GenericArrayAdapter(Context context, IEnumerable<T> results)
|
||
|
{
|
||
|
_items = results.ToList();
|
||
|
Context = context;
|
||
|
}
|
||
|
|
||
|
public override int Count
|
||
|
{
|
||
|
get { return _items.Count(); }
|
||
|
}
|
||
|
|
||
|
public override T this[int position]
|
||
|
{
|
||
|
get { return _items[position]; }
|
||
|
}
|
||
|
}
|
||
|
}
|