SPQuotaTemplateCollection.Add method

Creates a quota template object in the collection.

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

public void Add(
	SPQuotaTemplate qt
)

Parameters

qt
Type: Microsoft.SharePoint.Administration.SPQuotaTemplate

An SPQuotaTemplate object that represents the new quota template.

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

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);
Show: