Condividi tramite


SPQuotaTemplateCollection.Add Method

Creates a quota template object in the collection.

Namespace:  Microsoft.SharePoint.Administration
Assembly:  Microsoft.SharePoint (in Microsoft.SharePoint.dll)
Available in Sandboxed Solutions: No

Syntax

'Declaration
Public Sub Add ( _
    qt As SPQuotaTemplate _
)
'Usage
Dim instance As SPQuotaTemplateCollection
Dim qt As SPQuotaTemplate

instance.Add(qt)
public void Add(
    SPQuotaTemplate qt
)

Parameters

Examples

The following code example creates a quota template in the collection of quota templates for the current deployment of Microsoft SharePoint Foundation.

Dim webService As New SPWebService()
Dim tempCollection As SPQuotaTemplateCollection = webService.QuotaTemplates

Dim newTemplate As New SPQuotaTemplate()

newTemplate.Name = "MyTemplate "
newTemplate.StorageMaximumLevel = 20000000 'bytes
newTemplate.StorageWarningLevel = 10000000 'bytes

tempCollection.Add(newTemplate) 
SPWebService webService = new SPWebService();
SPQuotaTemplateCollection tempCollection = webService.QuotaTemplates;

SPQuotaTemplate newTemplate = new SPQuotaTemplate();

newTemplate.Name = "MyTemplate";
newTemplate.StorageMaximumLevel = 20000000 //bytes;
newTemplate.StorageWarningLevel = 10000000 //bytes;

tempCollection.Add(newTemplate);

See Also

Reference

SPQuotaTemplateCollection Class

SPQuotaTemplateCollection Members

Microsoft.SharePoint.Administration Namespace