共用方式為


IBackupRestoreTreeFormatter.PreObject Method

Formats a string that will appear before the name of the component at the current node.

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

Syntax

'Declaration
Function PreObject ( _
    obj As SPBackupRestoreObject, _
    depth As Integer _
) As String
'Usage
Dim instance As IBackupRestoreTreeFormatter
Dim obj As SPBackupRestoreObject
Dim depth As Integer
Dim returnValue As String

returnValue = instance.PreObject(obj, _
    depth)
string PreObject(
    SPBackupRestoreObject obj,
    int depth
)

Parameters

  • depth
    Type: System.Int32

    The depth in the tree of the current node.

Return Value

Type: System.String
A String that will appear in the tree before each component name.

Remarks

Typically, PreObject is used to indent an object name.

Examples

The following code shows and implementation of PreObject.

public String PreObject(SPBackupRestoreObject obj, int depth)
{
    StringBuilder buffer = new StringBuilder();

    AppendSpaces(buffer, depth);

    return buffer.ToString();
}
Public Function PreObject(ByVal obj As SPBackupRestoreObject, ByVal depth As Integer) As String
    Dim buffer As New StringBuilder()

    AppendSpaces(buffer, depth)

    Return buffer.ToString()
End Function

See Also

Reference

IBackupRestoreTreeFormatter Interface

IBackupRestoreTreeFormatter Members

Microsoft.SharePoint.Administration.Backup Namespace