MetadataDefaults constructor (String, SPWeb)

Initializes a new instance of a [T:Microsoft.Office.DocumentManagement.MetadataDefaults(System.String,Microsoft.SharePoint.SPWeb)] object.

Namespace:  Microsoft.Office.DocumentManagement
Assembly:  Microsoft.Office.DocumentManagement (in Microsoft.Office.DocumentManagement.dll)

Syntax

'Declaration
Public Sub New ( _
    listPath As String, _
    currentWeb As SPWeb _
)
'Usage
Dim listPath As String
Dim currentWeb As SPWeb

Dim instance As New MetadataDefaults(listPath, _
    currentWeb)
public MetadataDefaults(
    string listPath,
    SPWeb currentWeb
)

Parameters

  • listPath
    Type: System.String

    A server-relative URL to the Document Library for which the specified [T:Microsoft.Office.DocumentManagement.MetadataDefaults(System.String,Microsoft.SharePoint.SPWeb)] object sets metadata defaults

Exceptions

Exception Condition
ArgumentNullException

The listPath parameter is set to a null reference (Nothing in Visual Basic) or set to String.Empty. The listPath parameter should contain a server-relative URL that links to a document library

(ArgumentNullException.ParamName="listPath")

Remarks

Takes a server-relative document library path and the SPWeb object that the document library is in.

Only DocumentLibrary objects should be passed to the listPath parameter.

Examples

SPSite site = new SPSite("http://contoso"); SPWeb web = new site.OpenWeb("/"); MetadataDefaults defaults = MetadataDefaults("/Documents", web);

See also

Reference

MetadataDefaults class

MetadataDefaults members

MetadataDefaults overload

Microsoft.Office.DocumentManagement namespace

MetadataDefaults