Chronos Plugins 5.9.0
This documentation covers the plugin interfaces definitions and an example implementation.
Loading...
Searching...
No Matches
AxelSemrau.Chronos.Plugin.WPF.ViewModels.LicenseCheckViewModel Class Reference

Model for default Chronos licenses. More...

+ Inheritance diagram for AxelSemrau.Chronos.Plugin.WPF.ViewModels.LicenseCheckViewModel:
+ Collaboration diagram for AxelSemrau.Chronos.Plugin.WPF.ViewModels.LicenseCheckViewModel:

Public Member Functions

virtual int GetProductId (string serialNumber)
 If you want to use the same system for different licenses: Use this to extract the product code from the given SerialNumber.
 

Protected Member Functions

void NotifyPropertyChanged ([CallerMemberName] string propertyName=null)
 Allow notification trigger by derived classes.
 

Properties

virtual string SerialNumber [get, set]
 The license code you got from Axel Semrau - or the one you sold your customers.
 
virtual string ActivationKey [get, set]
 The activation key, as the user entered it (and got from some activation site or from you).
 
virtual bool IsActivationRequired = true [get, set]
 Do you need an activation code? Could depend on the serial, maybe.
 
virtual DateTime ProductReferenceDate [get, set]
 For time dependent licensing: The reference date for your product (build date, commit...)
 
virtual TimeSpan ValidityAfterReferenceDate [get, set]
 For how long after the reference date is your license OK?
 
virtual IReadOnlyList< int > AcceptedProductIDs [get, set]
 Specify which product IDs you accept for this module. Comparison with the GetProductId result allows us to complain if something is wrong.
 
virtual bool IsLicenseKeyCorrect [get, set]
 Basic verification - length, kind of digits, checksum - whatever.
 
virtual bool IsActivationKeyOk [get, set]
 Verify the activation key against the other entered data.
 
virtual string ComputerId [get]
 Some ID that should be displayed to the user that identifies this computer, if you use that in your activation code calculation.
 
virtual string Complaints [get, set]
 Tell the reason why the currently entered data are not acceptable. If they are, this should be null.
 
virtual string LicenseHint [get, set]
 Additional information for the user about the data entered so far that does not constitute an error.
 
virtual object Explanation [get, set]
 Explanaition to the user what this license is about, and what they should enter.
 
Func< Uri > ActivationUriBuilder [get, set]
 If you need a custom Uri, you can build it here (including parameters for computer id / serial)
 
virtual Uri ActivationUri [get, set]
 Some internet address that should be visited to finish the activation. This will be displayed to the user just below the "Explanation" in clickable form.
 
virtual ICommand OpenUri [get]
 Open the ActivationUri in a browser.
 

Events

PropertyChangedEventHandler PropertyChanged
 Standard property changed handling logic.
 

Detailed Description

Model for default Chronos licenses.

Create an instance of a derived class, or get one from the Helpers.UtilityFactories.CreateViewModel[LicenseCheckViewModel]. This separation allows you to use the default license check view in Chronos with your own license code, or the Chronos logic with a different view.

Definition at line 20 of file LicenseCheckViewModel.cs.

Member Function Documentation

◆ GetProductId()

virtual int AxelSemrau.Chronos.Plugin.WPF.ViewModels.LicenseCheckViewModel.GetProductId ( string serialNumber)
virtual

If you want to use the same system for different licenses: Use this to extract the product code from the given SerialNumber.

Parameters
serialNumber
Returns

◆ NotifyPropertyChanged()

void AxelSemrau.Chronos.Plugin.WPF.ViewModels.LicenseCheckViewModel.NotifyPropertyChanged ( [CallerMemberName] string propertyName = null)
protected

Allow notification trigger by derived classes.

Parameters
propertyName

Definition at line 109 of file LicenseCheckViewModel.cs.

110 {
111 PropertyChanged?.Invoke (this, new PropertyChangedEventArgs(propertyName));
112 }
PropertyChangedEventHandler PropertyChanged
Standard property changed handling logic.

References AxelSemrau.Chronos.Plugin.WPF.ViewModels.LicenseCheckViewModel.PropertyChanged.

Property Documentation

◆ AcceptedProductIDs

virtual IReadOnlyList<int> AxelSemrau.Chronos.Plugin.WPF.ViewModels.LicenseCheckViewModel.AcceptedProductIDs
getset

Specify which product IDs you accept for this module. Comparison with the GetProductId result allows us to complain if something is wrong.

null for any product ID.

Definition at line 54 of file LicenseCheckViewModel.cs.

54{ get; set; }

◆ ActivationKey

virtual string AxelSemrau.Chronos.Plugin.WPF.ViewModels.LicenseCheckViewModel.ActivationKey
getset

The activation key, as the user entered it (and got from some activation site or from you).

Definition at line 29 of file LicenseCheckViewModel.cs.

