本文整理汇总了C#中PluginFinder.GetPlugins方法的典型用法代码示例。如果您正苦于以下问题:C# PluginFinder.GetPlugins方法的具体用法?C# PluginFinder.GetPlugins怎么用?C# PluginFinder.GetPlugins使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类PluginFinder
的用法示例。
在下文中一共展示了PluginFinder.GetPlugins方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: 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);
}
示例2: CanRemovePlugins_ThroughConfiguration
public void CanRemovePlugins_ThroughConfiguration()
{
int initialCount = finder.GetPlugins<NavigationPluginAttribute>().Count();
finder = new PluginFinder(typeFinder, new SecurityManager(new ThreadContext(), new EditSection()), CreateEngineSection(new[] { new InterfacePluginElement { Name = "chill" } }));
IEnumerable<NavigationPluginAttribute> plugins = finder.GetPlugins<NavigationPluginAttribute>();
Assert.That(plugins.Count(), Is.EqualTo(initialCount - 1), "Found unexpected items, e.g.:" + plugins.FirstOrDefault());
}