private void AddContentTypesToLibrary(SPList list, SPWeb oWeb)
{
list.ContentTypesEnabled = true;
SPContentTypeCollection ctypecoll = oWeb.ContentTypes;
foreach (SPContentType ctType in ctypecoll)
{
if (list.ContentTypes[ctType.Name] == null)
{
//ctType.Hidden = true;
list.ContentTypes.Add(ctType);
}
}
}
No comments:
Post a Comment