Click or drag to resize

Data Class

Methods that perform operations on a data object. A complete list can be found here: https://serialkeymanager.com/docs/api/v3/Data
Inheritance Hierarchy
SystemObject
  SKM.V3.MethodsData

Namespace:  SKM.V3.Methods
Assembly:  SKM (in SKM.dll) Version: 4.0.2.6 (4.0.2.6)
Syntax
public class Data

The Data type exposes the following members.

Constructors
  NameDescription
Public methodData
Initializes a new instance of the Data class
Top
Methods
  NameDescription
Public methodStatic memberAddDataObject(String, AddDataObjectModel)
Creates a new DataObject.
Public methodStatic memberAddDataObject(String, AddDataObjectToKeyModel)
Creates a new DataObject for a key.
Public methodStatic memberDecrementIntValue(String, ChangeIntValueModel)
This method will decrement the current int value by the one specified as an input parameter, i.e. IntValue.
Public methodStatic memberDecrementIntValue(String, ChangeIntValueToKeyModel)
This method will decrement the current int value by the one specified as an input parameter, i.e. IntValue.
Public methodEquals
Determines whether the specified Object is equal to the current Object.
(Inherited from Object.)
Protected methodFinalize
Allows an object to try to free resources and perform other cleanup operations before it is reclaimed by garbage collection.
(Inherited from Object.)
Public methodGetHashCode
Serves as a hash function for a particular type.
(Inherited from Object.)
Public methodGetType
Gets the Type of the current instance.
(Inherited from Object.)
Public methodStatic memberIncrementIntValue(String, ChangeIntValueModel)
This method will increment the current int value by the one specified as an input parameter, i.e. IntValue.
Public methodStatic memberIncrementIntValue(String, ChangeIntValueToKeyModel)
This method will increment the current int value by the one specified as an input parameter, i.e. IntValue.
Public methodStatic memberListDataObjects(String, ListDataObjectsModel)
This method lists either all Data Object associated with a license key, a product or your entire account, or all of them at once.
Public methodStatic memberListDataObjects(String, ListDataObjectsToKeyModel)
This method lists all data objects associated with a license key only.
Protected methodMemberwiseClone
Creates a shallow copy of the current Object.
(Inherited from Object.)
Public methodStatic memberRemoveDataObject(String, RemoveDataObjectModel)
This method will remove an existing data object.
Public methodStatic memberRemoveDataObject(String, RemoveDataObjectToKeyModel)
This method will remove an existing data object.
Public methodStatic memberSetIntValue(String, ChangeIntValueModel)
This method will set the int value to a new one.
Public methodStatic memberSetIntValue(String, ChangeIntValueToKeyModel)
This method will set the int value to a new one.
Public methodStatic memberSetStringValue(String, ChangeStringValueModel)
This method will set the string value to a new one.
Public methodStatic memberSetStringValue(String, ChangeStringValueToKeyModel)
This method will set the string value to a new one.
Public methodToString
Returns a string that represents the current object.
(Inherited from Object.)
Top
Examples
Usage quota for a feature
var token = "{acesstoken to GetKey, IncrementIntValue, ListDataObjects, AddDataObjects, and Key Lock = -1 (or zero)}".
var license = new LicenseKey { ProductId = 3349, Key = "GEBNC-WZZJD-VJIHG-GCMVD" };
license.Refresh(token);

if(license.DataObjects.Contains("usagecount"))
{
    // attempt to increment. true means we succeed.
    var dataObj = license.DataObjects.Get("usagecount");
    if (dataObj.IncrementIntValue(token: token,
                                 incrementValue: 1,
                                 enableBound: true,
                                 upperBound: 2))
    {
        // success, we can keep using this feature
    }
    else
    {
        // fail, the the user has already used it 10 times.
    }

}
else
{
    // if it does not exist, add a new one.
    license.AddDataObject(tokenDObj, new DataObject { Name = "usagecount", IntValue = 0 });
}
See Also