• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    公众号

C# PluginFinder类代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

本文整理汇总了C#中PluginFinder的典型用法代码示例。如果您正苦于以下问题:C# PluginFinder类的具体用法?C# PluginFinder怎么用?C# PluginFinder使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。



PluginFinder类属于命名空间,在下文中一共展示了PluginFinder类的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的C#代码示例。

示例1: SetUp

        public override void SetUp()
        {
            base.SetUp();

			var edit = new EditSection();// { Editors = new PermissionElement(), Administrators  };
			finder = new PluginFinder(typeFinder, new SecurityManager(new ThreadContext(), edit), TestSupport.SetupEngineSection());
        }
开发者ID:grbbod,项目名称:drconnect-jungo,代码行数:7,代码来源:PluginFinderTests.cs


示例2: SetUp

        public new void SetUp()
        {
            _taxSettings = new TaxSettings();
            _taxSettings.DefaultTaxAddressId = 10;

            _workContext = null;

            _addressService = MockRepository.GenerateMock<IAddressService>();
            //default tax address
            _addressService.Expect(x => x.GetAddressById(_taxSettings.DefaultTaxAddressId)).Return(new Address { Id = _taxSettings.DefaultTaxAddressId });

            var pluginFinder = new PluginFinder();

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

            _geoLookupService = MockRepository.GenerateMock<IGeoLookupService>();
            _countryService = MockRepository.GenerateMock<ICountryService>();
            _logger = MockRepository.GenerateMock<ILogger>();
            _customerSettings = new CustomerSettings();
            _addressSettings = new AddressSettings();

            _taxService = new TaxService(_addressService, _workContext, _taxSettings,
                pluginFinder, _geoLookupService, _countryService, _logger
                , _customerSettings, _addressSettings);
        }
开发者ID:nvolpe,项目名称:raver,代码行数:26,代码来源:TaxServiceTests.cs


示例3: LibraryProviderSelector

		public LibraryProviderSelector(Action<LibraryProvider> setCurrentLibraryProvider)
			: base(null)
		{
			this.Name = "Home".Localize();

			this.setCurrentLibraryProvider = setCurrentLibraryProvider;

			ApplicationController.Instance.CloudSyncStatusChanged.RegisterEvent(CloudSyncStatusChanged, ref unregisterEvents);

			if (false)
			{
				// This is test code for how to add these when we get to it
				// put in the queue provider
				libraryCreators.Add(new LibraryProviderQueueCreator());
				AddFolderImage("queue_folder.png");

				// put in the queue provider
				libraryCreators.Add(new LibraryProviderHistoryCreator());
				AddFolderImage("queue_folder.png");
			}

			// put in the sqlite provider
			libraryCreators.Add(new LibraryProviderSQLiteCreator());
			AddFolderImage("library_folder.png");

			// Check for LibraryProvider factories and put them in the list too.
			PluginFinder<LibraryProviderPlugin> libraryProviderPlugins = new PluginFinder<LibraryProviderPlugin>();
			foreach (LibraryProviderPlugin libraryProviderPlugin in libraryProviderPlugins.Plugins)
			{
				// This coupling is required to navigate to the Purchased folder after redemption or purchase updates
				libraryCreators.Add(libraryProviderPlugin);
				folderImagesForChildren.Add(libraryProviderPlugin.GetFolderImage());

				if (libraryProviderPlugin.ProviderKey == "LibraryProviderPurchasedKey")
				{
					this.PurchasedLibraryCreator = libraryProviderPlugin;
				}
			}

			// and any directory providers (sd card provider, etc...)
			// Add "Downloads" file system example
			string downloadsDirectory = Path.Combine(Environment.GetFolderPath(Environment.SpecialFolder.UserProfile), "Downloads");
			if (Directory.Exists(downloadsDirectory))
			{
				libraryCreators.Add(new LibraryProviderFileSystemCreator(downloadsDirectory, "Downloads"));
				AddFolderImage("download_folder.png");
			}

			firstAddedDirectoryIndex = libraryCreators.Count;

#if !__ANDROID__
			MenuOptionFile.CurrentMenuOptionFile.AddLocalFolderToLibrary += (sender, e) =>
			{
				AddCollectionToLibrary(e.Data);
			};
#endif

			this.FilterProviders();
		}
