Ejemplo n.º 1
0
        private void NuGetOnPackageInstalled(NuGetInstallResult installResult)
        {
            if (installResult.References.Count == 0)
            {
                return;
            }

            var text = string.Join(Environment.NewLine,
                                   installResult.References.Distinct().Select(r => Path.Combine(MainViewModel.NuGetPathVariableName, r))
                                   .Concat(installResult.FrameworkReferences.Distinct())
                                   .Where(r => !_roslynHost.HasReference(_viewModel.DocumentId, r))
                                   .Select(r => "#r \"" + r + "\"")) + Environment.NewLine;

            Dispatcher.InvokeAsync(() => Editor.Document.Insert(0, text, AnchorMovementType.Default));
        }
Ejemplo n.º 2
0
        private void NuGetOnPackageInstalled(NuGetInstallResult installResult)
        {
            if (installResult.References.Count == 0)
            {
                return;
            }

            Dispatcher.InvokeAsync(() =>
            {
                var text = string.Join(Environment.NewLine,
                                       installResult.References.Distinct().OrderBy(c => c)
                                       .Select(r => Path.Combine(MainViewModel.NuGetPathVariableName, r))
                                       .Concat(installResult.FrameworkReferences.Distinct())
                                       .Where(r => !_viewModel.MainViewModel.RoslynHost.HasReference(_viewModel.DocumentId, r))
                                       .Select(r => "#r \"" + r + "\"")
                                       .Where(r => Editor.Text.IndexOf(r, StringComparison.OrdinalIgnoreCase) < 0));

                if (text.Length > 0)
                {
                    Editor.Document.Insert(0, text + Environment.NewLine, AnchorMovementType.Default);
                }
            });
        }
Ejemplo n.º 3
0
 private void OnPackageInstalled(NuGetInstallResult result)
 {
     PackageInstalled?.Invoke(result);
 }
Ejemplo n.º 4
0
 private void OnPackageInstalled(IPackage package, NuGetInstallResult result)
 {
     PackageInstalled?.Invoke(package, result);
 }