IBackupRestore.CanSelectForRestore property
取得或設定一個值,指出是否可以還原管理中心使用者介面或其他使用者介面中選取 [ IBackupRestore物件所表示的內容元件。
Namespace: Microsoft.SharePoint.Administration.Backup
Assembly: Microsoft.SharePoint (in Microsoft.SharePoint.dll)
Syntax
'宣告
Property CanSelectForRestore As Boolean
Get
Set
'用途
Dim instance As IBackupRestore
Dim value As Boolean
value = instance.CanSelectForRestore
instance.CanSelectForRestore = value
bool CanSelectForRestore { get; set; }
Property value
Type: System.Boolean
true如果可以還原 ; 選取的物件否則,請false。
備註
如果使用者永遠不應該能夠還原您的自訂元件類別物件的父物件的還原獨立, get accessor 應傳回false。如果使用者應該能夠選取獨立還原您類別的所有物件、 get accessor 應傳回true。在任一情況, set accessor 應該是空的兩個括號"{}"。在大部分其他情況下,實作該屬性為私人Boolean欄位周圍的包裝函式。
管理中心應用程式的內容資料庫是不能個別選取還原的元件的範例。
Examples
下列範例顯示使用中實作的Object方法CanSelectForRestore屬性。
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