IBackupRestoreTreeFormatter.Object method
在目前節點樹狀目錄的格式 (例如伺服器陣列、 Web 服務、 Web 應用程式或內容資料庫) 元件名稱。
Namespace: Microsoft.SharePoint.Administration.Backup
Assembly: Microsoft.SharePoint (in Microsoft.SharePoint.dll)
'宣告
Function Object ( _
obj As SPBackupRestoreObject, _
depth As Integer _
) As String
'用途
Dim instance As IBackupRestoreTreeFormatter
Dim obj As SPBackupRestoreObject
Dim depth As Integer
Dim returnValue As String
returnValue = instance.Object(obj, depth)
string Object(
SPBackupRestoreObject obj,
int depth
)
obj
Type: Microsoft.SharePoint.Administration.Backup.SPBackupRestoreObject目前節點的元件。
depth
Type: System.Int32在樹狀目錄中的目前節點深度。
Type: System.String
String 代表可能是格式化以及加註解, SharePoint Foundation內容元件的目前節點的名稱。
Notes to implementers
使用obj。基本的資料呈現為Name 。
請考慮使用depth為縮排名稱的量值。
考慮新增至每個名稱標記的是否為選取的備份或還原。
下列範例顯示實作的Object方法。
public String Object(SPBackupRestoreObject obj, int depth)
{
StringBuilder build = new StringBuilder();
if (obj.CanBackup == false || obj.CanRestore == false)
{
build.Append("*");
}
if ((obj.Information.IsBackup &&
!obj.IBackupRestore.CanSelectForBackup)
||
(!obj.Information.IsBackup &&
!obj.IBackupRestore.CanSelectForRestore))
{
build.Append("[");
}
build.Append(obj.Name);
if ((obj.Information.IsBackup &&
!obj.IBackupRestore.CanSelectForBackup)
||
(!obj.Information.IsBackup &&
!obj.IBackupRestore.CanSelectForRestore))
{
build.Append("]");
}
build.Append("+*+*+");
return build.ToString();
}
Public Function [Object](ByVal obj As SPBackupRestoreObject, ByVal depth As Integer) As String
Dim build As New StringBuilder()
If obj.CanBackup = False OrElse obj.CanRestore = False Then
build.Append("*")
End If
If (obj.Information.IsBackup AndAlso (Not obj.IBackupRestore.CanSelectForBackup)) OrElse ((Not obj.Information.IsBackup) AndAlso (Not obj.IBackupRestore.CanSelectForRestore)) Then
build.Append("[")
End If
build.Append(obj.Name)
If (obj.Information.IsBackup AndAlso (Not obj.IBackupRestore.CanSelectForBackup)) OrElse ((Not obj.Information.IsBackup) AndAlso (Not obj.IBackupRestore.CanSelectForRestore)) Then
build.Append("]")
End If
build.Append("+*+*+")
Return build.ToString()
End Function
IBackupRestoreTreeFormatter interface