Click or drag to resize

IHierarchyItemGetParentAsync 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: 5.1.2712
Task<IFolder> GetParentAsync()

Task<IFolder> GetParentAsync()

Return Value

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

Renaming Item.

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