示例#1
0
 public void OnDisconnection(ext_DisconnectMode disconnectMode, ref Array custom)
 {
     try
     {
         if(disconnectMode == ext_DisconnectMode.ext_dm_HostShutdown ||
            disconnectMode == ext_DisconnectMode.ext_dm_UserClosed)
         {
             if(_builder != null)
             {
                 _builder.disconnect();
                 _builder.Dispose();
                 _builder = null;
             }
         }
     }
     catch(Exception ex)
     {
         Util.unexpectedExceptionWarning(ex);
         throw;
     }
 }
示例#2
0
        public void OnConnection(object application, ext_ConnectMode connectMode, object addInInst, ref Array custom)
        {
            try
            {
                _applicationObject = (DTE2)application;
                _addInInstance = (AddIn)addInInst;

                if(connectMode == ext_ConnectMode.ext_cm_Startup || connectMode == ext_ConnectMode.ext_cm_CommandLine)
                {
                    if(_builder == null)
                    {

                        //
                        // This property is set to false to avoid VC++ "no matching rule" dialog, the property
                        // doesn't exist in VS2010
                        //
            #if VS2008
                        EnvDTE.Properties props = _applicationObject.get_Properties("Projects", "VCGeneral");
                        EnvDTE.Property prop = props.Item("ShowNoMatchingRuleDlg");
                        prop.Value = false;
            #endif
                        _builder = new Builder();
                        _builder.commandLine = connectMode == ext_ConnectMode.ext_cm_CommandLine;
                        _builder.init(_applicationObject, connectMode, _addInInstance);
                    }
                }
            }
            catch(Exception ex)
            {
                Util.unexpectedExceptionWarning(ex);
                throw;
            }
        }