M
Mario Vázquez
Hi,
I've wrote the following lines of code to open the "Add Connection" dialog
of the IDE at design time.
EnvDTE.DTE d = (EnvDTE.DTE)this.Site.GetService(typeof(EnvDTE.DTE));
// Find first the path of the current project (there is a more elegant way?)
object[] o = (object[])d.ActiveSolutionProjects;
EnvDTE.Project prj = (EnvDTE.Project)o[0];
string prjPath = prj.FullName;
prjPath = prjPath.Substring( 0, prjPath.LastIndexOf("\\") + 1 );
if (this.DesignMode && !System.IO.File.Exists( prjPath + "App.Config" ))
throw new Exception( "App.config not found." ); }
// Open the create connection dialog.
d.ExecuteCommand( "Tools.ConnectToDataBase", "" );
It works nice but, I don't know how to achieve the connection string created
by the user :S
How to do it?
I don't have either any idea of which arguments are supposed to be passed to
the ExecuteCommand method, because help doesn't help too much...
Where can I found documentation about the DTE?
Thanks,
Mvr
I've wrote the following lines of code to open the "Add Connection" dialog
of the IDE at design time.
EnvDTE.DTE d = (EnvDTE.DTE)this.Site.GetService(typeof(EnvDTE.DTE));
// Find first the path of the current project (there is a more elegant way?)
object[] o = (object[])d.ActiveSolutionProjects;
EnvDTE.Project prj = (EnvDTE.Project)o[0];
string prjPath = prj.FullName;
prjPath = prjPath.Substring( 0, prjPath.LastIndexOf("\\") + 1 );
if (this.DesignMode && !System.IO.File.Exists( prjPath + "App.Config" ))
throw new Exception( "App.config not found." ); }
// Open the create connection dialog.
d.ExecuteCommand( "Tools.ConnectToDataBase", "" );
It works nice but, I don't know how to achieve the connection string created
by the user :S
How to do it?
I don't have either any idea of which arguments are supposed to be passed to
the ExecuteCommand method, because help doesn't help too much...
Where can I found documentation about the DTE?
Thanks,
Mvr