Files
mono/mcs/class/System.Web.Mobile/System.Web.UI.MobileControls/ListDataHelperInternal.cs
T
Gaurav Vaish d26b7fb705 2003-01-30 Gaurav Vaish <gvaish_mono AT lycos.com>
* ListDataHelperInternal.cs
	                         : Added class.

svn path=/trunk/mcs/; revision=11061
2003-01-30 16:48:17 +00:00

93 lines
1.7 KiB
C#

/**
* Project : Mono
* Namespace : System.Web.UI.MobileControls
* Class : ListDataHelperInternal
* Author : Gaurav Vaish
*
* Copyright : 2003 with Gaurav Vaish, and with
* Ximian Inc
*/
using System.Collections;
using System.Web.UI;
namespace System.Web.UI.MobileControls
{
internal class ListDataHelperInternal
{
private object dataSource;
private int dataSourceCount = -1;
private IEnumerable resolvedDataSrc;
private MobileListItemCollection items;
private string dataTextField;
private string dataValueField;
private bool bindFromFields;
private IListControl parent;
private StateBag parentViewState;
public ListDataHelperInternal(IListControl parent,
StateBag parentViewState)
{
this.parent = parent;
this.parentViewState = parentViewState;
}
public string DataMember
{
get
{
object o = parentViewState["DataMember"];
if(o != null)
return (string)o;
return String.Empty;
}
set
{
parentViewState["DataMember"] = value;
}
}
public object DataSource
{
get
{
return this.dataSource;
}
set
{
this.dataSource = value;
}
}
public int DataSourceCount
{
get
{
if(dataSourceCount == -1)
{
if(ResolvedDataSource != null)
{
if(ResolvedDataSource is ICollection)
dataSourceCount = ((ICollection)ResolvedDataSource).Count;
}
}
return dataSourceCount;
}
}
public IEnumerable ResolvedDataSource
{
get
{
if(this.resolvedDataSrc == null)
{
resolvedDataSrc = DataSourceHelper.GetResolvedDataSource(DataSoure, DataMember);
}
return resolvedDataSrc;
}
}
}
}