ComponentFactory.Krypton.Ribbon.EncryptedLicenseProvider.GetLicenseKey C# (CSharp) Méthode

GetLicenseKey() protected méthode

Return the license key for the given context and type
This can be overridden to change where the license key is stored by the provider. For instance a derived class could override this method to store the key in the Registry.
protected GetLicenseKey ( System.ComponentModel.LicenseContext context, Type type ) : string
context System.ComponentModel.LicenseContext The license context
type System.Type The type to get the key for
Résultat string
        protected virtual string GetLicenseKey(LicenseContext context, Type type)
        {
            string key = null;
            if (context.UsageMode == LicenseUsageMode.Runtime)
            {
                key = context.GetSavedLicenseKey(type, null);
            }

            // Try and loaded license from registry
            if (key == null)
            {
                key = ReadKeyFromRegistry();
            }

            // if we're in design mode or a suitable license key wasn't found in
            // the runtime context look for a .LIC file
            //
            if (key == null)
            {
                key = ReadKeyFromFile(GetLicenseFilePath(context, type));
            }
            return key;
        }