开发者ID:ddpruitt,项目名称:MatterControl,代码行数:59,代码来源:LibraryProviderSelector.cs


示例4: LibraryProviderSelector

		public LibraryProviderSelector(Action<LibraryProvider> setCurrentLibraryProvider, bool includeQueueLibraryProvider)
			: base(null, setCurrentLibraryProvider)
		{
			this.includeQueueLibraryProvider = includeQueueLibraryProvider;
			this.Name = "Home".Localize();

			ApplicationController.Instance.CloudSyncStatusChanged.RegisterEvent(CloudSyncStatusChanged, ref unregisterEvents);

			libraryProviderPlugins = new PluginFinder<LibraryProviderPlugin>();

			ReloadData();
		}
开发者ID:fitzsimk,项目名称:MatterControl,代码行数:12,代码来源:LibraryProviderSelector.cs


示例5: SetUp

        public new void SetUp()
        {
            _paymentSettings = new PaymentSettings();
            _paymentSettings.ActivePaymentMethodSystemNames = new List<string>();
            _paymentSettings.ActivePaymentMethodSystemNames.Add("Payments.TestMethod");

            var pluginFinder = new PluginFinder(new AppDomainTypeFinder());

            _shoppingCartSettings = new ShoppingCartSettings();

            _paymentService = new PaymentService(_paymentSettings, pluginFinder, _shoppingCartSettings);
        }
开发者ID:btolbert,项目名称:test-commerce,代码行数:12,代码来源:PaymentServiceTests.cs


示例6: SetUp

        public new void SetUp()
        {
            _discountRepo = MockRepository.GenerateMock<IRepository<Discount>>();
            var discount1 = new Discount
            {
                Id = 1,
                DiscountType = DiscountType.AssignedToCategories,
                Name = "Discount 1",
                UsePercentage = true,
                DiscountPercentage = 10,
                DiscountAmount = 0,
                DiscountLimitation = DiscountLimitationType.Unlimited,
                LimitationTimes = 0,
            };
            var discount2 = new Discount
            {
                Id = 2,
                DiscountType = DiscountType.AssignedToSkus,
                Name = "Discount 2",
                UsePercentage = false,
                DiscountPercentage = 0,
                DiscountAmount = 5,
                RequiresCouponCode = true,
                CouponCode = "SecretCode",
                DiscountLimitation = DiscountLimitationType.NTimesPerCustomer,
                LimitationTimes = 3,
            };

            _discountRepo.Expect(x => x.Table).Return(new List<Discount>() { discount1, discount2 }.AsQueryable());

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

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

			_settingService = MockRepository.GenerateMock<ISettingService>();

            var cacheManager = new NullCache();
            _discountRequirementRepo = MockRepository.GenerateMock<IRepository<DiscountRequirement>>();
            _discountUsageHistoryRepo = MockRepository.GenerateMock<IRepository<DiscountUsageHistory>>();
            var pluginFinder = new PluginFinder();
			_genericAttributeService = MockRepository.GenerateMock<IGenericAttributeService>();

			_discountService = new DiscountService(cacheManager, _discountRepo, _discountRequirementRepo,
				_discountUsageHistoryRepo, _storeContext, _genericAttributeService, pluginFinder, _eventPublisher,
				_settingService, base.ProviderManager);
        }
开发者ID:boatengfrankenstein,项目名称:SmartStoreNET,代码行数:52,代码来源:DiscountServiceTests.cs


