Exemple #1
0
        public AccountController(ISettingsProvider settingsProvider, IAccountProvider accountProvider,
                                 IDownloadProvider downloadProvider, ICountryProvider countryProvider,
                                 ILicenceProvider licenceProvider, IUserCultureChangeProvider userCultureChanged,
                                 ICultureProvider cultureProvider, IPluginHelperService pluginHelperService)
        {
            _settingsProvider   = settingsProvider ?? throw new ArgumentNullException(nameof(settingsProvider));
            _accountProvider    = accountProvider ?? throw new ArgumentNullException(nameof(accountProvider));
            _downloadProvider   = downloadProvider ?? throw new ArgumentNullException(nameof(downloadProvider));
            _licenceProvider    = licenceProvider ?? throw new ArgumentNullException(nameof(licenceProvider));
            _userCultureChanged = userCultureChanged ?? throw new ArgumentNullException(nameof(userCultureChanged));
            _cultureProvider    = cultureProvider ?? throw new ArgumentNullException(nameof(cultureProvider));

            if (countryProvider == null)
            {
                throw new ArgumentNullException(nameof(countryProvider));
            }

            if (Countries == null)
            {
                Countries = countryProvider.GetVisibleCountries();
            }

            if (LicenceTypes == null)
            {
                LicenceTypes = _licenceProvider.LicenceTypesGet();
            }

            _blogLoaded = pluginHelperService.PluginLoaded("Blog.Plugin.dll", out _);
        }
        public AccountController(ISettingsProvider settingsProvider, IAccountProvider accountProvider,
                                 IDownloadProvider downloadProvider, ICountryProvider countryProvider,
                                 ILicenceProvider licenceProvider)
        {
            _settingsProvider = settingsProvider ?? throw new ArgumentNullException(nameof(settingsProvider));
            _accountProvider  = accountProvider ?? throw new ArgumentNullException(nameof(accountProvider));
            _downloadProvider = downloadProvider ?? throw new ArgumentNullException(nameof(downloadProvider));
            _licenceProvider  = licenceProvider ?? throw new ArgumentNullException(nameof(licenceProvider));

            if (countryProvider == null)
            {
                throw new ArgumentNullException(nameof(countryProvider));
            }

            if (Countries == null)
            {
                Countries = countryProvider.GetVisibleCountries();
            }

            if (LicenceTypes == null)
            {
                LicenceTypes = _licenceProvider.LicenceTypesGet();
            }
        }