Class MirageMigration
Base class for migrations for the Mirage license provider.
Inheritance
System.Object
MirageMigration
System.Object.Equals(System.Object)
System.Object.Equals(System.Object, System.Object)
System.Object.GetHashCode()
System.Object.GetType()
System.Object.MemberwiseClone()
System.Object.ReferenceEquals(System.Object, System.Object)
System.Object.ToString()
Namespace: Sartorius.SAF.Licensing.Mirage
Assembly: Sartorius.SAF.Licensing.Mirage.dll
Syntax
[InheritedExport]
public abstract class MirageMigration
Remarks
To create a migration you just need to derive from this class. Your derived class will automatically be exported via MEF and the migration will be done when the MirageLicenseProvider is accessed.
Examples
The following example shows how to create a simple migration that adds a new feature:
using System;
namespace Sartorius.SAF.Licensing.Mirage.Test
{
internal class MirageMigrationAddFeature : MirageMigration
{
/// <inheritdoc />
public override Version MigrationVersion => new Version("1.1.1.1");
/// <inheritdoc />
public override void Migrate(IMirageMigrationBuilder builder)
{
// add a new feature "FeatureB"
var feature = new FeatureInfo("QHD010", "FeatureB", new DateTime(2020, 10, 10, 0, 0, 0, DateTimeKind.Local), FeatureState.Demo, 1, 1);
builder.AddFeature(feature, FeatureType.Counter);
}
}
}
Properties
View SourceMigrationVersion
Gets the version of the license this migration will migrate the license file to.
Declaration
public abstract Version MigrationVersion { get; }
Property Value
Type | Description |
---|---|
System.Version |
Remarks
This field is required and must be unique for all implemented license migrations.
Methods
View SourceMigrate(IMirageMigrationBuilder)
When overridden in a derived class, migrates the license file.
Declaration
public abstract void Migrate(IMirageMigrationBuilder builder)
Parameters
Type | Name | Description |
---|---|---|
IMirageMigrationBuilder | builder | An implementation of IMirageMigrationBuilder. |