protected override async Task InitializeAsync(CancellationToken cancellationToken, IProgress <ServiceProgressData> progress)
        {
            await base.InitializeAsync(cancellationToken, progress).ConfigureAwait(true);

            await JoinableTaskFactory.SwitchToMainThreadAsync(cancellationToken);

            IntegrationTestServiceCommands.Initialize(this);
        }
        protected override async Task InitializeAsync(CancellationToken cancellationToken, IProgress <ServiceProgressData> progress)
        {
            await base.InitializeAsync(cancellationToken, progress).ConfigureAwait(true);

            await JoinableTaskFactory.SwitchToMainThreadAsync(cancellationToken);

            var shell = (IVsShell) await GetServiceAsync(typeof(SVsShell));

            ErrorHandler.ThrowOnFailure(shell.IsPackageInstalled(s_compilerPackage, out var installed));
            if (installed != 0)
            {
                await((IVsShell7)shell).LoadPackageAsync(s_compilerPackage);
            }

            IntegrationTestServiceCommands.Initialize(this);
        }
Esempio n. 3
0
        protected override void Initialize()
        {
            base.Initialize();
            IntegrationTestServiceCommands.Initialize(this);

            var shell = (IVsShell)GetService(typeof(SVsShell));

            if (ErrorHandler.Succeeded(shell.GetProperty((int)__VSSPROPID.VSSPROPID_InstallDirectory, out var installDirectoryObject)))
            {
                if (installDirectoryObject is string installDirectory)
                {
                    if (!File.Exists(Path.Combine(installDirectory, @"PublicAssemblies\Microsoft.VisualStudio.CodingConventions.dll")))
                    {
                        AppDomain.CurrentDomain.AssemblyResolve += ResolveAssemblyForCurrentDomain;
                    }
                }
            }
        }
 public static void Initialize(Package package)
 {
     Instance = new IntegrationTestServiceCommands(package);
 }
 protected override void Initialize()
 {
     base.Initialize();
     IntegrationTestServiceCommands.Initialize(this);
 }