Aspose.Tasks for C++
Metered.h
1 #pragma once
2 //-----------------------------------------------------------------------
3 // <copyright file="Metered.cs" company="Aspose Pty Ltd">
4 // Copyright (c) 2002-2024 Aspose Pty Ltd. All Rights Reserved.
5 // </copyright>
6 //-----------------------------------------------------------------------
7 
8 #include <system/object.h>
9 
10 #include "aspose.tasks.cpp/aspose_tasks_api_defs.h"
11 
12 namespace System
13 {
14 class Decimal;
15 class String;
16 } // namespace System
17 
18 namespace Aspose {
19 
20 namespace Tasks {
21 
22 /// <summary>
23 /// Provides methods to set metered key.
24 /// </summary>
25 /// <example>
26 /// In this example, an attempt will be made to set metered public and private key
27 /// <ms>
28 /// <code>
29 /// [C#]
30 ///
31 /// Metered metered = new Metered();
32 /// metered.SetMeteredKey("PublicKey", "PrivateKey");
33 ///
34 ///
35 /// [Visual Basic]
36 ///
37 /// Dim metered As Metered = New Metered
38 /// metered.SetMeteredKey("PublicKey", "PrivateKey")
39 /// </code>
40 /// </ms>
41 /// <java>
42 /// the component jar file:
43 /// <code>
44 /// Metered metered = new Metered();
45 /// metered.setMeteredKey("PublicKey", "PrivateKey");
46 /// </code>
47 /// </java>
48 /// </example>
49 class ASPOSE_TASKS_SHARED_CLASS Metered : public System::Object
50 {
51  typedef Metered ThisType;
52  typedef System::Object BaseType;
53 
54  typedef ::System::BaseTypesInfo<BaseType> ThisTypeBaseTypesInfo;
55  ASPOSE_TASKS_SHARED_RTTI_INFO_DECL();
56 
57 public:
58 
59  /// <summary>
60  /// Sets metered public and private keys.
61  /// </summary>
62  /// <remarks>
63  /// If you purchase metered license, this API should be called on application startup, normally, this is enough.
64  /// 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.</remarks>
65  /// <param name="publicKey">The public key.</param>
66  /// <param name="privateKey">The private key.</param>
67  ASPOSE_TASKS_SHARED_API void SetMeteredKey(const System::String& publicKey, const System::String& privateKey);
68  /// <summary>
69  /// Removes previously setup license.
70  /// </summary>
71  ASPOSE_TASKS_SHARED_API void ResetMeteredKey();
72  /// <summary>
73  /// Gets consumption credit.
74  /// </summary>
75  /// <returns>Returns the number of consumed credit points.</returns>
76  static ASPOSE_TASKS_SHARED_API System::Decimal GetConsumptionCredit();
77  /// <summary>
78  /// Gets consumption file size.
79  /// </summary>
80  /// <returns>Returns the number of consumed bytes.</returns>
81  static ASPOSE_TASKS_SHARED_API System::Decimal GetConsumptionQuantity();
82  /// <summary>
83  /// Checks whether the product is successfully licensed using Metered license.
84  /// </summary>
85  ASPOSE_TASKS_SHARED_API bool IsLicensed();
86 
87 };
88 
89 } // namespace Tasks
90 } // namespace Aspose
91 
92 
Provides methods to set metered key.
Definition: Metered.h:50
static System::Decimal GetConsumptionCredit()
Gets consumption credit.
static System::Decimal GetConsumptionQuantity()
Gets consumption file size.
void SetMeteredKey(const System::String &publicKey, const System::String &privateKey)
Sets metered public and private keys.
bool IsLicensed()
Checks whether the product is successfully licensed using Metered license.
void ResetMeteredKey()
Removes previously setup license.
Definition: Asn.h:13