Hello,
I post a new message because I am novice in Visual Studio Add-In and I
cannot found any help to do what I need, except standard samples to create a
item in menu that lunch a command.
I am building a data access framework and I would like to create an Add-In
in Visual Studio that handle any changes in project files of given type
(exemple: "*.requests"), then, parse the file and generate a class in project
that is automatically available for intellisense.
Now a example:
In file "Client.requests", programmers write all SQL needed to manage
Client. The content of the file is something like that:
----------------------------------------
LoadClient,"Select * From Client Where ClientId = @ClientId"
LoadClientRegion,"Select * From Client Where RegionCode = @RegionCode"
LoadGoodClient,"Select TOP 10 * From Client OrderBy TotalAmount Desc"
DisableClient,"Exec DisableClient @ClientId"
...
----------------------------------------
When the file is saved, I would like the Add-In parse the file and generate
a .cs file like that:
----------------------------------------
public class LoadClient : DataAccessBase {
public LoadClient() {
this.Sql = "Select * From Client Where ClientId = @ClientId"
}
public object ClientId {
get { return this.Params["ClientId"]; }
set { this.Params["ClientId"] = value; }
}
}
public class LoadClientRegion : DataAccessBase {
public LoadClientRegion () {
this.Sql = "Select * From Client Where RegionCode = @RegionCode"
}
public object RegionCode {
get { return this.Params["RegionCode"]; }
set { this.Params["RegionCode"] = value; }
}
}
...
----------------------------------------
The parsing mechanism is already created but I need to integrate it in
Visual Studio like explain before.
Can somebody help me to start ?
Thanks.
Carlos J. Quintero [VB MVP] - 16 Feb 2006 09:06 GMT
Hi Ludovic,
If you want to do something when a document is saved, take a look at the
EnvDTE.DocumentEvents.DocumentSaved(...) event.
Also, you have lots of resources and HOWTO articles about add-ins in a
section of my web site (below).

Signature
Best regards,
Carlos J. Quintero
MZ-Tools: Productivity add-ins for Visual Studio
You can code, design and document much faster:
http://www.mztools.com
> Hello,
>
[quoted text clipped - 55 lines]
>
> Thanks.