Hi NG,
I have an interesting problem. I have written a simple AddIn-Framework where
I load Assemblies in with
Assembly.LoadFr om(...
Now I want to globalize the Plugins, so I have written a routine like this:
public Globalizator(Ob ject obj)
{
this.obj = obj;
}
public void Translate(strin g 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.I nstance |
BindingFlags.Pu blic);
foreach (PropertyInfo p in pi)
{
try
{
string resName = t.FullName + '.' + p.Name;
Object resObj = rm.GetObject(re sName);
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.LoadFr om(...
Now I want to globalize the Plugins, so I have written a routine like this:
public Globalizator(Ob ject obj)
{
this.obj = obj;
}
public void Translate(strin g 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.I nstance |
BindingFlags.Pu blic);
foreach (PropertyInfo p in pi)
{
try
{
string resName = t.FullName + '.' + p.Name;
Object resObj = rm.GetObject(re sName);
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
Comment