In Visual Studio .NET projects you can create .resx files that contain resources which can be localized. Out of the box Visual Studio recognizes Strings, Images, Icons, Audio, Files and something called "Other" which I don't really understand.
What I want to know - can I extend Visual Studio and add a custom type here - say "Messages" (where a message would contain not only text, but also severity and other flags)? Naturally I would need to provide Visual Studio with my own editor and handle the necessary codebehind genereation, etc - but that's all doable. That is, if Visual Studio allows this sort of extensibility at all. Does it? And if yes, where can I find any documentation on it?
P.S. I'm using Visual Studio 2012.
Yes, this is entirely possible. In order to do this, the type you want to include has to have a TypeConverter
that can convert to and from InstanceDescriptor
. There is an example of this on MSDN.
Once you have the TypeConverter
created, you adorn the type with a TypeConverterAttribute
to tell the framework to use that type converter.
For example:
[TypeConverter(typeof(MyTypeConverter)]
public class MyType
{
...
}
Then you can persist values of that type into and out of the resx files.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With