Esempio n. 1
0
        private void ExecuteStudioShellCommand()
        {
            if (null == Shell)
            {
                var resourceManager = new ResourceManager(StudioshellResources,
                                                          Assembly.GetExecutingAssembly());
                _statusBarAnimation = new StatusBarAnimationState(_applicationObject);

                switch (Settings.ConsoleChoice)
                {
                case (ConsoleChoice.OldSkool):
                    InitializeOldSkoolShell();
                    break;

                case (ConsoleChoice.StudioShell):
                    InitializeInternalConsole(resourceManager);
                    break;

                default:

                    break;
                }
            }

            if (null != _toolWindow)
            {
                _toolWindow.Visible = true;
            }
        }
Esempio n. 2
0
		/// <summary>Implements the OnConnection method of the IDTExtensibility2 interface. Receives notification that the Add-in is being loaded.</summary>
		/// <param term='application'>Root object of the host application.</param>
		/// <param term='connectMode'>Describes how the Add-in is being loaded.</param>
		/// <param term='addInInst'>Object representing this Add-in.</param>
		/// <seealso class='IDTExtensibility2' />
		public void OnConnection(object application, ext_ConnectMode connectMode, object addInInst, ref Array custom)
		{
		    AddIn addIn = addInInst as AddIn;
		    var name = addIn.Name;
		    var progid = addIn.ProgID;
            
			_applicationObject = (DTE2)application;
			_addInInstance = (AddIn)addInInst;
            _statusBarAnimation = new StatusBarAnimationState(_applicationObject);            

            var sp = new ServiceProvider(_applicationObject as Microsoft.VisualStudio.OLE.Interop.IServiceProvider);

		    Locator.Set<DTE2>(_applicationObject);
		    Locator.Set<AddIn>(_addInInstance);
		    Locator.Set<IServiceProvider>(sp);

            if( null == ApplicationObject )
            {
                ApplicationObject = _applicationObject;
            }

            if( null == AddInInstance)
            {
                AddInInstance = _addInInstance;
            }

            switch( connectMode )
            {
                case( ext_ConnectMode.ext_cm_UISetup):
                    RunUISetup();
                    break;
                
                case (ext_ConnectMode.ext_cm_Startup):
                case( ext_ConnectMode.ext_cm_AfterStartup):
                    RemoveScriptCommands();
                    if (Settings.RunStudioShellOnStartup)
                    {
                        ExecuteStudioShellCommand();
                    }
                    break;
                
                default:
                    break;
            }            
		}
Esempio n. 3
0
        /// <summary>Implements the OnConnection method of the IDTExtensibility2 interface. Receives notification that the Add-in is being loaded.</summary>
        /// <param term='application'>Root object of the host application.</param>
        /// <param term='connectMode'>Describes how the Add-in is being loaded.</param>
        /// <param term='addInInst'>Object representing this Add-in.</param>
        /// <seealso class='IDTExtensibility2' />
        public void OnConnection(object application, ext_ConnectMode connectMode, object addInInst, ref Array custom)
        {
            AddIn addIn  = addInInst as AddIn;
            var   name   = addIn.Name;
            var   progid = addIn.ProgID;

            _applicationObject  = (DTE2)application;
            _addInInstance      = (AddIn)addInInst;
            _statusBarAnimation = new StatusBarAnimationState(_applicationObject);

            var sp = new ServiceProvider(_applicationObject as Microsoft.VisualStudio.OLE.Interop.IServiceProvider);

            Locator.Set <DTE2>(_applicationObject);
            Locator.Set <AddIn>(_addInInstance);
            Locator.Set <IServiceProvider>(sp);

            if (null == ApplicationObject)
            {
                ApplicationObject = _applicationObject;
            }

            if (null == AddInInstance)
            {
                AddInInstance = _addInInstance;
            }

            switch (connectMode)
            {
            case (ext_ConnectMode.ext_cm_UISetup):
                RunUISetup();
                break;

            case (ext_ConnectMode.ext_cm_Startup):
            case (ext_ConnectMode.ext_cm_AfterStartup):
                RemoveScriptCommands();
                if (Settings.RunStudioShellOnStartup)
                {
                    ExecuteStudioShellCommand();
                }
                break;

            default:
                break;
            }
        }
Esempio n. 4
0
	    private void ExecuteStudioShellCommand()
	    {
	        if (null == Shell)
	        {
	            var resourceManager = new ResourceManager(StudioshellResources,
	                                                      Assembly.GetExecutingAssembly());
	            _statusBarAnimation = new StatusBarAnimationState(_applicationObject);

	            switch (Settings.ConsoleChoice)
	            {
	                case (ConsoleChoice.OldSkool):
	                    InitializeOldSkoolShell();
	                    break;
	                case( ConsoleChoice.StudioShell):
	                    InitializeInternalConsole(resourceManager);
	                    break;
	                default:
                                    
	                    break;
	            }
	        }

	        if (null != _toolWindow)
	        {
	            _toolWindow.Visible = true;
	        }
	    }