Пример #1
0
        /// <summary>
        /// Prompts the users if their trial license has expired
        /// </summary>
        public static void PromptUserForLicenseIfTrialHasExpired()
        {
            if (instance == null)
            {
                instance = new LicenseManager();
            }

            instance.PromptUserForLicenseIfTrialHasExpiredInternal();
        }
Пример #2
0
        public void Init()
        {
            if (!NServiceBus.Configure.Instance.Configurer.HasComponent<LicenseManager>())
            {
                var licenseManager = new LicenseManager();

                NServiceBus.Configure.Instance.Configurer.RegisterSingleton<LicenseManager>(licenseManager);
            }
        }
Пример #3
0
        public void Invoke(ReceivePhysicalMessageContext context, Action next)
        {
            context.PhysicalMessage.Headers[Headers.HasLicenseExpired] = LicenseExpired.ToString().ToLower();

            next();

            if (Debugger.IsAttached)
            {
                if (LicenseManager.HasLicenseExpired())
                {
                    Log.Error("Your license has expired");
                }
            }
        }
Пример #4
0
        public void Init()
        {
            var expiredLicense = true;

            try
            {
                LicenseManager.InitializeLicense();

                expiredLicense = LicenseManager.HasLicenseExpired();
            }
            catch (Exception ex)
            {
                //we only log here to prevent licensing issue to abort startup and cause production outages
                Logger.Fatal("Failed to initialize the license", ex);
            }


            Configure.Component <LicenseBehavior>(DependencyLifecycle.InstancePerCall)
            .ConfigureProperty(p => p.LicenseExpired, expiredLicense);
        }
Пример #5
0
 /// <summary>
 /// Initializes the licensing system with the given license
 /// </summary>
 /// <param name="licenseText"></param>
 public static void Parse(string licenseText)
 {
     instance = new LicenseManager(licenseText);
 }
Пример #6
0
        /// <summary>
        /// Prompts the users if their trial license has expired
        /// </summary>
        public static void PromptUserForLicenseIfTrialHasExpired()
        {
            if (instance == null)
                instance = new LicenseManager();

            instance.PromptUserForLicenseIfTrialHasExpiredInternal();
        }
Пример #7
0
 /// <summary>
 /// Initializes the licensing system with the given license
 /// </summary>
 /// <param name="licenseText"></param>
 public static void Parse(string licenseText)
 {
     instance = new LicenseManager(licenseText);
 }