当前位置: 首页>>代码示例>>C#>>正文


C# PluginFinder类代码示例

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


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


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