Esempio n. 1
0
        /// <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();

            this.NuGetManager      = new SlowCheetahNuGetManager(this);
            this.PackageLogger     = new SlowCheetahPackageLogger(this);
            this.ErrorListProvider = new ErrorListProvider(this);
            this.AddCommand        = new AddTransformCommand(this, this.NuGetManager, this.PackageLogger);
            this.PreviewCommand    = new PreviewTransformCommand(this, this.NuGetManager, this.PackageLogger, this.ErrorListProvider);
            this.SolutionEvents    = new PackageSolutionEvents(this);
        }
        /// <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>
        /// <param name="cancellationToken">Cancellation token.</param>
        /// <param name="progress">Package load progress provider.</param>
        /// <returns>Async task.</returns>
        protected override async System.Threading.Tasks.Task InitializeAsync(CancellationToken cancellationToken, IProgress <ServiceProgressData> progress)
        {
            await base.InitializeAsync(cancellationToken, progress);

            // Initialize the properties
            this.NuGetManager      = new SlowCheetahNuGetManager(this);
            this.PackageLogger     = new SlowCheetahPackageLogger(this);
            this.ErrorListProvider = new ErrorListProvider(this);
            this.AddCommand        = new AddTransformCommand(this, this.NuGetManager, this.PackageLogger);
            this.PreviewCommand    = new PreviewTransformCommand(this, this.NuGetManager, this.PackageLogger, this.ErrorListProvider);
            this.SolutionEvents    = new PackageSolutionEvents(this, this.ErrorListProvider);

            // Asynchronously register the commands and solution events
            await this.AddCommand.RegisterCommandAsync();

            await this.PreviewCommand.RegisterCommandAsync();

            await this.SolutionEvents.RegisterEventsAsync();
        }