你如何标注类,类型转换器,是不是在参考答案? [英] How do you mark class with TypeConverter that is not in referenced solution?

查看:96
本文介绍了你如何标注类,类型转换器,是不是在参考答案?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有,我已经写了一个类型转换器的一类。我想保持类型转换器独立于主解决方案,因为它是只需要在设计时,并有一个扩展项目现在包含的类型转换器。因此,当余部署,我并不需要部署的可扩展部件在所有的

不过,我无法找出适当的字符串使用的属性实际上是类连接器。注意:我不能使用这样的:

  [类型转换器(typeof运算(MyConverter)
 

因为MyConverter是在未被引用的项目。我需要使用字符串超载,但想不出用什么:

  [类型转换器(你到底去这里!)
 

我想我需要也许是路径组件,也许一个GUID,类名......只是不知道......

解决方案

  [类型转换器(类型名,AssemblyFullName)]
 

I have a class that I've written a TypeConverter for. I want to keep the TypeConverter separate from the main solution, as it is only needed at design time and have an extensibility project now that contains the TypeConverter. Thus, when I deploy, I don't need to deploy the extensibility assembly at all.

However, I can't figure out the appropriate string to use in the attribute to actually connect the class to the converter. Note I can't use this:

[TypeConverter(typeof(MyConverter)]

because MyConverter is in a project that isn't referenced. I need to use the string overload, but can't figure out what to use:

[TypeConverter("what the heck goes in here!")]

I think I need maybe a path to the assembly, maybe a GUID, the class name...just not sure...

解决方案

[TypeConverter("TypeName, AssemblyFullName")] 

这篇关于你如何标注类,类型转换器,是不是在参考答案?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