Restriction

Namespace: Babel.Licensing Assembly: Babel.Licensing.dll

Defines a base class for a license restriction.

public abstract class Restriction : IObservableObject

Inheritance

objectRestriction

Derived

BetaRestriction, DomainRestriction, HardwareRestriction, TrialRestriction, UsageRestriction

Implements

IObservableObject

Inherited Members

object.GetType(), object.MemberwiseClone(), object.ToString(), object.Equals(object?), object.Equals(object?, object?), object.ReferenceEquals(object?, object?), object.GetHashCode()

Constructors

Restriction()

Default constructor for use only by derived class.

protected Restriction()

Properties

ExpireDate

Gets or sets the expire date after which the license is no longer valid.

public virtual DateTime? ExpireDate { get; set; }

Property Value

DateTime?

Id

Gets or sets the restriction identifier.

public virtual string Id { get; set; }

Property Value

string

License

Get the parent license

public ILicense License { get; }

Property Value

ILicense

Listeners

Gets the listeners.

public virtual IEnumerable<IObjectListener> Listeners { get; }

Property Value

IEnumerable<IObjectListener>

Name

Gets the restriction name.

public abstract string Name { get; }

Property Value

string

Methods

Attach(IObjectListener)

Attaches the given listener.

public virtual void Attach(IObjectListener listener)

Parameters

NameDescription

The listener.

Exceptions

NameDescription

Thrown when one or more required arguments are null.

Detach(IObjectListener)

Detaches the given listener.

public virtual void Detach(IObjectListener listener)

Parameters

NameDescription

The listener.

Exceptions

NameDescription

Thrown when one or more required arguments are null.

Notify(params object[])

Notifies registered listeners.

public virtual void Notify(params object[] args)

Parameters

NameDescription

args object[]

A variable-length parameters list containing arguments.

Validate(ILicenseContext, Type, object)

Validates the current restriction object.

public virtual ValidationResult Validate(ILicenseContext context, Type type, object instance)

Parameters

NameDescription

The license context.

type Type

The for which the restriction is validated.

instance object

The instance.

Returns

NameDescription

The validation result code .

Last updated