SPBackupRestoreObject.SPTypeName-Feld
Definiert eine String , die verwendet werden können, um festzulegen, oder rufen Sie den Wert des Type-Parameters Namen in das von der Information -Eigenschaft zurückgegebene Objekt.
Namespace: Microsoft.SharePoint.Administration.Backup
Assembly: Microsoft.SharePoint (in Microsoft.SharePoint.dll)
Syntax
'Declaration
Public Const SPTypeName As String
'Usage
Dim value As String
value = SPBackupRestoreObject.SPTypeName
public const string SPTypeName
Hinweise
Weitere Informationen zur Verwendung dieser Konstante finden Sie unter GetParameter und SetParameter.
Beispiele
Im folgenden Beispiel wird veranschaulicht, wie das Feld SPTypeName eine Implementierung der AddBackupObjects -Methode verwenden.
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