Exemplo n.º 1
0
        protected void ApplyLicenseCommand(ProductLicenseCommand command)
        {
            ProductLicenseCommand oldCommand = null;

            if (LicenseServices.LicenseInformation.HasLicenseOverrideCommand)
            {
                oldCommand = LicenseServices.LicenseInformation.LicenseOverrideCommand;
            }
            LicenseServices.RegisterLicenseOverrideCommand(command);
            LicenseEnforcer.ApplyLicense(command.NotifyUser && LicenseEnforcer.CountNagged == 0);                       // nag user if he hasn't already been nagged
        }
Exemplo n.º 2
0
        protected virtual ProductRights ApplyLicenseCommand(ProductRights rights, ProductLicenseCommand licenseCommand)
        {
            switch (LicenseServices.LicenseInformation.LicenseOverrideCommand.Action)
            {
            case ProductLicenseAction.Enable:
                //rights.FeatureRights = ProductFeatureRights.Full;
                // If the command is to enable, then we simply remove the override command and let the license rights apply.
                // This behaviour prohibits enabling of an expired license (user will need new license)
                rights.FeatureRights = rights.FeatureRights;
                break;

            case ProductLicenseAction.DisableSoftware:
                rights.FeatureRights = ProductFeatureRights.None;
                break;

            case ProductLicenseAction.CrippleSoftware:
                rights.FeatureRights = ProductFeatureRights.Partial;
                break;
            }
            return(rights);
        }
Exemplo n.º 3
0
 public void RegisterLicenseOverrideCommand(ProductLicenseCommand command)
 {
     LicenseServices.RegisterLicenseOverrideCommand(command);
 }
Exemplo n.º 4
0
 public void SetLicenseOverrideCommand(ProductLicenseCommand value)
 {
     _settings.LicenseOverrideCommand = value;
     _settings.Save();
 }
Exemplo n.º 5
0
 public void RegisterLicenseOverrideCommand(ProductLicenseCommand command)
 {
     LicenseKeyProvider.SetLicenseOverrideCommand(command);
     Apply();
 }