Пример #1
0
        /// <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));
        }