dll 的类型转换器
我将 propertygrid 与类和关联的类型转换器一起使用。 当我将类和 TypeConverter 移动到 dll 时,它似乎没有被调用。 找不到如何从 dll 激活类型转换器。
Assembly a = Assembly.LoadFile(modulepath + elementname + ".dll");
try
{
object myobj = a.CreateInstance(objectname);
Type objecttype = myobj.GetType();
}
感谢任何提示。谢谢。
I am using the propertygrid with a class and associated type converter.
When I moved the class and the TypeConverter to a dll, it seems that it is not being called.
Can't find how to activate the typeconverter from a dll.
Assembly a = Assembly.LoadFile(modulepath + elementname + ".dll");
try
{
object myobj = a.CreateInstance(objectname);
Type objecttype = myobj.GetType();
}
Appreciate any hints. Thank you.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
这可能是因为 Assembly.LoadFile 在不同的 绑定中加载文件其余代码中的上下文。
It could be because Assembly.LoadFile loads the file in a different binding context from the rest of your code.
您的类中是否有类似的东西:
通常只要该类具有与其关联的类型转换器,它就应该选择它。
Do you have something like this in place on your class:
Usually as long as the class has the typeconverter associated with it it should pick it up.