本文整理汇总了C#中IPlugin类的典型用法代码示例。如果您正苦于以下问题:C# IPlugin类的具体用法?C# IPlugin怎么用?C# IPlugin使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
IPlugin类属于命名空间,在下文中一共展示了IPlugin类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: WithPlugin
public PluginList WithPlugin(IPlugin plugin)
{
var result = new PluginList();
result._plugins.AddRange(Plugins);
result._plugins.Add(plugin);
return result;
}
示例2: getInstance
/// <summary>
/// Create single instance
/// </summary>
/// <returns></returns>
public static DomainFacade getInstance(IPlugin pPlugin)
{
if (cInstance == null)
cInstance = new DomainFacade(pPlugin);
return (cInstance);
}
示例3: PluginEntry
public PluginEntry(IPlugin plugin,string filename)
{
m_filename = filename;
m_plugin = plugin;
m_enabled = false;
m_licensed = false;
}
示例4: WriteSkinsFileEditSkin
/// <summary>
/// Writes the skins file to disk to with all NoteFly skins.
/// </summary>
/// <param name="host"></param>
/// <param name="editskinnr"></param>
/// <param name="editskin"></param>
/// <returns>true if writing skins file was succesfull.</returns>
public static bool WriteSkinsFileEditSkin(IPlugin.IPluginHost host, int editskinnr, Skin editskin)
{
XmlTextWriter xmlwriter = null;
bool succeed = false;
try
{
xmlwriter = WriteSkinFileHeader(host.GetSkinsFile());
for (int i = 0; i < host.CountSkins; i++)
{
Skin currentskin = null;
if (editskinnr == i)
{
currentskin = editskin;
}
else
{
currentskin = SkinFactory.GetSkin(host, i);
}
WriteSkinsFileSkin(xmlwriter, currentskin);
}
xmlwriter = WriteSkinFileFooter(xmlwriter);
succeed = true;
}
finally
{
if (xmlwriter != null)
{
xmlwriter.Close();
}
}
return succeed;
}
示例5: Initialize
public void Initialize(IPlugin plugin)
{
pipeListener = new NamedPipeListener<string>("SlavApp.Minion.Resembler");
pipeListener.MessageReceived += (sender, e) => { OnMessageReceived(plugin, e); };
pipeListener.Error += (sender, e) => { OnError(e); };
pipeListener.Start();
}
示例6: DomainFacade
private DomainFacade(InjectionConfig pProxyConfig, IPlugin pPlugin)
{
cPlugin = pPlugin;
cInfrastructure = InfrastructureFacade.getInstance(pProxyConfig, pPlugin);
cRecordList = new List<InjectedURLRecord>();
cObservers = new List<IObserver>();
}
示例7: Configure
/// <summary>
/// The configure.
/// </summary>
/// <param name="targetPlugin">
/// The target plugin.
/// </param>
/// <returns>
/// The <see cref="IConfig"/>.
/// </returns>
public IConfig Configure(IPlugin targetPlugin)
{
IConfig currentConfig = targetPlugin.Configuration,
defaultConfig = targetPlugin.DefaultConfig,
targetConfig = currentConfig ?? defaultConfig;
if (targetConfig != null && defaultConfig != null)
{
using (
var configDialog =
new ObjectBrowserDialog(
string.Format(CultureInfo.InvariantCulture, "{0} Configuration", targetPlugin.GetDetail().Key).Trim(),
targetConfig,
defaultConfig,
this._logger))
{
var result = configDialog.ShowDialog();
if (result == DialogResult.OK)
{
return configDialog.ResultObject as IConfig;
}
}
}
return currentConfig;
}
示例8: getInstance
/// <summary>
/// Create single instance
/// </summary>
/// <returns></returns>
public static DomainFacade getInstance(IPAccountingConfig pConfig, IPlugin pPlugin)
{
if (cInstance == null)
cInstance = new DomainFacade(pConfig, pPlugin);
return (cInstance);
}
示例9: Initialise
public override void Initialise(IPlugin plugin)
{
ICommandConsole console = plugin as ICommandConsole;
if (console == null)
return;
console.Initialize(m_defaultPrompt, m_source, m_baseOpenSim);
}
示例10: Register
/// <summary>
/// 注册一个插件
/// </summary>
public bool Register(IPlugin vPlug)
{
/*
ListBoxItem item = new ListBoxItem();
item.MouseDoubleClick += NewLoad;
list1.Items.Add(vPlug.PlugName);*/
try
{
this.regPluginList.Add(vPlug);//添加到已注册列表
GridItem button = new GridItem("Image/fullbox_desk_clear.png", vPlug.PlugName);
int pluNum = this.regPluginList.Count;
int x = (pluNum - 1) % 6;
int y = (pluNum - 1) / 6;
AddToGrid(button, x, y);
//----超出部分未处理
return true;
}
catch (Exception ex)
{
MessageBox.Show(ex.ToString());
return false;
}
}
示例11: DomainFacade
/// <summary>
///
/// </summary>
private DomainFacade(IPAccountingConfig pConfig, IPlugin pPlugin)
{
cPlugin = pPlugin;
cRecordList = new List<AccountingItem>();
cObserverList = new List<IObserver>();
cInfrastructure = InfrastructureFacade.getInstance(pConfig, pPlugin, ref cRecordList);
}
示例12: DomainFacade
/// <summary>
///
/// </summary>
public DomainFacade(ProxyConfig pProxyConfig, IPlugin pPlugin)
{
cPlugin = pPlugin;
cRecordList = new List<IMAP4Account>();
cObserverList = new List<IObserver>();
cInfrastructure = InfrastructureFacade.getInstance(pProxyConfig, pPlugin);
}
示例13: PluginTreeNode
public PluginTreeNode(Type type)
{
_type = type;
_instance = (IPlugin)Activator.CreateInstance(_type);
IPluginData[] data = _instance.GetData();
foreach (IPluginData item in data)
{
if (item.Children == null)
{
Nodes.Add(new LeafTreeNode(item));
}
else
{
int i = Nodes.Add(new BranchTreeNode(item));
var newNode = Nodes[i];
foreach (IPluginData childItem in item.Children)
{
if (childItem.Children == null)
{
newNode.Nodes.Add(new LeafTreeNode(childItem));
}
else
{
newNode.Nodes.Add(new BranchTreeNode(childItem));
}
}
}
}
Text = DisplayName;
}
示例14: Battle
public Battle(IEnumerable<IEnumerable<Character>> teams, IPlugin interopPlugin, IJSScriptHelper scriptHelper, IRandomHelper randomHelper)
{
if(teams == null)
{
throw new ArgumentNullException(nameof(teams));
}
if(interopPlugin == null)
{
throw new ArgumentNullException(nameof(interopPlugin));
}
if(scriptHelper == null)
{
throw new ArgumentNullException(nameof(scriptHelper));
}
if(randomHelper == null)
{
throw new ArgumentNullException(nameof(randomHelper));
}
this.AllCharactersInTeams = new Dictionary<string, ICollection<SpecificCharacter>>();
foreach (var team in teams)
{
var teamCharacters = (ICollection<SpecificCharacter>)team.Select(x => new SpecificCharacter(x));
this.AllCharactersInTeams.Add("team", teamCharacters);
}
this.InteropPlugin = interopPlugin;
this.ScriptHelper = scriptHelper;
this.RandomHelper = randomHelper;
}
示例15: PluginInfo
internal PluginInfo(IPlugin plugin, string description, string pluginRoot, Assembly assembly)
{
Plugin = plugin;
Description = description;
PluginRoot = pluginRoot;
Assembly = assembly;
}