ListSourceHelper Class
.NET Framework 3.0
Used by data source controls when implementing the members defined by the IListSource interface. This class cannot be inherited.
Namespace: System.Web.UI
Assembly: System.Web (in system.web.dll)
Assembly: System.Web (in system.web.dll)
The ListSourceHelper class is a utility class provided to simplify implementation of the IListSource interface by data source controls. Data source controls that implement the IDataSource interface but do not extend the DataSourceControl class can use the static ListSourceHelper methods in their own implementations of the methods defined by the IListSource interface. Data source controls that extend from the DataSourceControl class inherit these method implementations automatically.
The following code example demonstrates the design pattern for a data source class that implements the IListSource methods.
#Region "Implementation of IDataSource" Public Overridable Function GetView(viewName As String) As DataSourceView Implements IDataSource.GetView If view Is Nothing Then view = New SomeDataSourceView(Me) End If Return view End Function 'GetView Public Overridable Function GetViewNames() As ICollection Implements IDataSource.GetViewNames Dim al As New ArrayList(1) al.Add(GetView(String.Empty).Name) Return CType( al, ICollection) End Function 'GetViewNames Event DataSourceChanged As EventHandler Implements IDataSource.DataSourceChanged #End Region #Region "Implementation of IListSource" ReadOnly Property ContainsListCollection() As Boolean Implements IListSource.ContainsListCollection Get Return ListSourceHelper.ContainsListCollection(Me) End Get End Property Function GetList() As IList Implements IListSource.GetList Return ListSourceHelper.GetList(Me) End Function 'IListSource.GetList #End Region
- AspNetHostingPermission for operating in a hosted environment. Demand value: LinkDemand; Permission value: Minimal.
Community Additions
ADD
Show: