Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
HomeAnnouncementsFree MagazinesWhite PapersSubmit Content
Discussion GroupsASP.NETWindows FormsLanguages.NET FrameworkVisual Studio.NET
Articles.NET FrameworkASP.NETToolsWindows Forms
.NET DirectoryOpen Source ProjectsUser GroupsWeb Resources
Related Topics
Visual Basic 6SQL ServerMS AccessOther DB ProductsMS Server ProductsMore Topics ...

.NET Forum / Visual Studio.NET / Extensibility / March 2005

Tip: Looking for answers? Try searching our database.

Add Component via Custom AddIn

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
Mark - 03 Mar 2005 06:21 GMT
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

Free Magazines

Get these publications absolutely FREE for up to 12 months. There are no hidden fees and no obligation. Simply choose a title, complete the application form and submit it. Read more ...

Oracle MagazineNetwork ComputingComputer WorldBio-IT WorldeWeekInformation WeekInfosecurity
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.