示例7: SetUp

        public new void SetUp()
        {
            _paymentSettings = new PaymentSettings();
            _paymentSettings.ActivePaymentMethodSystemNames = new List<string>();
            _paymentSettings.ActivePaymentMethodSystemNames.Add("Payments.TestMethod");

            var pluginFinder = new PluginFinder();

            _shoppingCartSettings = new ShoppingCartSettings();
            _settingService = MockRepository.GenerateMock<ISettingService>();

            _paymentService = new PaymentService(_paymentSettings, pluginFinder, _settingService, _shoppingCartSettings);
        }
开发者ID:RobinHoody,项目名称:nopCommerce,代码行数:13,代码来源:PaymentServiceTests.cs


示例8: LibraryProviderSelector

		public LibraryProviderSelector(Action<LibraryProvider> setCurrentLibraryProvider)
			: base(null)
		{
			this.setCurrentLibraryProvider = setCurrentLibraryProvider;

			ApplicationController.Instance.CloudSyncStatusChanged.RegisterEvent(CloudSyncStatusChanged, ref unregisterEvents);

			if (false)
			{
				// This is test code for how to add these when we get to it
				// put in the queue provider
				libraryProviders.Add(new LibraryProviderQueue(null, this));
				AddFolderImage("queue_folder.png");

				// put in the queue provider
				libraryProviders.Add(new LibraryProviderHistory(null, this));
				AddFolderImage("queue_folder.png");
			}

			// put in the sqlite provider
			libraryProviders.Add(new LibraryProviderSQLite(null, this));
			AddFolderImage("library_folder.png");

			// Check for LibraryProvider factories and put them in the list too.
			PluginFinder<LibraryProviderPlugin> libraryProviderPlugins = new PluginFinder<LibraryProviderPlugin>();
			foreach (LibraryProviderPlugin libraryProviderPlugin in libraryProviderPlugins.Plugins)
			{
				// This coupling is required to navigate to the Purchased folder after redemption or purchase updates
				var pluginProvider = libraryProviderPlugin.CreateLibraryProvider(this);
				if (pluginProvider.ProviderKey == "LibraryProviderPurchasedKey")
				{
					this.PurchasedLibrary = pluginProvider;
				}

				libraryProviders.Add(pluginProvider);
				folderImagesForChildren.Add(libraryProviderPlugin.GetFolderImage());
			}

			// and any directory providers (sd card provider, etc...)
			// Add "Downloads" file system example
			string downloadsDirectory = Path.Combine(Environment.GetFolderPath(Environment.SpecialFolder.UserProfile), "Downloads");
			if (Directory.Exists(downloadsDirectory))
			{
				libraryProviders.Add(new LibraryProviderFileSystem(downloadsDirectory, "Downloads", this));
				AddFolderImage("download_folder.png");
			}

			this.FilterProviders();
		}
开发者ID:CodeMangler,项目名称:MatterControl,代码行数:49,代码来源:LibraryProviderSelector.cs


示例9: SetUp

        public new void SetUp()
        {
            var cacheManager = new NopNullCache();

            _workContext = null;

            _currencySettings = new CurrencySettings();
            var currency1 = new Currency
            {
                Id = 1,
                Name = "Euro",
                CurrencyCode = "EUR",
                DisplayLocale =  "",
                CustomFormatting = "€0.00",
                DisplayOrder = 1,
                Published = true,
                CreatedOnUtc = DateTime.UtcNow,
                UpdatedOnUtc= DateTime.UtcNow
            };
            var currency2 = new Currency
            {
                Id = 1,
                Name = "US Dollar",
                CurrencyCode = "USD",
                DisplayLocale = "en-US",
                CustomFormatting = "",
                DisplayOrder = 2,
                Published = true,
                CreatedOnUtc = DateTime.UtcNow,
                UpdatedOnUtc= DateTime.UtcNow
            };            
            _currencyRepo = MockRepository.GenerateMock<IRepository<Currency>>();
            _currencyRepo.Expect(x => x.Table).Return(new List<Currency>() { currency1, currency2 }.AsQueryable());

            _storeMappingService = MockRepository.GenerateMock<IStoreMappingService>();

            var pluginFinder = new PluginFinder();
            _currencyService = new CurrencyService(cacheManager, _currencyRepo, _storeMappingService,
                _currencySettings, pluginFinder, null);

            _taxSettings = new TaxSettings();

            _localizationService = MockRepository.GenerateMock<ILocalizationService>();
            _localizationService.Expect(x => x.GetResource("Products.InclTaxSuffix", 1, false)).Return("{0} incl tax");
            _localizationService.Expect(x => x.GetResource("Products.ExclTaxSuffix", 1, false)).Return("{0} excl tax");
            
            _priceFormatter = new PriceFormatter(_workContext, _currencyService,_localizationService, 
                _taxSettings, _currencySettings);
        }
