Aspose.Tasks for C++
Aspose::Tasks::Metered Class Reference

Provides methods to set metered key. More...

#include <Metered.h>

Inherits System::Object.

Public Member Functions

void SetMeteredKey (const System::String &publicKey, const System::String &privateKey)
 Sets metered public and private keys. More...
 
void ResetMeteredKey ()
 Removes previously setup license. More...
 
bool IsLicensed ()
 Checks whether the product is successfully licensed using Metered license. More...
 

Static Public Member Functions

static System::Decimal GetConsumptionCredit ()
 Gets consumption credit. More...
 
static System::Decimal GetConsumptionQuantity ()
 Gets consumption file size. More...
 

Detailed Description

Provides methods to set metered key.

In this example, an attempt will be made to set metered public and private key <ms>

[C#]
Metered metered = new Metered();
metered.SetMeteredKey("PublicKey", "PrivateKey");
[Visual Basic]
Dim metered As Metered = New Metered
metered.SetMeteredKey("PublicKey", "PrivateKey")

</ms> <java> the component jar file:

Metered metered = new Metered();
metered.setMeteredKey("PublicKey", "PrivateKey");

</java>

Member Function Documentation

◆ GetConsumptionCredit()

static System::Decimal Aspose::Tasks::Metered::GetConsumptionCredit ( )
static

Gets consumption credit.

Returns
Returns the number of consumed credit points.

◆ GetConsumptionQuantity()

static System::Decimal Aspose::Tasks::Metered::GetConsumptionQuantity ( )
static

Gets consumption file size.

Returns
Returns the number of consumed bytes.

◆ IsLicensed()

bool Aspose::Tasks::Metered::IsLicensed ( )

Checks whether the product is successfully licensed using Metered license.

◆ ResetMeteredKey()

void Aspose::Tasks::Metered::ResetMeteredKey ( )

Removes previously setup license.

◆ SetMeteredKey()

void Aspose::Tasks::Metered::SetMeteredKey ( const System::String &  publicKey,
const System::String &  privateKey 
)

Sets metered public and private keys.

If you purchase metered license, this API should be called on application startup, normally, this is enough. However, if metered fails to upload consumption data during 24 hours period, the license will be set to evaluation status. To avoid such case, you should regularly check the license status If it is evaluation status, call this API again.

Parameters
publicKeyThe public key.
privateKeyThe private key.