32 lines
949 B
C#
32 lines
949 B
C#
using Microsoft.SharePoint;
|
|
using Microsoft.SharePoint.WebControls;
|
|
using System;
|
|
using System.Web;
|
|
namespace SPSolutions.SharePoint.Configuration
|
|
{
|
|
public static class SPConfigurationManager
|
|
{
|
|
public static T GetList<T>(HttpContext httpContext, string listName, ISPConfigurationListHandler spHandler) where T : SPConfigurationList
|
|
{
|
|
if (string.IsNullOrEmpty(listName))
|
|
{
|
|
return default(T);
|
|
}
|
|
SPWeb contextWeb = SPControl.GetContextWeb(httpContext);
|
|
return SPConfigurationManager.GetList<T>(contextWeb.Lists[listName], spHandler);
|
|
}
|
|
public static T GetList<T>(SPList spList, ISPConfigurationListHandler spHandler) where T : SPConfigurationList
|
|
{
|
|
if (spList == null || spHandler == null)
|
|
{
|
|
return default(T);
|
|
}
|
|
return (T)((object)spHandler.GetConfigurationList(spList));
|
|
}
|
|
public static T GetProviderCollectionSection<T>(string name) where T : SPConfigurationList
|
|
{
|
|
return default(T);
|
|
}
|
|
}
|
|
}
|