/////////////////////////////////////////////////////////////////////////////
        // Overridden Package Implementation
        /// <summary>
        /// Initialization of the package; this method is called right after the package is sited, so this is the place
        /// where you can put all the initialization code that rely on services provided by VisualStudio.
        /// </summary>
        protected override void Initialize()
        {
            Debug.WriteLine(string.Format(CultureInfo.CurrentCulture, "Entering Initialize() of: {0}", ToString()));
            base.Initialize();

#if MEMPROFILER
            RedGate.MemoryProfiler.Snapshot.TakeSnapshot("Initialize");
#endif

            // listen for solution events
            _solution = (IVsSolution)GetService(typeof(SVsSolution));
            ErrorHandler.ThrowOnFailure(_solution.AdviseSolutionEvents(this, out _solutionCookie));

            if (_errorListProvider == null)
            {
                _errorListProvider = new TaskProvider(this);
            }

            // Commands
            IncludeFileCommand.Initialize(this, _errorListProvider);
            DeleteFileCommand.Initialize(this, _errorListProvider);
            ExcludeFileCommand.Initialize(this, _errorListProvider);

            _dte = (DTE)GetService(typeof(SDTE));
            var events = _dte.Events;
            _buildEvents = events.BuildEvents;

            Options = (OptionsDialogPage)GetDialogPage(typeof(OptionsDialogPage));

            _buildEvents.OnBuildProjConfigBegin += BuildEventsOnOnBuildProjConfigBegin;
            _buildEvents.OnBuildProjConfigDone  += BuildEventsOnBuildProjConfigDone;
            _buildEvents.OnBuildBegin           += BuildEventsOnOnBuildBegin;
            _buildEvents.OnBuildDone            += BuildEventsOnOnBuildDone;
        }
Ejemplo n.º 2
0
 public static void Initialize(IServiceProvider serviceProvider, ErrorListProvider errorListProvider)
 {
     Instance = new ExcludeFileCommand(serviceProvider, errorListProvider);
 }