本文整理汇总了C#中Config.LoadPlugins方法的典型用法代码示例。如果您正苦于以下问题:C# Config.LoadPlugins方法的具体用法?C# Config.LoadPlugins怎么用?C# Config.LoadPlugins使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Config
的用法示例。
在下文中一共展示了Config.LoadPlugins方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: GetPluginsByType
public void GetPluginsByType(string startingXML, Type kind, int expectedCount)
{
PluginConfig pc = new Config(new ResizerSection("<resizer><plugins>" + startingXML + "</plugins></resizer>")).Plugins;
pc.RemoveAll();
pc.LoadPlugins(); //Then load from xml
Assert.AreEqual<int>(expectedCount, pc.GetPlugins(kind).Count);
}
示例2: LoadPlugins
public void LoadPlugins(string xml)
{
PluginConfig pc = new Config(new ResizerSection(xml)).Plugins;
List<IIssue> oldIssues = new List<IIssue>(pc.GetIssues());
pc.LoadPlugins();
List<IIssue> issues = new List<IIssue>(pc.GetIssues());
bool problems = false;
foreach (IIssue i in issues) {
if (!oldIssues.Contains(i)) {
Debug.WriteLine(i.ToString());
problems = true;
}
}
if (problems) Assert.Fail("There were errors processing the xml plugin configuration");
}