/// <summary> /// Allows user to specify the license string. /// </summary> /// <param name="config">The current <see cref="Configure"/>.</param> /// <param name="licenseText">The license text.</param> /// <returns>The current <see cref="Configure"/>.</returns> public static Configure License(this Configure config, string licenseText) { var licenseManager = new LicenseManager(licenseText); config.Configurer.RegisterSingleton<LicenseManager>(licenseManager); return config; }
/// <summary> /// Allows user to specify the license string. /// </summary> /// <param name="config">The current <see cref="BusConfiguration"/>.</param> /// <param name="licenseText">The license text.</param> // ReSharper disable UnusedParameter.Global public static void License(this BusConfiguration config, string licenseText) // ReSharper restore UnusedParameter.Global { if (string.IsNullOrWhiteSpace(licenseText)) { throw new ArgumentException("licenseText is required", "licenseText"); } Logger.Info(@"Using license supplied via fluent API."); LicenseManager.InitializeLicenseText(licenseText); }
/// <summary> /// Allows user to specify the path for the license file. /// </summary> /// <param name="config">The current <see cref="Configure"/>.</param> /// <param name="licenseFile">A relative or absolute path to the license file.</param> /// <returns>The current <see cref="Configure"/>.</returns> public static Configure LicensePath(this Configure config, string licenseFile) { if (!File.Exists(licenseFile)) { throw new FileNotFoundException("License file not found", licenseFile); } var licenseText = LicenseManager.ReadAllTextWithoutLocking(licenseFile); return(config.License(licenseText)); }
/// <summary> /// Allows user to specify the license string. /// </summary> /// <param name="config">The current <see cref="Configure"/>.</param> /// <param name="licenseText">The license text.</param> /// <returns>The current <see cref="Configure"/>.</returns> public static Configure License(this Configure config, string licenseText) { if (string.IsNullOrWhiteSpace(licenseText)) { throw new ArgumentException("licenseText is required", "licenseText"); } Logger.Info(@"Using license supplied via fluent API."); LicenseManager.InitializeLicenseText(licenseText); return(config); }
public void Invoke(IncomingContext context, Action next) { context.PhysicalMessage.Headers[Headers.HasLicenseExpired] = LicenseExpired.ToString().ToLower(); next(); if (Debugger.IsAttached) { if (LicenseManager.HasLicenseExpired()) { Log.Error("Your license has expired"); } } }
/// <summary> /// Allows user to specify the license string. /// </summary> /// <param name="config">The current <see cref="Configure"/>.</param> /// <param name="licenseText">The license text.</param> /// <returns>The current <see cref="Configure"/>.</returns> public static Configure License(this Configure config, string licenseText) { LicenseManager.Parse(licenseText); return(config); }