开发者ID:haithemChkel,项目名称:nopCommerce_33,代码行数:49,代码来源:PriceFormatterTests.cs


示例10: SetUp

        public new void SetUp()
        {
            _paymentSettings = new PaymentSettings();
            _paymentSettings.ActivePaymentMethodSystemNames = new List<string>();
            _paymentSettings.ActivePaymentMethodSystemNames.Add("Payments.TestMethod");

            var pluginFinder = new PluginFinder();

            _shoppingCartSettings = new ShoppingCartSettings();
			_settingService = MockRepository.GenerateMock<ISettingService>();

			var localizationService = MockRepository.GenerateMock<ILocalizationService>();
			localizationService.Expect(ls => ls.GetResource(null)).IgnoreArguments().Return("NotSupported").Repeat.Any();

			_paymentService = new PaymentService(_paymentSettings, pluginFinder, _shoppingCartSettings, _settingService, localizationService, this.ProviderManager);
        }
开发者ID:boatengfrankenstein,项目名称:SmartStoreNET,代码行数:16,代码来源:PaymentServiceTests.cs


示例11: SetUp

        public new void SetUp()
        {
            _shippingSettings = new ShippingSettings();
            _shippingSettings.ActiveShippingRateComputationMethodSystemNames = new List<string>();
            _shippingSettings.ActiveShippingRateComputationMethodSystemNames.Add("FixedRateTestShippingRateComputationMethod");

            _shippingMethodRepository = MockRepository.GenerateMock<IRepository<ShippingMethod>>();
            _deliveryDateRepository = MockRepository.GenerateMock<IRepository<DeliveryDate>>();
            _warehouseRepository = MockRepository.GenerateMock<IRepository<Warehouse>>();
            _logger = new NullLogger();
            _productAttributeParser = MockRepository.GenerateMock<IProductAttributeParser>();
            _checkoutAttributeParser = MockRepository.GenerateMock<ICheckoutAttributeParser>();

            var cacheManager = new NopNullCache();

            var pluginFinder = new PluginFinder();
            _productService = MockRepository.GenerateMock<IProductService>();

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

            _localizationService = MockRepository.GenerateMock<ILocalizationService>();
            _addressService = MockRepository.GenerateMock<IAddressService>();
            _genericAttributeService = MockRepository.GenerateMock<IGenericAttributeService>();

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

            _shoppingCartSettings = new ShoppingCartSettings();
            _shippingService = new ShippingService(_shippingMethodRepository,
                _deliveryDateRepository,
                _warehouseRepository,
                _logger,
                _productService,
                _productAttributeParser,
                _checkoutAttributeParser,
                _genericAttributeService,
                _localizationService,
                _addressService,
                _shippingSettings, 
                pluginFinder,
                _storeContext,
                _eventPublisher,
                _shoppingCartSettings,
                cacheManager);
        }
开发者ID:nvolpe,项目名称:raver,代码行数:47,代码来源:ShippingServiceTests.cs


