I am writing an AddIn which, among other things, will let users add a
component derived from a base class in my library to the current VSNET
project. I'm doing this under v1.1 of the Framework using c#.
I've figured out how to add the .cs file for the derived class, but I'm
unclear about how to add the necessary resx file and associate it with the
derived .cs file. I tried simply copying the resource.resx template from the
VSNET template directory (renaming it, of course), but, while that works, it
also generates non-fatal design-time errors involving (as I recall; I'm
traveling right now) an inability to find a resource reader.
Also, while I can associate the newly-created resource file with the derived
class file (by adding the resource file to the derived class' ProjectItems
collection), I have to manually edit the application's .csproj file to change
the derived class' SubType to "Component" from "Code". How do I set the
SubType programmatically?
- Mark
Mark - 04 Mar 2005 14:17 GMT
Just to close the loop, I seem to have found an answer: forget about the resx
file, just add the source code and make sure that the added ProjectItem's
SubType is set to Component -- VSNET will automagically create the resx file.
I'm not sure why I can now set the SubType where before I couldn't. Perhaps
it had something to do with trying to add a resx file. In any event, simply
calling Properties("SubType").Value = "Component" on the newly-created
ProjectItem does the trick.
> I am writing an AddIn which, among other things, will let users add a
> component derived from a base class in my library to the current VSNET
[quoted text clipped - 14 lines]
>
> - Mark
iret - 08 Mar 2005 05:45 GMT
Hi, Mark.
I wanna make a similar tool as you described one. But I don't know how to
start with. Would you share some guide with me?
Thanks in advance.
> Just to close the loop, I seem to have found an answer: forget about the resx
> file, just add the source code and make sure that the added ProjectItem's
[quoted text clipped - 23 lines]
> >
> > - Mark
Mark - 09 Mar 2005 05:05 GMT
I'd be glad to pass along what I've learned...which isn't much. Have you
grabbed the example off of the VSNET customization site? It's a pretty goo
dtemplate.
> Hi, Mark.
>
[quoted text clipped - 30 lines]
> > >
> > > - Mark