LIBOMV-512 PacketToString now decodes nested properties
LIBOMV-509 Loading saved filters will prompt to apply to current session list LIBOMV-519 Adds initial support for loading GridProxy plugins (not well tested yet) git-svn-id: http://libopenmetaverse.googlecode.com/svn/libopenmetaverse/trunk@2705 52acb1d6-8a22-11de-b505-999d5b087335
This commit is contained in:
55
Programs/WinGridProxy/FormPluginManager.cs
Normal file
55
Programs/WinGridProxy/FormPluginManager.cs
Normal file
@@ -0,0 +1,55 @@
|
||||
using System;
|
||||
using System.Windows.Forms;
|
||||
using GridProxy;
|
||||
using System.Reflection;
|
||||
using System.IO;
|
||||
|
||||
namespace WinGridProxy
|
||||
{
|
||||
public partial class FormPluginManager : Form
|
||||
{
|
||||
private ProxyFrame _Frame;
|
||||
public FormPluginManager(ProxyFrame frame)
|
||||
{
|
||||
InitializeComponent();
|
||||
_Frame = frame;
|
||||
}
|
||||
|
||||
private void buttonLoadPlugin_Click(object sender, EventArgs e)
|
||||
{
|
||||
if(openFileDialog1.ShowDialog() == DialogResult.OK)
|
||||
{
|
||||
LoadPlugin(openFileDialog1.FileName);
|
||||
}
|
||||
}
|
||||
public void LoadPlugin(string name)
|
||||
{
|
||||
|
||||
Assembly assembly = Assembly.LoadFile(Path.GetFullPath(name));
|
||||
foreach (Type t in assembly.GetTypes())
|
||||
{
|
||||
try
|
||||
{
|
||||
if (t.IsSubclassOf(typeof(ProxyPlugin)))
|
||||
{
|
||||
ConstructorInfo info = t.GetConstructor(new Type[] { typeof(ProxyFrame) });
|
||||
ProxyPlugin plugin = (ProxyPlugin)info.Invoke(new object[] { _Frame });
|
||||
plugin.Init();
|
||||
listView1.Items.Add(new ListViewItem(new []{assembly.ManifestModule.Name, Path.GetFullPath(name)}));
|
||||
}
|
||||
}
|
||||
catch (Exception e)
|
||||
{
|
||||
Console.WriteLine(e.ToString());
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
private void buttonClose_Click(object sender, EventArgs e)
|
||||
{
|
||||
this.Close();
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user