示例12: Index

 public ActionResult Index()
 {
     //加载插件
     PluginFinder _pluginFinder = new PluginFinder();
     List<IShippingMethod> shippingMethodList = _pluginFinder.GetPlugins<IShippingMethod>().ToList();
     ViewData["ShippingMethods"] = shippingMethodList;
     _indexService.GetTestName();
     var TestTable = _indexService.GetTestTable();
     var categoryModelList =
        TestTable.Select(p =>
        {
            var categoryModel = new CategoryModel();
            categoryModel.Id = p.Id;
            categoryModel.Name = p.Name;
            return categoryModel;
        });
     IEnumerable<CategoryModel> CategoryModel = categoryModelList;
     return View(categoryModelList);
 }
开发者ID:code-v,项目名称:Mem,代码行数:19,代码来源:HomeController.cs


示例13: ShippingMethod

        public ActionResult ShippingMethod(string method)
        {
            PluginFinder _pluginFinder = new PluginFinder();
            var pluginDescriptor = _pluginFinder.GetPluginDescriptorBySystemName<IShippingMethod>(method);
            var plugin = pluginDescriptor.Instance() as IShippingMethod;

            string actionName = "";
            string controllerName = "";
            RouteValueDictionary configurationRouteValues = null;
            plugin.GetConfigurationRoute(out actionName, out controllerName, out configurationRouteValues);

            ShippingMethodModel model = new ShippingMethodModel()
            {
                ActionName = actionName,
                ConfigurationRouteValues = configurationRouteValues,
                ControllerName = controllerName
            };

            return View(model);
        }
开发者ID:code-v,项目名称:Mem,代码行数:20,代码来源:HomeController.cs


示例14: GetAppropriateFactory

		public static FrostedSerialPortFactory GetAppropriateFactory(string driverType)
		{
            lock(availableFactories)
            {
                try
                {
                    if (availableFactories.Count == 0)
                    {
                        // always add a serial port this is a raw port
                        availableFactories.Add("Raw", new FrostedSerialPortFactory());

                        // add in any plugins that we find with other factories.
                        PluginFinder<FrostedSerialPortFactory> pluginFinder = new PluginFinder<FrostedSerialPortFactory>();

                        foreach (FrostedSerialPortFactory plugin in pluginFinder.Plugins)
                        {
                            availableFactories.Add(plugin.GetDriverType(), plugin);
                        }

                        // If we did not finde a RepRap driver add the default.
                        if (!availableFactories.ContainsKey("RepRap"))
                        {
                            availableFactories.Add("RepRap", new FrostedSerialPortFactory());
                        }
                    }

                    if (!string.IsNullOrEmpty(driverType)
                        && availableFactories.ContainsKey(driverType))
                    {
                        return availableFactories[driverType];
                    }

                    return availableFactories["RepRap"];
                }
                catch
                {
                    return new FrostedSerialPortFactory();
                }
            }
		}
开发者ID:glocklueng,项目名称:agg-sharp,代码行数:40,代码来源:FrostedSerialPortFactory.cs


示例15: SetUp

        public new void SetUp()
        {
            _taxSettings = new TaxSettings();
            _taxSettings.DefaultTaxAddressId = 10;

            _workContext = null;

			_cartSettings = new ShoppingCartSettings();

            _addressService = MockRepository.GenerateMock<IAddressService>();
            //default tax address
            _addressService.Expect(x => x.GetAddressById(_taxSettings.DefaultTaxAddressId)).Return(new Address() { Id = _taxSettings.DefaultTaxAddressId });

            var pluginFinder = new PluginFinder();

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

			_settingService = MockRepository.GenerateMock<ISettingService>();
			_geoCountryLookup = MockRepository.GenerateMock<IGeoCountryLookup>();

			_taxService = new TaxService(_addressService, _workContext, _taxSettings, _cartSettings, pluginFinder, _settingService, _geoCountryLookup, this.ProviderManager);
        }
开发者ID:boatengfrankenstein,项目名称:SmartStoreNET,代码行数:23,代码来源:TaxServiceTests.cs


