sharepoint 各级别Feature 获取及使用
来源:互联网 发布:linux查看jenkins版本 编辑:程序博客网 时间:2024/04/28 13:37
private static void AddFeaturesToTable( ref DataTable dtblFeatureList, string url, SPFeatureScope scope, bool showHidden)
{
CultureInfo info;
Dictionary activeFeatures = new Dictionary();
// We need to get the SPSite and SPWeb so that we can get the culture info and any active features if a scope was passed in.
using (SPSite site = new SPSite(url))
{
using (SPWeb web = site.OpenWeb())
{
info = new CultureInfo(( int )web.Language, false );
activeFeatures [ SPFeatureScope.Farm ] = SPWebService.ContentService.Features ;
activeFeatures[SPFeatureScope.WebApplication] = site.WebApplication.Features;
activeFeatures[SPFeatureScope.Site] = site.Features;
activeFeatures[SPFeatureScope.Web] = web.Features;
}
}
foreach (SPFeatureDefinition definition in SPFarm.Local.FeatureDefinitions)
{
try
{
Guid featureID = definition.Id;
// If the scope is marked as invalid then that's our flag that it wasn't provided so we're going to
// list everything regardless of scope and show those that are active for the Web scope.
if (definition.Scope != scope && scope != SPFeatureScope.ScopeInvalid)
continue ;
if (definition.Hidden && !showHidden)
continue ;
if (!definition.SupportsLanguage(info))
continue ;
bool isActive = false ;
if (activeFeatures[definition.Scope] != null )
isActive = (activeFeatures[definition.Scope][featureID] != null );
DataRow row = BuildDataRowFromFeatureDefinition(dtblFeatureList, info, definition, isActive);
dtblFeatureList.Rows.Add(row);
}
catch (SPException)
{
continue ;
}
}
摘自 :http://stsadm.blogspot.com/2007/08/enumerate-features.html
- sharepoint 各级别Feature 获取及使用
- RAID及软RAID的实现,包括各级别RAID的原理及各级别RAID的实现
- RAID各级别特性
- RAID各级别特性
- RAID各级别特性
- RAID各级别特性
- PETS各级别考试时间表
- 计算机各级别考试要求
- 各级别dpi的值
- Unity 各级别 技术面试
- RAID各级别及其特性
- RAID各级别、软RAID
- PETS各级别定位及其适合对象
- 通过例子说明CMMI各级别不同
- 分别输出各级别log日志配置
- sharepoint 使用feature 是用到的一些命令
- Sharepoint2007自定义Feature(2)--使用Sharepoint自定义Featur
- sharepoint 使用feature 是用到的一些命令
- 异步套接字基础:select函数以及FD_ZERO、FD_SET、FD_CLR、FD_ISSET使用说明[转]
- GridView 列头合并以及鼠标效果
- FxCop 设计规则
- .net工作流引擎
- 快速去掉所有meta:resourceKey标记
- sharepoint 各级别Feature 获取及使用
- 报到贴
- ]解决在XP上sqlserver2005客户端安装的问题
- Struts+hibernate实现分页程序
- Java Sorting: Comparator vs Comparable
- sizeof 详解及其运用 比较
- 使用关系代数合并数据
- 硬盘及其读写原理详解
- 线程ID 与 线程句柄 区别