IResource.PutUnderVersionControl Method (Boolean)

IT Hit WebDAV for .NET

Enables / disables version control for this resource.

[Visual Basic]
Sub PutUnderVersionControl( _
   ByVal enable As Boolean _
)
[C#]
void PutUnderVersionControl(
   bool enable
);

Parameters

enable
True to enable version-control, false - to disable.

Remarks

By default items in the repository are not under version control. To enable version control PutUnderVersionControl 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 PutUnderVersionControl passing false as a parameter. Server will usually delete all item versions during this call.

Exceptions

Exception TypeCondition
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.

Example

The following example demonstrates how to enable version-control.

                
string license = "<?xml version='1.0' encoding='utf...
WebDavSession session = new WebDavSession(license);
session.Credentials = new NetworkCredential("User1", "pwd");

IResource resource = session.OpenResource(new Uri("http://server/directory/resource.docx"));
resource.PutUnderVersionControl(true);
                
            

See Also

IResource Interface | ITHit.WebDAV.Client Namespace | IResource.PutUnderVersionControl Overload List