Share via


SPListTemplateCollection Class

The SPListTemplateCollection class represents a collection of SPListTemplate objects.

System.Object

   Microsoft.SharePoint.SPBaseCollection

      Microsoft.SharePoint.SPListTemplateCollection

Public Properties

The following table shows the public properties of the SPListTemplateCollection class, the data type of each property, and a brief description of each.

Name Data Type Description
Count Int32 Gets the number of list definitions or list templates in the collection.
Item(Int32) Microsoft.SharePoint.SPListTemplate Gets the list definitions or list template object at the specified index in the collection.
Item(String) Microsoft.SharePoint.SPListTemplate Gets the list definitions or list template object with the specified name from the collection.
SchemaXml String Gets the schema that describes the collection of list definitions.
Web Microsoft.SharePoint.SPWeb Gets the parent Web site of the collection.

Thread Safety

Any public static (Shared in Visual Basic) members of this type are safe for multithreaded operations. Instance members are not guaranteed to be thread safe.

Remarks

Use the ListTemplates property of the SPWeb class to return an SPListTemplateCollection object that represents the collection of list definitions for a site. Use the GetCustomListTemplates method of the SPSite class to return an SPListTemplateCollection object that represents the collection of list templates for a site. Use an indexer to return a single list definition or list template from the collection. For example, if the collection is assigned to a variable named myListTemplates, use myListTemplates[index] in C#, or myListTemplates(index) in Visual Basic .NET, where index is the index number of the definition or template in the collection or the name of the definition or template.

Requirements

Namespace: Microsoft.SharePoint

Platforms: Microsoft Windows Server 2003

Assembly: Windows SharePoint Services (in Microsoft.SharePoint.dll)

Security: Code Access Security