Click or drag to resize

IHierarchyItemGetParent Method

IT Hit WebDAV Classes Reference
Retrieves parent hierarchy item of this item.

Namespace:  ITHit.WebDAV.Client
Assembly:  ITHit.WebDAV.Client (in ITHit.WebDAV.Client.dll) Version: 2.0.420.0
Syntax
IFolder GetParent()

Return Value

Type: IFolder
Parent hierarchy item of this item. Null for root item.
Exceptions
ExceptionCondition
NotFoundExceptionThis item doesn't exist on the server.
WebDavHttpExceptionServer returned unknown error.
WebDavExceptionUnexpected error occurred.
Examples

Renaming Item.

string license = "<?xml version='1.0' encoding='utf...
WebDavSession session = new WebDavSession(license);
session.Credentials = new NetworkCredential("User1", "pwd");
IFolder folderSrc = session.OpenFolder(new Uri("http://server/My Folder/"));
IFolder folderDst = folderSrc.GetParent();
try
{
    folderSrc.MoveTo(folderDst, "My new name", false);
}
catch (PreconditionFailedException)
{
    Console.WriteLine("The folder with such name already exists and 'overwrite' was 'false'.");
}
See Also