本文整理汇总了C#中PluginManager.Install方法的典型用法代码示例。如果您正苦于以下问题:C# PluginManager.Install方法的具体用法?C# PluginManager.Install怎么用?C# PluginManager.Install使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类PluginManager
的用法示例。
在下文中一共展示了PluginManager.Install方法的6个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: Should_Get_Plugin_By_PluginIndentifier
public void Should_Get_Plugin_By_PluginIndentifier()
{
IPluginManager pluginManager = new PluginManager();
IAllocationDefinition definition = ConvertToDefinition(_DB.PluginInfo_GetAll(), 2);
string pluginIdentifier = "1.0.0.0, Geckon.Octopus.Plugins.TestPlugin.TestPlugin";
pluginManager.Install( definition );
IPlugin plugin = pluginManager.GetPlugin<IPlugin>( pluginIdentifier );
Assert.IsNotNull( plugin );
}
示例2: Should_Load_Plugins
public void Should_Load_Plugins()
{
IPluginManager pluginManager = new PluginManager();
IAllocationDefinition definition = ConvertToDefinition( _DB.PluginInfo_GetAll(), 2 );
pluginManager.Install( definition );
foreach( IPluginInfo plugin in definition )
{
Assert.IsTrue( pluginManager.IsAssemblyLoaded(plugin.AssemblyIdentifier ) );
Assert.IsTrue( pluginManager.IsPluginLoaded(plugin.PluginIdentifier ) );
}
}
示例3: Should_Get_Plugin_By_Version_And_Fullname
public void Should_Get_Plugin_By_Version_And_Fullname()
{
IPluginManager pluginManager = new PluginManager();
IAllocationDefinition definition = ConvertToDefinition(_DB.PluginInfo_GetAll(), 2);
string version = "1.0.0.0";
string fullname = "Geckon.Octopus.Plugins.TestPlugin.TestPlugin";
pluginManager.Install( definition );
IPlugin plugin = pluginManager.GetPlugin<IPlugin>( version, fullname );
Assert.IsNotNull( plugin );
}
示例4: Should_UnInstall_All_PluginDefinitions
public void Should_UnInstall_All_PluginDefinitions()
{
IPluginManager pluginManager = new PluginManager();
IAllocationDefinition definition = ConvertToDefinition(_DB.PluginInfo_GetAll(), 2);
int count = 0;
pluginManager.Install( definition );
foreach( IAllocationDefinition def in pluginManager.GetAllocationDefinitions() )
count++;
Assert.AreEqual( 1, count );
count = 0;
pluginManager.UnInstall( );
foreach( IAllocationDefinition def in pluginManager.GetAllocationDefinitions() )
count++;
Assert.AreEqual( 0, count );
}
示例5: Should_Throw_FileNotFoundException_If_Assembly_Isnt_Found_When_Insall_Definition
public void Should_Throw_FileNotFoundException_If_Assembly_Isnt_Found_When_Insall_Definition()
{
IPluginManager pluginManager = new PluginManager();
IAllocationDefinition definition = new AllocationDefinition( 2 );
definition.Add( new PluginInfo() );
pluginManager.Install( definition );
}
示例6: Should_Return_True_If_Plugin_Is_Loaded
public void Should_Return_True_If_Plugin_Is_Loaded()
{
IPluginManager pluginManager = new PluginManager();
IAllocationDefinition definition = ConvertToDefinition(_DB.PluginInfo_GetAll(), 2);
IPluginInfo myPlugin = null;
pluginManager.Install( definition );
foreach( IPluginInfo plugin in _DB.PluginInfo_GetAll() )
{
myPlugin = plugin;
break;
}
Assert.IsTrue( pluginManager.IsPluginLoaded( myPlugin.PluginIdentifier ) );
}