R
Rudolf Ball
Hi NG,
I have an interesting problem. I have written a simple AddIn-Framework where
I load Assemblies in with
Assembly.LoadFrom(...
Now I want to globalize the Plugins, so I have written a routine like this:
public Globalizator(Object obj)
{
this.obj = obj;
}
public void Translate(string baseName)
{
if (null == obj)
return ;
Type t = obj.GetType();
String str = t.FullName;
ResourceManager rm = new ResourceManager(baseName, t.Assembly);
// Instance properites.
PropertyInfo [] pi = t.GetProperties (BindingFlags.Instance |
BindingFlags.Public);
foreach (PropertyInfo p in pi)
{
try
{
string resName = t.FullName + '.' + p.Name;
Object resObj = rm.GetObject(resName);
if (resObj != null)
if (p.CanWrite)
t.GetProperty(p.Name).SetValue(obj, resObj, null);
}
catch (Exception e)
....
So, loading in the Plugin does not work! Has anybody an idea why?
Thank you
Rudi
I have an interesting problem. I have written a simple AddIn-Framework where
I load Assemblies in with
Assembly.LoadFrom(...
Now I want to globalize the Plugins, so I have written a routine like this:
public Globalizator(Object obj)
{
this.obj = obj;
}
public void Translate(string baseName)
{
if (null == obj)
return ;
Type t = obj.GetType();
String str = t.FullName;
ResourceManager rm = new ResourceManager(baseName, t.Assembly);
// Instance properites.
PropertyInfo [] pi = t.GetProperties (BindingFlags.Instance |
BindingFlags.Public);
foreach (PropertyInfo p in pi)
{
try
{
string resName = t.FullName + '.' + p.Name;
Object resObj = rm.GetObject(resName);
if (resObj != null)
if (p.CanWrite)
t.GetProperty(p.Name).SetValue(obj, resObj, null);
}
catch (Exception e)
....
So, loading in the Plugin does not work! Has anybody an idea why?
Thank you
Rudi