29{ get; set; }

◆ ActivationUri

virtual Uri AxelSemrau.Chronos.Plugin.WPF.ViewModels.LicenseCheckViewModel.ActivationUri
getset

Some internet address that should be visited to finish the activation. This will be displayed to the user just below the "Explanation" in clickable form.

Definition at line 94 of file LicenseCheckViewModel.cs.

94{ get; set; }

◆ ActivationUriBuilder

Func<Uri> AxelSemrau.Chronos.Plugin.WPF.ViewModels.LicenseCheckViewModel.ActivationUriBuilder
getset

If you need a custom Uri, you can build it here (including parameters for computer id / serial)

This is pre-filled with the normal Chronos activation page if you get the ViewModel from the factory method.

Definition at line 89 of file LicenseCheckViewModel.cs.

89{ get; set; }

◆ Complaints

virtual string AxelSemrau.Chronos.Plugin.WPF.ViewModels.LicenseCheckViewModel.Complaints
getset

Tell the reason why the currently entered data are not acceptable. If they are, this should be null.

Definition at line 73 of file LicenseCheckViewModel.cs.

73{ get; set; }

◆ ComputerId

virtual string AxelSemrau.Chronos.Plugin.WPF.ViewModels.LicenseCheckViewModel.ComputerId
get

Some ID that should be displayed to the user that identifies this computer, if you use that in your activation code calculation.

Definition at line 69 of file LicenseCheckViewModel.cs.

69{ get; }

◆ Explanation

virtual object AxelSemrau.Chronos.Plugin.WPF.ViewModels.LicenseCheckViewModel.Explanation
getset

Explanaition to the user what this license is about, and what they should enter.

This is meant to be shown as WPF content, so evertything from string to FlowDocument is fine here.

Definition at line 84 of file LicenseCheckViewModel.cs.

84{ get; set; }

◆ IsActivationKeyOk

virtual bool AxelSemrau.Chronos.Plugin.WPF.ViewModels.LicenseCheckViewModel.IsActivationKeyOk
getset

Verify the activation key against the other entered data.

Returns

Definition at line 63 of file LicenseCheckViewModel.cs.

63{ get; set; }

◆ IsActivationRequired

virtual bool AxelSemrau.Chronos.Plugin.WPF.ViewModels.LicenseCheckViewModel.IsActivationRequired = true
getset

Do you need an activation code? Could depend on the serial, maybe.

Definition at line 34 of file LicenseCheckViewModel.cs.

34{ get; set; } = true;

◆ IsLicenseKeyCorrect

virtual bool AxelSemrau.Chronos.Plugin.WPF.ViewModels.LicenseCheckViewModel.IsLicenseKeyCorrect
getset

Basic verification - length, kind of digits, checksum - whatever.

Definition at line 58 of file LicenseCheckViewModel.cs.

58{ get; set; }

◆ LicenseHint

virtual string AxelSemrau.Chronos.Plugin.WPF.ViewModels.LicenseCheckViewModel.LicenseHint
getset

Additional information for the user about the data entered so far that does not constitute an error.

Definition at line 77 of file LicenseCheckViewModel.cs.

77{ get; set; }

◆ OpenUri

virtual ICommand AxelSemrau.Chronos.Plugin.WPF.ViewModels.LicenseCheckViewModel.OpenUri
get

Open the ActivationUri in a browser.

Definition at line 99 of file LicenseCheckViewModel.cs.

◆ ProductReferenceDate

virtual DateTime AxelSemrau.Chronos.Plugin.WPF.ViewModels.LicenseCheckViewModel.ProductReferenceDate
getset

For time dependent licensing: The reference date for your product (build date, commit...)

Definition at line 38 of file LicenseCheckViewModel.cs.

38{ get; set; }

◆ SerialNumber

virtual string AxelSemrau.Chronos.Plugin.WPF.ViewModels.LicenseCheckViewModel.SerialNumber
getset

The license code you got from Axel Semrau - or the one you sold your customers.

Definition at line 25 of file LicenseCheckViewModel.cs.

25{ get; set; }

◆ ValidityAfterReferenceDate

virtual TimeSpan AxelSemrau.Chronos.Plugin.WPF.ViewModels.LicenseCheckViewModel.ValidityAfterReferenceDate
getset

For how long after the reference date is your license OK?

Definition at line 42 of file LicenseCheckViewModel.cs.

42{ get; set; }

Event Documentation

◆ PropertyChanged

PropertyChangedEventHandler AxelSemrau.Chronos.Plugin.WPF.ViewModels.LicenseCheckViewModel.PropertyChanged

Standard property changed handling logic.

Definition at line 103 of file LicenseCheckViewModel.cs.

Referenced by AxelSemrau.Chronos.Plugin.WPF.ViewModels.LicenseCheckViewModel.NotifyPropertyChanged().


The documentation for this class was generated from the following file: