public WebWorkContext(Func<string, ICacheManager> cacheManager,
            HttpContextBase httpContext,
            ICustomerService customerService,
			IStoreContext storeContext,
            IAuthenticationService authenticationService,
            ILanguageService languageService,
            ICurrencyService currencyService,
			IGenericAttributeService attrService,
            TaxSettings taxSettings, CurrencySettings currencySettings,
            LocalizationSettings localizationSettings, Lazy<ITaxService> taxService,
            IStoreService storeService, ISettingService settingService,
			IUserAgent userAgent)
        {
            this._cacheManager = cacheManager("static");
            this._httpContext = httpContext;
            this._customerService = customerService;
            this._storeContext = storeContext;
            this._authenticationService = authenticationService;
            this._languageService = languageService;
            this._attrService = attrService;
            this._currencyService = currencyService;
            this._taxSettings = taxSettings;
            this._taxService = taxService;
            this._currencySettings = currencySettings;
            this._localizationSettings = localizationSettings;
            this._storeService = storeService;
            this._settingService = settingService;
            this._userAgent = userAgent;
        }
        public HttpProductInfoHeaderValueFactory(IUserAgent userAgent)
        {
            if (null == userAgent)
                throw new ArgumentNullException(nameof(userAgent));

            _userAgent = userAgent;
        }
Ejemplo n.º 3
0
        public UserAgentEncoder(IUserAgent userAgent)
        {
            var name = userAgent.Name.Trim().Replace(' ', '_').Rfc2047Encode();
            var version = userAgent.Version.Trim().Replace(' ', '_').Rfc2047Encode();

            _userAgent = name + "/" + version;
        }
        /// <summary>
        /// Ctor
        /// </summary>
        /// <param name="workContext">Work context</param>
		/// <param name="storeContext">Store context</param>
        public MobileDeviceHelper(
			ThemeSettings themeSettings, 
			IWorkContext workContext,
			IStoreContext storeContext, 
			IUserAgent userAgent)
        {
			this._themeSettings = themeSettings;
            this._workContext = workContext;
			this._storeContext = storeContext;
			this._userAgent = userAgent;
        }
Ejemplo n.º 5
0
        public MediaController(
            IPictureService pictureService,
            IImageProcessor imageProcessor,
            IImageCache imageCache,
            IUserAgent userAgent,
            IEventPublisher eventPublisher,
            IMediaFileSystem mediaFileSystem,
            MediaSettings mediaSettings,
            Lazy <SeoSettings> seoSettings,
            Lazy <IXmlSitemapGenerator> sitemapGenerator)
        {
            _pictureService   = pictureService;
            _imageProcessor   = imageProcessor;
            _imageCache       = imageCache;
            _userAgent        = userAgent;
            _eventPublisher   = eventPublisher;
            _mediaFileSystem  = mediaFileSystem;
            _mediaSettings    = mediaSettings;
            _seoSettings      = seoSettings;
            _sitemapGenerator = sitemapGenerator;

            Logger = NullLogger.Instance;
        }
Ejemplo n.º 6
0
        public CustomerService(
            IRepository <Customer> customerRepository,
            IRepository <CustomerRole> customerRoleRepository,
            IRepository <GenericAttribute> gaRepository,
            IRepository <RewardPointsHistory> rewardPointsHistoryRepository,
            IGenericAttributeService genericAttributeService,
            RewardPointsSettings rewardPointsSettings,
            ICommonServices services,
            HttpContextBase httpContext,
            IUserAgent userAgent)
        {
            this._customerRepository            = customerRepository;
            this._customerRoleRepository        = customerRoleRepository;
            this._gaRepository                  = gaRepository;
            this._rewardPointsHistoryRepository = rewardPointsHistoryRepository;
            this._genericAttributeService       = genericAttributeService;
            this._rewardPointsSettings          = rewardPointsSettings;
            this._services    = services;
            this._httpContext = httpContext;
            this._userAgent   = userAgent;

            T      = NullLocalizer.Instance;
            Logger = NullLogger.Instance;
        }
Ejemplo n.º 7
0
 public UserAgentEncoder(IUserAgent userAgent)
 {
     this._userAgent = Rfc2047Encoding.Rfc2047Encode(userAgent.Name.Trim().Replace(' ', '_')) + "/" + Rfc2047Encoding.Rfc2047Encode(userAgent.Version.Trim().Replace(' ', '_'));
 }
Ejemplo n.º 8
0
 public BrowserRule(IUserAgent userAgent)
 {
     _userAgent = userAgent;
 }
Ejemplo n.º 9
0
        public new void SetUp()
        {
            _settingService = MockRepository.GenerateMock <ISettingService>();
            _workContext    = MockRepository.GenerateMock <IWorkContext>();

            _store = new Store {
                Id = 1
            };
            _storeContext = MockRepository.GenerateMock <IStoreContext>();
            _storeContext.Expect(x => x.CurrentStore).Return(_store);

            _dateTimeSettings = new DateTimeSettings
            {
                AllowCustomersToSetTimeZone = false,
                DefaultStoreTimeZoneId      = ""
            };

            _rewardPointsSettings = new RewardPointsSettings
            {
                Enabled = false,
            };

            var customer1 = new Customer
            {
                Id         = 1,
                TimeZoneId = "Russian Standard Time"    // (GMT+03:00) Moscow, St. Petersburg, Volgograd
            };

            _customerRepo = MockRepository.GenerateMock <IRepository <Customer> >();
            _customerRepo.Expect(x => x.Table).Return(new List <Customer> {
                customer1
            }.AsQueryable());

            _customerRoleRepo        = MockRepository.GenerateMock <IRepository <CustomerRole> >();
            _genericAttributeRepo    = MockRepository.GenerateMock <IRepository <GenericAttribute> >();
            _rewardPointsHistoryRepo = MockRepository.GenerateMock <IRepository <RewardPointsHistory> >();
            _shoppingCartItemRepo    = MockRepository.GenerateMock <IRepository <ShoppingCartItem> >();
            _userAgent = MockRepository.GenerateMock <IUserAgent>();
            _genericAttributeService = MockRepository.GenerateMock <IGenericAttributeService>();
            _gdprTool = MockRepository.GenerateMock <Lazy <IGdprTool> >();

            _eventPublisher = MockRepository.GenerateMock <IEventPublisher>();
            _eventPublisher.Expect(x => x.Publish(Arg <object> .Is.Anything));

            _services = MockRepository.GenerateMock <ICommonServices>();
            _services.Expect(x => x.StoreContext).Return(_storeContext);
            _services.Expect(x => x.RequestCache).Return(NullRequestCache.Instance);
            _services.Expect(x => x.Cache).Return(NullCache.Instance);
            _services.Expect(x => x.EventPublisher).Return(_eventPublisher);

            _customerService = new CustomerService(
                _customerRepo,
                _customerRoleRepo,
                _genericAttributeRepo,
                _rewardPointsHistoryRepo,
                _shoppingCartItemRepo,
                _genericAttributeService,
                _rewardPointsSettings,
                _services,
                new FakeHttpContext("~/"),
                _userAgent,
                new CustomerSettings(),
                _gdprTool);

            _dateTimeHelper = new DateTimeHelper(_workContext, _settingService, _dateTimeSettings, _customerService);
        }
Ejemplo n.º 10
0
 public IsMobileRule(IUserAgent userAgent)
 {
     _userAgent = userAgent;
 }
Ejemplo n.º 11
0
 public void AddUser(IUserAgent agent)
 {
     Users[agent.ID] = agent;
 }
Ejemplo n.º 12
0
 public static void SetParameter(this IMediaStreamFacadeBase mediaStreamFacade, IUserAgent userAgent)
 {
     mediaStreamFacade.Builder.RegisterSingleton <IUserAgent>(userAgent);
 }
Ejemplo n.º 13
0
 public UserAgentMiddleware(IUserAgent userAgent)
 {
     UserAgent = userAgent;
 }
Ejemplo n.º 14
0
 public void Enqueue(IUserAgent agent)
 {
     mUsers[mPostion] = agent;
     mPostion++;
 }
Ejemplo n.º 15
0
 public OSRule(IUserAgent userAgent)
 {
     _userAgent = userAgent;
 }
Ejemplo n.º 16
0
 public void AddUser(IUserAgent agent)
 {
     Users[agent.ID] = agent;
 }
Ejemplo n.º 17
0
        public new void SetUp()
        {
            _customerSettings = new CustomerSettings();
            _securitySettings = new SecuritySettings()
            {
                EncryptionKey = "273ece6f97dd844d"
            };
            _rewardPointsSettings = new RewardPointsSettings()
            {
                Enabled = false,
            };

            _encryptionService = new EncryptionService(_securitySettings);
            _customerRepo      = MockRepository.GenerateMock <IRepository <Customer> >();
            var customer1 = new Customer()
            {
                Username       = "******",
                Email          = "*****@*****.**",
                PasswordFormat = PasswordFormat.Hashed,
                Active         = true
            };

            string saltKey  = _encryptionService.CreateSaltKey(5);
            string password = _encryptionService.CreatePasswordHash("password", saltKey);

            customer1.PasswordSalt = saltKey;
            customer1.Password     = password;
            AddCustomerToRegisteredRole(customer1);

            var customer2 = new Customer()
            {
                Username       = "******",
                Email          = "*****@*****.**",
                PasswordFormat = PasswordFormat.Clear,
                Password       = "******",
                Active         = true
            };

            AddCustomerToRegisteredRole(customer2);

            var customer3 = new Customer()
            {
                Username       = "******",
                Email          = "*****@*****.**",
                PasswordFormat = PasswordFormat.Encrypted,
                Password       = _encryptionService.EncryptText("password"),
                Active         = true
            };

            AddCustomerToRegisteredRole(customer3);

            var customer4 = new Customer()
            {
                Username       = "******",
                Email          = "*****@*****.**",
                PasswordFormat = PasswordFormat.Clear,
                Password       = "******",
                Active         = true
            };

            AddCustomerToRegisteredRole(customer4);

            var customer5 = new Customer()
            {
                Username       = "******",
                Email          = "*****@*****.**",
                PasswordFormat = PasswordFormat.Clear,
                Password       = "******",
                Active         = true
            };

            _eventPublisher = MockRepository.GenerateMock <IEventPublisher>();
            _eventPublisher.Expect(x => x.Publish(Arg <object> .Is.Anything));

            _customerRepo.Expect(x => x.Table).Return(new List <Customer>()
            {
                customer1, customer2, customer3, customer4, customer5
            }.AsQueryable());

            _customerRoleRepo        = MockRepository.GenerateMock <IRepository <CustomerRole> >();
            _genericAttributeRepo    = MockRepository.GenerateMock <IRepository <GenericAttribute> >();
            _rewardPointsHistoryRepo = MockRepository.GenerateMock <IRepository <RewardPointsHistory> >();
            _userAgent = MockRepository.GenerateMock <IUserAgent>();

            _genericAttributeService       = MockRepository.GenerateMock <IGenericAttributeService>();
            _newsLetterSubscriptionService = MockRepository.GenerateMock <INewsLetterSubscriptionService>();

            _storeContext = MockRepository.GenerateMock <IStoreContext>();

            _services = MockRepository.GenerateMock <ICommonServices>();
            _services.Expect(x => x.StoreContext).Return(_storeContext);
            _services.Expect(x => x.RequestCache).Return(NullRequestCache.Instance);
            _services.Expect(x => x.Cache).Return(NullCache.Instance);
            _services.Expect(x => x.EventPublisher).Return(_eventPublisher);

            _messageModelProvider = MockRepository.GenerateMock <Lazy <IMessageModelProvider> >();

            _customerService = new CustomerService(_customerRepo, _customerRoleRepo,
                                                   _genericAttributeRepo, _rewardPointsHistoryRepo, _genericAttributeService, _rewardPointsSettings, _services, new FakeHttpContext("~/"), _userAgent, _messageModelProvider);

            _customerRegistrationService = new CustomerRegistrationService(_customerService,
                                                                           _encryptionService, _newsLetterSubscriptionService, _rewardPointsSettings, _customerSettings, _storeContext, _eventPublisher);
        }
Ejemplo n.º 18
0
 public static void SetParameter(this IMediaStreamFacadeBase mediaStreamFacade, IUserAgent userAgent)
 {
     mediaStreamFacade.Builder.RegisterSingleton(userAgent);
 }
Ejemplo n.º 19
0
 public HomeController(IUserAgent userAgent)
 {
     _userAgent = userAgent;
 }
Ejemplo n.º 20
0
 public BrowserMinorVersionRule(IUserAgent userAgent)
 {
     _userAgent = userAgent;
 }
Ejemplo n.º 21
0
 public UserController(IUserAgent userAgent)
 {
     _userAgent = userAgent;
 }
Ejemplo n.º 22
0
 public void Enqueue(IUserAgent agent)
 {
     mUsers[mPostion] = agent;
     mPostion++;
 }
Ejemplo n.º 23
0
 public MobileDeviceHelper(IUserAgent userAgent)
 {
     _userAgent = userAgent;
 }
Ejemplo n.º 24
0
 public DeviceRule(IUserAgent userAgent)
 {
     _userAgent = userAgent;
 }
Ejemplo n.º 25
0
 public UserLog(ApplicationDbContext context, UserManager <ApplicationUser> userManager, IPlatformResolver platformResolver)
 {
     _context     = context;
     _userManager = userManager;
     _useragent   = platformResolver.UserAgent;
 }