示例16: SetUp

        public new void SetUp()
        {
            _shippingSettings = new ShippingSettings();
            _shippingSettings.ActiveShippingRateComputationMethodSystemNames = new List<string>();
            _shippingSettings.ActiveShippingRateComputationMethodSystemNames.Add("FixedRateTestShippingRateComputationMethod");

            _shippingMethodRepository = MockRepository.GenerateMock<IRepository<ShippingMethod>>();
            _logger = new NullLogger();
            _productAttributeParser = MockRepository.GenerateMock<IProductAttributeParser>();
			_productService = MockRepository.GenerateMock<IProductService>();
            _checkoutAttributeParser = MockRepository.GenerateMock<ICheckoutAttributeParser>();

            var cacheManager = new NullCache();

            var pluginFinder = new PluginFinder();

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

            _localizationService = MockRepository.GenerateMock<ILocalizationService>();
			_genericAttributeService = MockRepository.GenerateMock<IGenericAttributeService>();
			_settingService = MockRepository.GenerateMock<ISettingService>();

            _shoppingCartSettings = new ShoppingCartSettings();
            _shippingService = new ShippingService(cacheManager, 
                _shippingMethodRepository, 
                _logger,
                _productAttributeParser,
				_productService,
                _checkoutAttributeParser,
				_genericAttributeService,
                _localizationService,
                _shippingSettings, pluginFinder, _eventPublisher,
                _shoppingCartSettings,
				_settingService, 
				this.ProviderManager);
        }
开发者ID:boatengfrankenstein,项目名称:SmartStoreNET,代码行数:37,代码来源:ShippingServiceTests.cs


示例17: LibraryProviderSelector

		private LibraryProviderSelector()
			: base(null)
		{
			// put in the sqlite provider
			libraryProviders.Add(new LibraryProviderSQLite(null, this));

			//#if __ANDROID__
			//libraryProviders.Add(new LibraryProviderFileSystem(ApplicationDataStorage.Instance.PublicDataStoragePath, "Downloads", this.ProviderKey));

			// Check for LibraryProvider factories and put them in the list too.
			PluginFinder<LibraryProviderPlugin> libraryProviderPlugins = new PluginFinder<LibraryProviderPlugin>();
			foreach (LibraryProviderPlugin libraryProviderPlugin in libraryProviderPlugins.Plugins)
			{
				libraryProviders.Add(libraryProviderPlugin.CreateLibraryProvider(this));
			}

			// and any directory providers (sd card provider, etc...)
			// Add "Downloads" file system example
			string downloadsDirectory = Path.Combine(Environment.GetFolderPath(Environment.SpecialFolder.UserProfile), "Downloads");
			if (Directory.Exists(downloadsDirectory))
			{
				libraryProviders.Add(new LibraryProviderFileSystem(downloadsDirectory, "Downloads", this));
			}
		}
开发者ID:annafeldman,项目名称:MatterControl,代码行数:24,代码来源:LibraryProviderSelector.cs


