Click or drag to resize

ExtensionMethods Class

The extension methods are not thought to be used through this class, but instead through the relevant objects that they affect. Please see the examples below.
Inheritance Hierarchy
SystemObject
  SKM.V3ExtensionMethods

Namespace:  SKM.V3
Assembly:  SKM (in SKM.dll) Version: 4.0.2.6 (4.0.2.6)
Syntax
public static class ExtensionMethods

The ExtensionMethods type exposes the following members.

Methods
  NameDescription
Public methodStatic memberContains
Checks if the list contains an object with a specific name.
Public methodStatic memberGet
Returns a data object with the specified name.
Public methodStatic memberHasFeature
Checks so that a certain Feature is enabled (i.e. it's set to TRUE).
Public methodStatic memberHasNotExpired
Checks that they key has not expired (i.e. the expire date has not been reached).
Public methodStatic memberHasNotFeature
Checks so that a certain Feature is disabled (i.e. it's set to FALSE).
Public methodStatic memberHasValidSignature(LicenseKey, String)
Checks that this object has a valid signature, which means that the content has not been altered after that it was generated by Serial Key Manager.
Public methodStatic memberHasValidSignature(LicenseKey, String, NullableInt32)
Checks that this object has a valid signature, which means that the content has not been altered after that it was generated by Serial Key Manager.
Public methodStatic memberIsBlocked
Checks so that a they key is blocked.
Public methodStatic memberIsNotBlocked
Checks so that a they key is not blocked.
Public methodStatic memberIsOnRightMachine(LicenseKey)
Checks so that the machine code corresponds to the machine code of this computer. The default hash function is SHA1.
Public methodStatic memberIsOnRightMachine(LicenseKey, FuncString, String)
Checks so that the machine code corresponds to the machine code of this computer.
Public methodStatic memberIsValid(LicenseKey)
Checks that the Key Information object is valid (in the correct format). You can always add constraints such as @HasNotExpired(LicenseKey, Boolean).
Public methodStatic memberIsValid(LicenseKey, String)
Checks that the Key Information object is valid (in the correct format). You can always add constraints such as @HasNotExpired(LicenseKey, Boolean).
It will also check if the license key file has been modified by an unauthorized person. This method will only return true if the license key information is exactly the same as the one that was provided and signed by SKM.
Public methodStatic memberLoadFromFile(LicenseKey)
Loads the LicenseKey object from a file.
Public methodStatic memberLoadFromFile(LicenseKey, String)
Loads the LicenseKey object from a file.
Public methodStatic memberSaveToFile(LicenseKey)
Saves the current LicenseKey object to file.
Public methodStatic memberSaveToFile(LicenseKey, String)
Saves the current LicenseKey object to file.
Top
Examples
Checking if a license key has feature 1 set to true and that it has not expired.
// assuming license is a LicenseKey object.
if(license.HasFeature(1)
          .HasNotExpired()
          .IsValid())
{
    // do something
}
else
{
    // invalid license.
}
See Also