DjVu Namespace > CartridgeManager Class : Reserve Method |
Dim feature As Feature Dim count As Integer Dim value As String value = CartridgeManager.Reserve(feature, count)
Ticket for the reserved cartridges. null or empty string are also a valid value for ticket.
If there are not enough cartridges to reserve for the operation, this method throws DjVuException with its ErrorCode set to 32 (errCartridgeNotEnough).
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; } |
Target Platforms: Windows XP Home Edition, Windows XP Professional, Windows Server 2003 family, Windows Vista, Windows Server 2008 family