示例18: SetUp

        public new void SetUp()
        {
            _workContext = MockRepository.GenerateMock<IWorkContext>();

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

            var pluginFinder = new PluginFinder();
            var cacheManager = new NopNullCache();

            //price calculation service
            _discountService = MockRepository.GenerateMock<IDiscountService>();
            _categoryService = MockRepository.GenerateMock<ICategoryService>();
            _productAttributeParser = MockRepository.GenerateMock<IProductAttributeParser>();

            _shoppingCartSettings = new ShoppingCartSettings();
            _catalogSettings = new CatalogSettings();

            _priceCalcService = new PriceCalculationService(_workContext, _discountService,
                _categoryService, _productAttributeParser, _shoppingCartSettings, _catalogSettings);

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

            _localizationService = MockRepository.GenerateMock<ILocalizationService>();

            //shipping
            _shippingSettings = new ShippingSettings();
            _shippingSettings.ActiveShippingRateComputationMethodSystemNames = new List<string>();
            _shippingSettings.ActiveShippingRateComputationMethodSystemNames.Add("FixedRateTestShippingRateComputationMethod");
            _shippingMethodRepository = MockRepository.GenerateMock<IRepository<ShippingMethod>>();
            _logger = new NullLogger();
            _shippingService = new ShippingService(cacheManager,
                _shippingMethodRepository,
                _logger,
                _productAttributeParser,
                _checkoutAttributeParser,
                _genericAttributeService,
                _localizationService,
                _shippingSettings, pluginFinder,
                _eventPublisher, _shoppingCartSettings);

            _paymentService = MockRepository.GenerateMock<IPaymentService>();
            _checkoutAttributeParser = MockRepository.GenerateMock<ICheckoutAttributeParser>();
            _giftCardService = MockRepository.GenerateMock<IGiftCardService>();
            _genericAttributeService = MockRepository.GenerateMock<IGenericAttributeService>();

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

            //tax
            _taxSettings = new TaxSettings();
            _taxSettings.ShippingIsTaxable = true;
            _taxSettings.PaymentMethodAdditionalFeeIsTaxable = true;
            _taxSettings.DefaultTaxAddressId = 10;
            _addressService = MockRepository.GenerateMock<IAddressService>();
            _addressService.Expect(x => x.GetAddressById(_taxSettings.DefaultTaxAddressId)).Return(new Address() { Id = _taxSettings.DefaultTaxAddressId });
            _taxService = new TaxService(_addressService, _workContext, _taxSettings, pluginFinder);

            _rewardPointsSettings = new RewardPointsSettings();

            _orderTotalCalcService = new OrderTotalCalculationService(_workContext, _storeContext,
                _priceCalcService, _taxService, _shippingService, _paymentService,
                _checkoutAttributeParser, _discountService, _giftCardService, _genericAttributeService,
                _taxSettings, _rewardPointsSettings, _shippingSettings, _shoppingCartSettings, _catalogSettings);
        }
开发者ID:kramerica-industries,项目名称:eCommerce,代码行数:67,代码来源:OrderTotalCalculationServiceTests.cs


示例19: SetUp

        public new void SetUp()
        {
            _workContext = MockRepository.GenerateMock<IWorkContext>();

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

            var pluginFinder = new PluginFinder();

            _shoppingCartSettings = new ShoppingCartSettings();
            _catalogSettings = new CatalogSettings();

            //price calculation service
            _discountService = MockRepository.GenerateMock<IDiscountService>();
            _categoryService = MockRepository.GenerateMock<ICategoryService>();
            _productAttributeParser = MockRepository.GenerateMock<IProductAttributeParser>();
            _productService = MockRepository.GenerateMock<IProductService>();
            _productAttributeService = MockRepository.GenerateMock<IProductAttributeService>();
            _genericAttributeService = MockRepository.GenerateMock<IGenericAttributeService>();
            _eventPublisher = MockRepository.GenerateMock<IEventPublisher>();
            _eventPublisher.Expect(x => x.Publish(Arg<object>.Is.Anything));

            _settingService = MockRepository.GenerateMock<ISettingService>();
            _typeFinder = MockRepository.GenerateMock<ITypeFinder>();

            //shipping
            _shippingSettings = new ShippingSettings();
            _shippingSettings.ActiveShippingRateComputationMethodSystemNames = new List<string>();
            _shippingSettings.ActiveShippingRateComputationMethodSystemNames.Add("FixedRateTestShippingRateComputationMethod");
            _shippingMethodRepository = MockRepository.GenerateMock<IRepository<ShippingMethod>>();
            _logger = new NullLogger();

            _shippingService = new ShippingService(
                _shippingMethodRepository,
                _logger,
                _productAttributeParser,
                _productService,
                _checkoutAttributeParser,
                _genericAttributeService,
                _shippingSettings,
                _eventPublisher,
                _shoppingCartSettings,
                _settingService,
                this.ProviderManager,
                _typeFinder);

            _providerManager = MockRepository.GenerateMock<IProviderManager>();
            _checkoutAttributeParser = MockRepository.GenerateMock<ICheckoutAttributeParser>();
            _giftCardService = MockRepository.GenerateMock<IGiftCardService>();

            //tax
            _taxSettings = new TaxSettings();
            _taxSettings.ShippingIsTaxable = true;
            _taxSettings.PaymentMethodAdditionalFeeIsTaxable = true;
            _taxSettings.PricesIncludeTax = false;
            _taxSettings.TaxDisplayType = TaxDisplayType.IncludingTax;
            _taxSettings.DefaultTaxAddressId = 10;

            _addressService = MockRepository.GenerateMock<IAddressService>();
            _addressService.Expect(x => x.GetAddressById(_taxSettings.DefaultTaxAddressId)).Return(new Address { Id = _taxSettings.DefaultTaxAddressId });
            _downloadService = MockRepository.GenerateMock<IDownloadService>();
            _services = MockRepository.GenerateMock<ICommonServices>();
            _httpRequestBase = MockRepository.GenerateMock<HttpRequestBase>();
            _geoCountryLookup = MockRepository.GenerateMock<IGeoCountryLookup>();

            _taxService = new TaxService(_addressService, _workContext, _taxSettings, _shoppingCartSettings, pluginFinder, _geoCountryLookup, this.ProviderManager);

            _rewardPointsSettings = new RewardPointsSettings();

            _priceCalcService = new PriceCalculationService(_discountService, _categoryService, _productAttributeParser, _productService, _shoppingCartSettings, _catalogSettings,
                _productAttributeService, _downloadService, _services, _httpRequestBase, _taxService);

            _orderTotalCalcService = new OrderTotalCalculationService(_workContext, _storeContext,
                _priceCalcService, _taxService, _shippingService, _providerManager,
                _checkoutAttributeParser, _discountService, _giftCardService, _genericAttributeService, _productAttributeParser,
                _taxSettings, _rewardPointsSettings, _shippingSettings, _shoppingCartSettings, _catalogSettings);
        }
