protected override void Initialize()
        {
            GlobalContext.Properties["package"] = this;
            CheckCommandLine();
            Logger.Initialise(IsCommandLine);
            SettingsCommand.Initialize(this);
            VersionCommand.Initialize(this);

            _buildVersionIncrementor = new BuildVersionIncrementor(this);
            _buildEvents             = DTE.Events.BuildEvents;
            _buildVersionIncrementor.InitializeIncrementors();

            _buildEvents.OnBuildBegin += _buildVersionIncrementor.OnBuildBegin;
            _buildEvents.OnBuildDone  += _buildVersionIncrementor.OnBuildDone;



            base.Initialize();
        }
예제 #2
0
        protected override async System.Threading.Tasks.Task InitializeAsync(CancellationToken cancellationToken, IProgress <ServiceProgressData> progress)
        {
            await base.InitializeAsync(cancellationToken, progress);

            await ThreadHelper.JoinableTaskFactory.SwitchToMainThreadAsync(cancellationToken);

            GlobalContext.Properties["package"] = this;
            CheckCommandLine();
            Logger.Initialise(IsCommandLine);
            SettingsCommand.Initialize(this);
            VersionCommand.Initialize(this);

            _buildVersionIncrementor = new BuildVersionIncrementor(this);
            _buildEvents             = DTE.Events.BuildEvents;
            _buildVersionIncrementor.InitializeIncrementors();

#pragma warning disable VSTHRD101 // Avoid unsupported async delegates
            _buildEvents.OnBuildBegin += async(s, e) => await _buildVersionIncrementor.OnBuildBeginAsync(s, e);

            _buildEvents.OnBuildDone += async(s, e) => await _buildVersionIncrementor.OnBuildDoneAsync(s, e);

#pragma warning restore VSTHRD101 // Avoid unsupported async delegates
        }