MetadataDefaults.GetDefaultMetadata Method (SPFolder)
Gets the defaults for all field that have defaults for a specified folder.
Namespace: Microsoft.Office.DocumentManagement
Assembly: Microsoft.Office.DocumentManagement (in Microsoft.Office.DocumentManagement.dll)
Syntax
'Declaration
Public Function GetDefaultMetadata ( _
folder As SPFolder _
) As Pair()
'Usage
Dim instance As MetadataDefaults
Dim folder As SPFolder
Dim returnValue As Pair()
returnValue = instance.GetDefaultMetadata(folder)
public Pair[] GetDefaultMetadata(
SPFolder folder
)
Parameters
folder
Type: Microsoft.SharePoint.SPFolderThe SPFolder object to get default values for
Return Value
Type: []
All of the location-based field defaults set at the folder parameter in an array of pairs
Exceptions
Exception | Condition |
---|---|
ArgumentNullException | The folder parameter is set to a null reference (Nothing in Visual Basic). The folder parameter should be a non-null SPFolder object representing a folder in the document library. (ArgumentNullException.ParamName="folder") |
Remarks
The first value of each pair is the field on which the default value exists. The second value in the pair is the default value on that field at passed-in parameter's folder.
Examples
SPSite site = new SPSite("http://contoso"); SPWeb web = new site.OpenWeb("/"); MetadataDefaults defaults = MetadataDefaults("/Documents", web); SPFolder folder = web.GetFolder("/Documents/AdventureWorks"); Pair[] fieldDefaults = defaults.GetDefaultMetadata(folder);