예제 #1
0
 internal void NotifyUninstalled(PackageOperationEventArgs e)
 {
     if (PackageUninstalled != null)
     {
         PackageUninstalled(new VsPackageMetadata(e.Package, e.InstallPath));
     }
 }
예제 #2
0
 internal void NotifyInstalling(PackageOperationEventArgs e)
 {
     if (PackageInstalling != null)
     {
         PackageInstalling(new VsPackageMetadata(e.Package, e.InstallPath));
     }
 }
예제 #3
0
        protected override void OnUninstalled(PackageOperationEventArgs e)
        {
            base.OnUninstalled(e);

            PackageEvents.NotifyUninstalled(e);
            _deleteOnRestartManager.MarkPackageDirectoryForDeletion(e.Package);
        }
        private void OnPackageReferenceRemoving(object sender, PackageOperationEventArgs e)
        {
            var projectManager = (IProjectManager)sender;

            Project project;
            if (!_projectManagerToProject.TryGetValue(projectManager, out project))
            {
                throw new ArgumentException(Resources.Cmdlet_InvalidProjectManagerInstance, "sender");
            }

            try
            {
                if (!project.SupportsINuGetProjectSystem())
                {
                    ExecuteScript(
                        e.InstallPath,
                        PowerShellScripts.Uninstall,
                        e.Package,
                        projectManager.GetTargetFrameworkForPackage(e.Package.Id),
                        project);
                }
            }
            catch (Exception ex)
            {
                LogCore(MessageLevel.Warning, ex.Message);
            }
        }
        private void OnPackageReferenceAdded(object sender, PackageOperationEventArgs e)
        {
            var projectManager = (IProjectManager)sender;

            Project project;
            if (!_projectManagerToProject.TryGetValue(projectManager, out project))
            {
                throw new ArgumentException(Resources.Cmdlet_InvalidProjectManagerInstance, "sender");
            }

            if (!project.SupportsINuGetProjectSystem())
            {
                ExecuteScript(e.InstallPath, PowerShellScripts.Install, e.Package, project.GetTargetFrameworkName(), project);
            }
        }
예제 #6
0
 protected override void OnUninstalling(PackageOperationEventArgs e)
 {
     PackageEvents.NotifyUninstalling(e);
     base.OnUninstalling(e);
 }
예제 #7
0
 private void OnPackageInstalled(object sender, PackageOperationEventArgs e)
 {
     _scriptExecutor.ExecuteInitScript(e.InstallPath, e.Package, this);
 }
예제 #8
0
 private void OnPackageReferenceRemoving(object sender, PackageOperationEventArgs e)
 {
     Project project = FindProjectFromFileSystem(e.FileSystem);
     Debug.Assert(project != null);
     try
     {
         _providerServices.ScriptExecutor.ExecuteScript(
             e.InstallPath, 
             PowerShellScripts.Uninstall, 
             e.Package, 
             project,
             GetTargetFrameworkForPackage(e.Package.Id) ?? project.GetTargetFrameworkName(),
             this);
     }
     catch (Exception ex)
     {
         // Swallow exception for uninstall.ps1. Otherwise, there is no way to uninstall a package.
         // But we log it as a warning.
         Log(MessageLevel.Warning, ExceptionUtility.Unwrap(ex).Message);
     }
 }
예제 #9
0
 private void OnPackageInstalled(object sender, PackageOperationEventArgs e)
 {
     _providerServices.ScriptExecutor.ExecuteInitScript(e.InstallPath, e.Package, this);
     PrepareOpenReadMeFile(e);
 }
예제 #10
0
        private void OnPackageReferenceRemoving(object sender, PackageOperationEventArgs e)
        {
            var projectManager = (ProjectManager)sender;

            EnvDTE.Project project;
            if (!_projectManagerToProject.TryGetValue(projectManager, out project)) {
                throw new ArgumentException(Resources.Cmdlet_InvalidProjectManagerInstance, "sender");
            }

            ExecuteScript(e.InstallPath, PowerShellScripts.Uninstall, e.Package, project);
        }
예제 #11
0
 private void OnPackageInstalled(object sender, PackageOperationEventArgs e)
 {
     AddToolsFolderToEnvironmentPath(e.InstallPath);
     ExecuteScript(e.InstallPath, PowerShellScripts.Init, e.Package, null);
 }
 internal void NotifyReferenceRemoved(PackageOperationEventArgs e)
 {
     if (PackageReferenceRemoved != null)
     {
         PackageReferenceRemoved(new VsPackageMetadata(e.Package, e.InstallPath));
     }
 }
예제 #13
0
        protected override void OnInstalled(PackageOperationEventArgs e)
        {
            base.OnInstalled(e);

            AddPackageToRecentRepository(e.Package, updateOnly: true);
        }
예제 #14
0
 protected override void OnInstalled(PackageOperationEventArgs e)
 {
     base.OnInstalled(e);
     PackageEvents.NotifyInstalled(e);
 }
예제 #15
0
 internal void NotifyReferenceRemoved(PackageOperationEventArgs e)
 {
     PackageReferenceRemoved(new VsPackageMetadata(e.Package, e.InstallPath, e.FileSystem));
 }
예제 #16
0
 protected override void OnUninstalling(PackageOperationEventArgs e)
 {
     PackageEvents.NotifyUninstalling(e);
     base.OnUninstalling(e);
 }
예제 #17
0
        protected override void OnUninstalled(PackageOperationEventArgs e)
        {
            base.OnUninstalled(e);

            _deleteOnRestartManager.MarkPackageDirectoryForDeletion(e.Package, createZipPackageFromPath: path => new ZipPackage(path));
        }
예제 #18
0
 private void OnPackageReferenceAdded(object sender, PackageOperationEventArgs e)
 {
     Project project = FindProjectFromFileSystem(e.FileSystem);
     Debug.Assert(project != null);
     _providerServices.ScriptExecutor.ExecuteScript(
         e.InstallPath, 
         PowerShellScripts.Install, 
         e.Package, 
         project,
         project.GetTargetFrameworkName(),
         this);
 }
 private void OnPackageInstalling(object sender, PackageOperationEventArgs e)
 {
     // Write disclaimer text before a package is installed
     WriteDisclaimerText(e.Package);
 }
예제 #20
0
 private void PrepareOpenReadMeFile(PackageOperationEventArgs e)
 {
     // only open the read me file for the first package that initiates this operation.
     if (e.Package.Id.Equals(_originalPackageId, StringComparison.OrdinalIgnoreCase) && e.Package.HasReadMeFileAtRoot())
     {
         _readmeFile = Path.Combine(e.InstallPath, NuGetConstants.ReadmeFileName);
     }
 }
 private void OnPackageInstalled(object sender, PackageOperationEventArgs e)
 {
     AddToolsFolderToEnvironmentPath(e.InstallPath);
     ExecuteScript(e.InstallPath, PowerShellScripts.Init, e.Package, targetFramework: null, project: null);
     PrepareOpenReadMeFile(e);
 }
예제 #22
0
 private void OnPackageReferenceRemoving(object sender, PackageOperationEventArgs e)
 {
     _scriptExecutor.ExecuteScript(e.InstallPath, PowerShellScripts.Uninstall, e.Package, _project, this);
 }
예제 #23
0
 protected override void OnInstalled(PackageOperationEventArgs e)
 {
     base.OnInstalled(e);
     PackageEvents.NotifyInstalled(e);
 }