Ejemplo 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()
        {
            ThreadHelper.ThrowIfNotOnUIThread();
            VsHelper.Initialize(this);
            ScriptGenAssemblyCache.TryClearCache();

            _buildEvents = VsHelper.Current.Dte.Events.BuildEvents;
            _buildEvents.OnBuildBegin += BuildEvents_OnBuildBegin;
            _buildEvents.OnBuildDone  += BuildEvents_OnBuildDone;
            AddConfigCommand.Initialize(this);
            GenerateScriptsCommand.Initialize(this);
            InstallNugetPackageCommand.Initialize(this);
            ClearCacheCommand.Initialize(this);
            base.Initialize();
        }
Ejemplo n.º 2
0
        protected async override System.Threading.Tasks.Task InitializeAsync(CancellationToken cancellationToken, IProgress <ServiceProgressData> progress)
        {
            ScriptGenAssemblyCache.TryClearCache();

            await JoinableTaskFactory.SwitchToMainThreadAsync(cancellationToken);

            VsHelper.Initialize(this);
            _buildEvents = VsHelper.Current.Dte.Events.BuildEvents;
            _buildEvents.OnBuildBegin += BuildEvents_OnBuildBegin;
            _buildEvents.OnBuildDone  += BuildEvents_OnBuildDone;
            AddConfigCommand.Initialize(this);
            GenerateScriptsCommand.Initialize(this);
            InstallNugetPackageCommand.Initialize(this);
            DebugInfoCommand.Initialize(this);
            await base.InitializeAsync(cancellationToken, progress);

            await UpgradeConfigCommand.InitializeAsync(this);
        }