473,322 Members | 1,911 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,322 software developers and data experts.

using ext_cm_Solution - never fires

I have tried to add a new command for a visual studio add-in. This command
should be added when the user loads any solution into the IDE(not at
startup). The command should disappears when the user closes the solution.

The MSDN says that ext_cm_Solution 4 The Add-in was loaded when a user
loaded a solution that required the Add-in.
So I have checked the connectmode in OnConnection method for the value
"ext_cm_Solution". Seems the caller of OnConnection never sends the value
ext_cm_Solution. I have inserted a MessageBox.Show(connectMode.ToString())
at the start of the function. I have not got the value ext_cm_Solution.

Here is my code segment
public void OnConnection(object application, Extensibility.ext_ConnectMode
connectMode, object addInInst, ref System.Array custom)

{

applicationObject = (_DTE)application;

addInInstance = (AddIn)addInInst;

MessageBox.Show(connectMode.ToString());

if(connectMode == Extensibility.ext_ConnectMode.ext_cm_Solution)

{

object []contextGUIDS = new object[] { };

Commands commands = applicationObject.Commands;

_CommandBars commandBars = applicationObject.CommandBars;

try

{

Command command = commands.AddNamedCommand(addInInstance,

"CleanCodeReviewComments",

"Clean Code Review Comments",

"Executes the command for CRAddIn",

false, 101, ref contextGUIDS,

(int)vsCommandStatus.vsCommandStatusSupported+(int )vsCommandStatus.vsCommand
StatusEnabled);

CommandBar commandBar = (CommandBar)commandBars["Tools"];

CommandBarControl commandBarControl = command.AddControl(commandBar, 1);

}

catch(System.Exception e)

{

MessageBox.Show(e.ToString());

}

}
}

Thanks,

-Seeni
Nov 22 '05 #1
2 1580
"seeni" <m_***********@hotmail.com> schrieb
I have tried to add a new command for a visual studio add-in. This
command should be added when the user loads any solution into the
IDE(not at startup). The command should disappears when the user
closes the solution.


Please post only to the appropriate groups. Thanks.
--
Armin

http://www.plig.net/nnq/nquote.html
http://www.netmeister.org/news/learn2quote.html

Nov 22 '05 #2
"seeni" <m_***********@hotmail.com> schrieb
I have tried to add a new command for a visual studio add-in. This
command should be added when the user loads any solution into the
IDE(not at startup). The command should disappears when the user
closes the solution.


Please post only to the appropriate groups. Thanks.
--
Armin

http://www.plig.net/nnq/nquote.html
http://www.netmeister.org/news/learn2quote.html

Nov 22 '05 #3

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

4
by: Josh Usovsky | last post by:
I'm setting up a watched folder using FileSystemWatcher. When I drop a small file into the watched folder, I can respond to a .Created event and process the file with other code. However, if I try...
1
by: seeni | last post by:
I have tried to add a new command for a visual studio add-in. This command should be added when the user loads any solution into the IDE(not at startup). The command should disappears when the user...
5
by: Maxine G | last post by:
I have two forms, a menu and a data entry form. The entry form is bound to a query against linked SQL server tables. In the deactivate event, I have some code which asks the user if they want to...
19
by: Heidi Hundåla | last post by:
Hi ! I have a Wep App in C#. Page_Unload fires after Page_Load, and it seems totally unreasonable when you want to use this event when you _leave_ the page. In my project we wanted to use...
1
by: vidya | last post by:
Hi, I have a button which is a web control. I have some validation in javascript for the button in .aspx file and some in the button onclick event in code behind(C#). I need to get through both...
15
by: Swetha | last post by:
Hello I have a DropDownList that I am populating using the following SqlDataSource: <asp:DropDownList ID="parentIDDropDownList" runat="server" DataSourceID="SqlDataSource3"...
9
by: J055 | last post by:
Hi I'm trying to get an instance of UserLists to persist after it's been used by the GridView. I understand from the documentation that The OnObjectCreated event allows access to the instance. I...
6
by: Joseph Geretz | last post by:
I'm porting a C# Outlook Addin originally engineered as a COM Addin over to use VSTO. I've gotten this to the point where my VSTO Addin installs its Menu items and Toolbar buttons when Outlook...
1
by: Dave | last post by:
I have a listview control in a form, and I use the mousemove event (to set a tooltip). This worked fine in VS2003, but when I ported it to VS2005 I found that when the mouse hovers over a populated...
0
by: slemen | last post by:
My GridView is bound in VB code to a DataTable. The RowUpdating event fires when the row's Update linkbutton is clicked and the row contains the old, pre-edited values (as is expected.) ...
0
by: DolphinDB | last post by:
Tired of spending countless mintues downsampling your data? Look no further! In this article, you’ll learn how to efficiently downsample 6.48 billion high-frequency records to 61 million...
0
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
1
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
0
by: Vimpel783 | last post by:
Hello! Guys, I found this code on the Internet, but I need to modify it a little. It works well, the problem is this: Data is sent from only one cell, in this case B5, but it is necessary that data...
0
by: jfyes | last post by:
As a hardware engineer, after seeing that CEIWEI recently released a new tool for Modbus RTU Over TCP/UDP filtering and monitoring, I actively went to its official website to take a look. It turned...
1
by: Defcon1945 | last post by:
I'm trying to learn Python using Pycharm but import shutil doesn't work
1
by: Shællîpôpï 09 | last post by:
If u are using a keypad phone, how do u turn on JavaScript, to access features like WhatsApp, Facebook, Instagram....
0
by: af34tf | last post by:
Hi Guys, I have a domain whose name is BytesLimited.com, and I want to sell it. Does anyone know about platforms that allow me to list my domain in auction for free. Thank you
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome former...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.