Click or drag to resize

IFileAsyncPutUnderVersionControlAsync Method (Boolean)

IT Hit WebDAV Classes Reference
Enables / disables version control for this file.

Namespace:  ITHit.WebDAV.Client
Assembly:  ITHit.WebDAV.Client (in ITHit.WebDAV.Client.dll) Version: 2.0.420.0
Syntax
Task PutUnderVersionControlAsync(
	bool enable
)

Parameters

enable
Type: SystemBoolean
True to enable version-control, false - to disable.

Return Value

Type: Task

[Missing <returns> documentation for "M:ITHit.WebDAV.Client.IFileAsync.PutUnderVersionControlAsync(System.Boolean)"]

Exceptions
ExceptionCondition
LockedExceptionThis item is locked and no lock token was specified.
UnauthorizedExceptionRequest is not authorized.
NotFoundExceptionThis resource doesn't exist on the server.
NotVersionableExceptionThis resource doesn't support version-control method.
WebDavHttpExceptionServer returned unknown error.
WebDavExceptionIn case of any unexpected error.
Remarks

By default items in the repository are not under version control. To enable version control PutUnderVersionControlAsync(Boolean) must be called. The server will enable version control and will create first version. If item is under version control it always has at last one version in its versions list.

To disable version control call PutUnderVersionControlAsync(Boolean) passing false as a parameter. Server will usually delete all item versions during this call.

Examples
The following example demonstrates how to enable version-control.
string license = "<?xml version='1.0' encoding='utf...
WebDavSessionAsync session = new WebDavSessionAsync(license);
session.Credentials = new NetworkCredential("User1", "pwd");

IFileAsync file = await session.OpenFileAsync(new Uri("http://server/directory/file.docx"));
await file.PutUnderVersionControlAsync(true);
See Also