Working with VDF Currency

The VDF DLLs use a set of currency classes that live in the VDF.Vault.Currency namespace, while the web services API still uses the currency classes in the Autodesk.Connectivity.WebServices namespace.

Because the VDF only implements some Vault workflows and not all, client applications will often have to use the web service API for features that aren't supplied by the VDF. This means that these applications will need to occasionally convert between the two forms of currency classes.

As you can see in the sample code below, to convert from a file proxy class to the VDF file currency, client apps just have to construct a new VDF file currency object using the connection to the Vault that the file came from and the file proxy instance. This is the typical pattern for how to convert to almost all of the VDF currency classes. Converting from the VDF currency classes back to web service proxy classes is even simpler because only an implicit cast is required.

Sample Code

The sample code in the Downloading Files with the VDF section demonstrates how to handle an issue that is likely to occur for applications that work with both the VDF and the web services API. On the line that is copied below, the code sample is converting between web service currency (server proxy classes) and VDF currency.