Share via


SPQuotaTemplateCollection.Item property (String)

Gets or sets a quota template object with the specified name in the collection. In C#, this property is an indexer for the SPQuotaTemplateCollection class.

Namespace:  Microsoft.SharePoint.Administration
Assembly:  Microsoft.SharePoint (in Microsoft.SharePoint.dll)

Syntax

'Declaration
Public Property Item ( _
    name As String _
) As SPQuotaTemplate
    Get
    Set
'Usage
Dim instance As SPQuotaTemplateCollection
Dim name As String
Dim value As SPQuotaTemplate

value = instance.Item(name)

instance.Item(name) = value
public SPQuotaTemplate this[
    string name
] { get; set; }

Parameters

Property value

Type: Microsoft.SharePoint.Administration.SPQuotaTemplate
An SPQuotaTemplate object that represents the quota template.

Examples

The following code example applies a quota template to a specified site collection.

Dim siteCollection As New SPSite("http://MySiteCollection")

Dim webService As New SPWebService()

siteCollection.Quota = webService.QuotaTemplates("MyQuotaTemplate")
SPSite siteCollection = new SPSite("http://MySiteCollection");

SPWebService webService = new SPWebService();

siteCollection.Quota = webService.QuotaTemplates["MyQuotaTemplate"];

See also

Reference

SPQuotaTemplateCollection class

SPQuotaTemplateCollection members

Item overload

Microsoft.SharePoint.Administration namespace