Exemplo n.º 1
0
        /// <summary>
        /// Initializes the package right after it's been "sited" into the fully-initialized Visual Studio IDE.
        /// </summary>
        protected override void Initialize()
        {
            Logging.WriteLine("Initializing UnrealVS extension...");

            // Grab the MenuCommandService
            MenuCommandService = GetService(typeof(IMenuCommandService)) as OleMenuCommandService;

            // Get access to Visual Studio's DTE object.  This object has various hooks into the Visual Studio
            // shell that are useful for writing extensions.
            DTE = (DTE)GetGlobalService(typeof(DTE));
            Logging.WriteLine("DTE version " + DTE.Version);

            // Get selection manager and register to receive events
            SelectionManager =
                ServiceProvider.GlobalProvider.GetService(typeof(SVsShellMonitorSelection)) as IVsMonitorSelection;
            SelectionManager.AdviseSelectionEvents(this, out SelectionEventsHandle);

            // Get solution and register to receive events
            SolutionManager = ServiceProvider.GlobalProvider.GetService(typeof(SVsSolution)) as IVsSolution2;
            UpdateUnrealLoadedStatus();
            SolutionManager.AdviseSolutionEvents(this, out SolutionEventsHandle);

            // Grab the solution build manager.  We need this in order to change certain things about the Visual
            // Studio environment, like what the active startup project is
            // Get solution build manager
            SolutionBuildManager =
                ServiceProvider.GlobalProvider.GetService(typeof(SVsSolutionBuildManager)) as IVsSolutionBuildManager2;
            SolutionBuildManager.AdviseUpdateSolutionEvents(this, out UpdateSolutionEventsHandle);

            // Create our command-line editor
            CommandLineEditor = new CommandLineEditor();

            // Create our startup project selector
            StartupProjectSelector = new StartupProjectSelector();

            // Create 'BuildStartupProject' instance
            BuildStartupProject = new BuildStartupProject();

            // Create 'CompileSingleFile' instance
            CompileSingleFile = new CompileSingleFile();

            // Create 'GenerateProjectFiles' tools
            GenerateProjectFiles = new GenerateProjectFiles();

            // Create Batch Builder tools
            BatchBuilder = new BatchBuilder();

            // Create the project menu quick builder
            QuickBuilder = new QuickBuild();

            // Call parent implementation
            base.Initialize();

            if (DTE.Solution.IsOpen)
            {
                StartTicker();
            }
        }
Exemplo n.º 2
0
		/// <summary>
		/// Initializes the package right after it's been "sited" into the fully-initialized Visual Studio IDE.
		/// </summary>
		protected override void Initialize()
		{
			Logging.WriteLine("Initializing UnrealVS extension...");

			// Grab the MenuCommandService
			MenuCommandService = GetService( typeof( IMenuCommandService ) ) as OleMenuCommandService;
			
			// Get access to Visual Studio's DTE object.  This object has various hooks into the Visual Studio
			// shell that are useful for writing extensions.
			DTE = (DTE)GetGlobalService( typeof( DTE ) );
			Logging.WriteLine("DTE version " + DTE.Version);

			// Get selection manager and register to receive events
			SelectionManager =
				ServiceProvider.GlobalProvider.GetService(typeof (SVsShellMonitorSelection)) as IVsMonitorSelection;
			SelectionManager.AdviseSelectionEvents( this, out SelectionEventsHandle );

			// Get solution and register to receive events
			SolutionManager = ServiceProvider.GlobalProvider.GetService( typeof( SVsSolution ) ) as IVsSolution2;
			UpdateUnrealLoadedStatus();
			SolutionManager.AdviseSolutionEvents( this, out SolutionEventsHandle );

			// Grab the solution build manager.  We need this in order to change certain things about the Visual
			// Studio environment, like what the active startup project is
			// Get solution build manager
			SolutionBuildManager =
				ServiceProvider.GlobalProvider.GetService(typeof (SVsSolutionBuildManager)) as IVsSolutionBuildManager2;
			SolutionBuildManager.AdviseUpdateSolutionEvents(this, out UpdateSolutionEventsHandle);

			// Create our command-line editor
			CommandLineEditor = new CommandLineEditor();

			// Create our startup project selector
			StartupProjectSelector = new StartupProjectSelector();

			// Create 'BuildStartupProject' instance
			BuildStartupProject = new BuildStartupProject();

			// Create 'GenerateProjectFiles' tools
			GenerateProjectFiles = new GenerateProjectFiles();

			// Create Batch Builder tools
			BatchBuilder = new BatchBuilder();

			// Create the project menu quick builder
			QuickBuilder = new QuickBuild();

			// Call parent implementation
			base.Initialize();

			if (DTE.Solution.IsOpen)
			{
				StartTicker();
			}
		}
Exemplo n.º 3
0
		/// <summary>
		/// Initializes the package right after it's been "sited" into the fully-initialized Visual Studio IDE.
		/// </summary>
		protected override void Initialize()
		{
			Trace.WriteLine( "Initializing UnrealVS extension..." );

			// Grab the MenuCommandService
			MenuCommandService = GetService( typeof( IMenuCommandService ) ) as OleMenuCommandService;
			
			// Get access to Visual Studio's DTE object.  This object has various hooks into the Visual Studio
			// shell that are useful for writing extensions.
			DTE = (DTE)GetGlobalService( typeof( DTE ) );

			// Get selection manager and register to receive events
			SelectionManager =
				ServiceProvider.GlobalProvider.GetService(typeof (SVsShellMonitorSelection)) as IVsMonitorSelection;
			SelectionManager.AdviseSelectionEvents( this, out SelectionEventsHandle );

			// Get solution and register to receive events
			SolutionManager = ServiceProvider.GlobalProvider.GetService( typeof( SVsSolution ) ) as IVsSolution2;
			SolutionManager.AdviseSolutionEvents( this, out SolutionEventsHandle );

			// Grab the solution build manager.  We need this in order to change certain things about the Visual
			// Studio environment, like what the active startup project is
			// Get solution build manager
			SolutionBuildManager =
				ServiceProvider.GlobalProvider.GetService(typeof (SVsSolutionBuildManager)) as IVsSolutionBuildManager2;
			SolutionBuildManager.AdviseUpdateSolutionEvents(this, out UpdateSolutionEventsHandle);

			// Create our command-line editor
			CommandLineEditor = new CommandLineEditor();

			// Create our startup project selector
			StartupProjectSelector = new StartupProjectSelector();

			// Create 'BuildStartupProject' instance
			BuildStartupProject = new BuildStartupProject();

			// Create 'GenerateProjectFiles' tools
			GenerateProjectFiles = new GenerateProjectFiles();

			// Create Batch Builder tools
			BatchBuilder = new BatchBuilder();

			// Create a "ticker" on a background thread that ticks the package on the UI thread
			Ticker = new Thread(TickAsyncMain);
			Ticker.Priority = ThreadPriority.Lowest;
			Ticker.Start();

			// Call parent implementation
			base.Initialize();
		}