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();
        }
Exemplo n.º 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
        }
 /// <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()
 {
     SmartCreateClassCommand.Initialize(this);
     SettingsCommand.Initialize(this);
     base.Initialize();
 }
Exemplo n.º 4
0
        ///// <summary>
        ///// Initializes a new instance of the <see cref="VsPackage"/> class.
        ///// </summary>
        //public VsPackage()
        //{
        // Inside this method you can place any initialization code that does not require
        // any Visual Studio service because at this point the package object is created but
        // not sited yet inside Visual Studio environment. The place to do all the other
        // initialization is the Initialize method.
        //}

        #region Package Members

        /// <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()
        {
            base.Initialize();
            SettingsCommand.Initialize(this);
        }