共用方式為


SPBackupRestoreObject.SPTypeName field

定義可以用來設定或取得Information屬性所傳回的物件類型名稱參數的值String

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

Syntax

'宣告
Public Const SPTypeName As String
'用途
Dim value As String

value = SPBackupRestoreObject.SPTypeName
public const string SPTypeName

備註

如需詳細資訊,這個常數的 「 使用請參閱GetParameterSetParameter

Examples

下列範例會示範如何使用AddBackupObjects方法的實作SPTypeName ] 欄位。

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;
        childIBR.AddBackupObjects(self);
    }
}
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)
        childIBR.AddBackupObjects(self)
    Next child
End Sub

請參閱

參照

SPBackupRestoreObject class

SPBackupRestoreObject members

Microsoft.SharePoint.Administration.Backup namespace