IBackupRestore.CanSelectForRestore property

Gets or sets a value that indicates whether the content component that is represented by the IBackupRestore object can be selected for restoration in the Central Administration user interface or some other UI.

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

bool CanSelectForRestore { get; set; }

Property value

Type: System.Boolean
true if the object can be selected for restoration; otherwise, false.

If users should never be able to restore objects of your custom component class independently of a restoration of the parent object, the get accessor should return false. If users should be able to select any object of your class for independent restoration, the get accessor should return true. In either case, the set accessor should be an empty pair of braces "{ }". In most other cases, implement the property as a wrapper around a private Boolean field.

The content database of the Central Administration application is an example of a component that cannot be individually selected for restoration.

The following sample shows the CanSelectForRestore property used in an implementation of the Object method.

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();
}
Show: