Cuminas DjVu SDK for .NET Framework
Reserve Method



Feature to reserve.
Number of cartridges to reserve.
Makes reservation for the cartridges to consume on an operation.
Syntax
Public Shared Function Reserve( _
   ByVal feature As Feature, _
   ByVal count As Integer _
) As String
Dim feature As Feature
Dim count As Integer
Dim value As String
 
value = CartridgeManager.Reserve(feature, count)
public static string Reserve( 
   Feature feature,
   int count
)
public:
static String^ Reserve( 
   Feature feature,
   int count
) 

Parameters

feature
Feature to reserve.
count
Number of cartridges to reserve.

Return Value

Ticket for the reserved cartridges. null or empty string are also a valid value for ticket.

Remarks

If there are not enough cartridges to reserve for the operation, this method throws DjVuException with its ErrorCode set to 32 (errCartridgeNotEnough).

Example

Normally, all the methods provided in the SDK internally consumes cartridges and you don't have to access the cartridges. The following code is provided for informative purpose.

Consuming cartridges
Copy Code
// Consumes 10 cartridges of Feature11
string ticket = CartridgeManager.Reserve(Feature.Feature11, 10);
try
{
    // TODO: actual job here
    // ...

    // OK, everything worked fine; commit the reservation.
    CartridgeManager.Commit(ticket);
}
catch
{
    // the job above failed (throws some exception),
    // we should revert the reservation.
    CartridgeManager.Revert(ticket);
    throw;
}
Requirements

Target Platforms: Windows XP Home Edition, Windows XP Professional, Windows Server 2003 family, Windows Vista, Windows Server 2008 family

See Also

Reference

CartridgeManager Class
CartridgeManager Members
Commit Method
Revert Method
Cuminas License System

Send Feedback