Beispiel #1
0
        public ActivationCode(IActivationSettings settings)
        {
            if (settings.ActivationCode.HasValue)
            {
                _activationCodes.Add(settings.ActivationCode.Value.ToHexString());
            }

            if (!HasActivationCode)
            {
                ActivationCodeRegistry registryCodes = new ActivationCodeRegistry();
                if (registryCodes.HasActivationCode)
                {
                    _activationCodes = _activationCodes.Union(registryCodes.ActivationCodes).ToList();
                }
            }

            if (!HasActivationCode)
            {
                ActivationCodeApp appCodes = new ActivationCodeApp();
                if (appCodes.HasActivationCode)
                {
                    _activationCodes = _activationCodes.Union(appCodes.ActivationCodes).ToList();
                }
            }
        }
        private void init()
        {
            _activationCodes.Clear();

            if (_settings.ActivationCode.HasValue)
            {
                Log(2, this, "from user settings");
                _activationCodes.Add(_settings.ActivationCode.Value.ToHexString());
            }

            if (!HasActivationCode)
            {
                ActivationCodeRegistry registryCodes = new ActivationCodeRegistry();
                if (registryCodes.HasActivationCode)
                {
                    Log(2, this, "from registry");
                    _activationCodes = _activationCodes.Union(registryCodes.ActivationCodes).ToList();
                }
            }

            if (!HasActivationCode)
            {
                ActivationCodeApp appCodes = new ActivationCodeApp();
                if (appCodes.HasActivationCode)
                {
                    Log(2, this, "from app");
                    _activationCodes = _activationCodes.Union(appCodes.ActivationCodes).ToList();
                }
            }
        }
        private void init()
        {
            _activationCodes.Clear();

            if (_settings.ActivationCode.HasValue)
            {
                Log(2, this, "add from user settings");
                _activationCodes.Add(_settings.ActivationCode.Value.ToHexString());
            }

            {
                ActivationCodeRegistry registryCodes = new ActivationCodeRegistry();
                if (registryCodes.HasActivationCode)
                {
                    Log(2, this, $"add from registry (#={registryCodes.ActivationCodes.Count()})");
                    _activationCodes = _activationCodes.Union(registryCodes.ActivationCodes).ToList();
                }
            }

            {
                ActivationCodeApp appCodes = new ActivationCodeApp();
                if (appCodes.HasActivationCode)
                {
                    Log(2, this, $"add from app (#={appCodes.ActivationCodes.Count()})");
                    _activationCodes = _activationCodes.Union(appCodes.ActivationCodes).ToList();
                }
            }

            Log(2, this, $"#unique={_activationCodes.Count}");
        }