开发者ID:toannguyen241994,项目名称:SmartStoreNET,代码行数:78,代码来源:OrderTotalCalculationServiceTests.cs


示例20: FindAndInstantiatePlugins

		private void FindAndInstantiatePlugins()
		{
#if false
			string pluginDirectory = Path.Combine("..", "..", "..", "MatterControlPlugins", "bin");
#if DEBUG
			pluginDirectory = Path.Combine(pluginDirectory, "Debug");
#else
			pluginDirectory = Path.Combine(pluginDirectory, "Release");
#endif
			if (!Directory.Exists(pluginDirectory))
			{
				string dataPath = DataStorage.ApplicationDataStorage.Instance.ApplicationUserDataPath;
				pluginDirectory = Path.Combine(dataPath, "Plugins");
			}
			// TODO: this should look in a plugin folder rather than just the application directory (we probably want it in the user folder).
			PluginFinder<MatterControlPlugin> pluginFinder = new PluginFinder<MatterControlPlugin>(pluginDirectory);
#else
			PluginFinder<MatterControlPlugin> pluginFinder = new PluginFinder<MatterControlPlugin>();
#endif

			string oemName = ApplicationSettings.Instance.GetOEMName();
			foreach (MatterControlPlugin plugin in pluginFinder.Plugins)
			{
				string pluginInfo = plugin.GetPluginInfoJSon();
				Dictionary<string, string> nameValuePairs = Newtonsoft.Json.JsonConvert.DeserializeObject<Dictionary<string, string>>(pluginInfo);

				if (nameValuePairs != null && nameValuePairs.ContainsKey("OEM"))
				{
					if (nameValuePairs["OEM"] == oemName)
					{
						plugin.Initialize(this);
					}
				}
				else
				{
					plugin.Initialize(this);
				}
			}
		}
开发者ID:Joao-Fonseca,项目名称:MatterControl,代码行数:39,代码来源:MatterControlApplication.cs



注:本文中的PluginFinder类示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
C# PluginInitContext类代码示例发布时间:2022-05-24
下一篇:
C# Plugin类代码示例发布时间:2022-05-24
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap