私はこのコードを行います:
`public void OnConnection(object application, ext_ConnectMode connectMode, object addInInst, ref Array custom)
{
_applicationObject = (DTE2)application;
_addInInstance = (AddIn)addInInst;
if(connectMode == ext_ConnectMode.ext_cm_UISetup)
{
object[] contextGUIDS = new object[] { };
Commands2 commands = (Commands2)_applicationObject.Commands;
CommandBar SECommandBar = ((CommandBars)_applicationObject.CommandBars)["Context Menus"];
CommandBarPopup SEPopUps = (CommandBarPopup)SECommandBar.Controls["Project and Solution Context Menus"];
CommandBarPopup oCommandBar = (CommandBarPopup)SEPopUps.Controls["Project"];
CommandBarControl oControl = (CommandBarControl)
oCommandBar.Controls.Add(MsoControlType.msoControlButton,
System.Reflection.Missing.Value,
System.Reflection.Missing.Value, 1, true);
// Set the caption of the menuitem
oControl.Caption = "Create Documentation";
oSubMenuItemHandler = _applicationObject.Events.get_CommandBarEvents(oControl) as CommandBarEventsClass;
oSubMenuItemHandler.Click+=new _dispCommandBarControlEvents_ClickEventHandler(oSubMenuItemHandler_Click);
}
protected void oSubMenuItemHandler_Click(object CommandaBarControl,ref bool handled, ref bool cancelDefault)
{
// I Want to access object of selected class or interface
MessageBox.Show("Test");
}`
vs 2010でクラスの全データを反映するアドインを開発しています。全メンバデータを反映するために、選択したクラスまたはインターフェースにアクセスしたいです。誰でも私を助けて