IHierarchyItem.GetParent Method 

IT Hit WebDAV for .NET

Retrieves parent collection of this item.

[Visual Basic]
Function GetParent() As IFolder
[C#]
IFolder GetParent();

Return Value

Parent collection of this item. Null if there is no parent.

Exceptions

Exception Type Condition
NotFoundException This item doesn't exist on the server.
WebDavHttpException Server returned unknown error.
WebDavException Unexpected error occurred.

Example

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

IHierarchyItem Interface | ITHit.WebDAV.Client Namespace