SPBackupRestoreInformation.SetParameter Method

Adds the specified key-value pair to an internal store of parameters.

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


Public Sub SetParameter ( _
    key As String, _
    value As Object _
Dim instance As SPBackupRestoreInformation
Dim key As String
Dim value As Object

instance.SetParameter(key, value)
public void SetParameter(
    string key,
    Object value


  • key
    Type: System.String

    The parameter name, which serves as a lookup key.

  • value
    Type: System.Object

    The object assigned to the parameter as its value. If this object is of type SPBackupRestoreParameter, then that is what will be saved. If not, then it will be converted into a string via the object's ToString() method and that string will be saved.


Exception Condition

The SPBackupRestoreInformation object is read-only. (See Remarks for more information.)


If the parameter key is either "SPDescription", “SPTypeName”, or "SPObjectGroup", the exception is not thrown even if the SPBackupRestoreInformation object is read-only.


The following example shows how to use the SetParameter method in an implementation of the AddBackupObjects method.

public void AddBackupObjects(SPBackupRestoreObject parent)
    if (parent == null)
        throw new ArgumentNullException("parent");

    SPBackupRestoreObject self = parent.AddChild(this);
    self.Information.SetParameter(SPBackupRestoreObject.SPTypeName, this.GetType());
    self.Information.SetParameter(SPBackupRestoreObject.SPDescription, "Description of custom content component");

    foreach (ChildContent child in ChildContentCollection)
        IBackupRestore childIBR = child as IBackupRestore;
Public Sub AddBackupObjects(ByVal parent As SPBackupRestoreObject)
    If parent Is Nothing Then
        Throw New ArgumentNullException("parent")
    End If

    Dim self As SPBackupRestoreObject = parent.AddChild(Me)
    self.Information.SetParameter(SPBackupRestoreObject.SPTypeName, Me.GetType())
    self.Information.SetParameter(SPBackupRestoreObject.SPDescription, "Description of custom content component")

     For Each child As ChildContent In ChildContentCollection
        Dim childIBR As IBackupRestore = TryCast(child, IBackupRestore)
    Next child
End Sub

See Also


SPBackupRestoreInformation Class

SPBackupRestoreInformation Members

Microsoft.SharePoint.Administration.Backup Namespace