當前位置: 首頁>>代碼示例>>C#>>正文


C# VisualStudio.PackageOperationEventArgs類代碼示例

本文整理匯總了C#中NuGet.VisualStudio.PackageOperationEventArgs的典型用法代碼示例。如果您正苦於以下問題:C# PackageOperationEventArgs類的具體用法?C# PackageOperationEventArgs怎麽用?C# PackageOperationEventArgs使用的例子?那麽, 這裏精選的類代碼示例或許可以為您提供幫助。


PackageOperationEventArgs類屬於NuGet.VisualStudio命名空間,在下文中一共展示了PackageOperationEventArgs類的15個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的C#代碼示例。

示例1: NotifyUninstalled

 internal void NotifyUninstalled(PackageOperationEventArgs e)
 {
     if (PackageUninstalled != null)
     {
         PackageUninstalled(new VsPackageMetadata(e.Package, e.InstallPath));
     }
 }
開發者ID:Newtopian,項目名稱:nuget,代碼行數:7,代碼來源:VsPackageInstallerEvents.cs

示例2: NotifyInstalling

 internal void NotifyInstalling(PackageOperationEventArgs e)
 {
     if (PackageInstalling != null)
     {
         PackageInstalling(new VsPackageMetadata(e.Package, e.InstallPath));
     }
 }
開發者ID:Newtopian,項目名稱:nuget,代碼行數:7,代碼來源:VsPackageInstallerEvents.cs

示例3: OnUninstalling

 protected override void OnUninstalling(PackageOperationEventArgs e)
 {
     PackageEvents.NotifyUninstalling(e);
     base.OnUninstalling(e);
 }
開發者ID:sistoimenov,項目名稱:NuGet2,代碼行數:5,代碼來源:VSPackageManager.cs

示例4: OnInstalled

 protected override void OnInstalled(PackageOperationEventArgs e)
 {
     base.OnInstalled(e);
     PackageEvents.NotifyInstalled(e);
 }
開發者ID:sistoimenov,項目名稱:NuGet2,代碼行數:5,代碼來源:VSPackageManager.cs

示例5: OnUninstalled

        protected override void OnUninstalled(PackageOperationEventArgs e)
        {
            base.OnUninstalled(e);

            PackageEvents.NotifyUninstalled(e);
            _deleteOnRestartManager.MarkPackageDirectoryForDeletion(e.Package);
        }
開發者ID:sistoimenov,項目名稱:NuGet2,代碼行數:7,代碼來源:VSPackageManager.cs

示例6: OnPackageReferenceRemoving

        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);
            }
        }
開發者ID:sistoimenov,項目名稱:NuGet2,代碼行數:27,代碼來源:ProcessPackageBaseCommand.cs

示例7: NotifyReferenceRemoved

 internal void NotifyReferenceRemoved(PackageOperationEventArgs e)
 {
     if (PackageReferenceRemoved != null)
     {
         PackageReferenceRemoved(new VsPackageMetadata(e.Package, e.InstallPath));
     }
 }
開發者ID:mauroa,項目名稱:NuGet.VisualStudioExtension,代碼行數:7,代碼來源:VsPackageInstallerEvents.cs

示例8: OnPackageInstalled

 private void OnPackageInstalled(object sender, PackageOperationEventArgs e)
 {
     _scriptExecutor.ExecuteInitScript(e.InstallPath, e.Package, this);
 }
開發者ID:jacksonh,項目名稱:nuget,代碼行數:4,代碼來源:PackagesProviderBase.cs

示例9: OnPackageReferenceRemoving

 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);
     }
 }
開發者ID:themotleyfool,項目名稱:NuGet,代碼行數:21,代碼來源:PackagesProviderBase.cs

示例10: OnUninstalled

        protected override void OnUninstalled(PackageOperationEventArgs e)
        {
            base.OnUninstalled(e);

            _deleteOnRestartManager.MarkPackageDirectoryForDeletion(e.Package, createZipPackageFromPath: path => new ZipPackage(path));
        }
開發者ID:nickfloyd,項目名稱:NuGet,代碼行數:6,代碼來源:VSPackageManager.cs

示例11: NotifyReferenceRemoved

 internal void NotifyReferenceRemoved(PackageOperationEventArgs e)
 {
     PackageReferenceRemoved(new VsPackageMetadata(e.Package, e.InstallPath, e.FileSystem));
 }
開發者ID:Newtopian,項目名稱:nuget,代碼行數:4,代碼來源:VsPackageInstallerEvents.cs

示例12: OnPackageReferenceRemoving

        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);
        }
開發者ID:larsw,項目名稱:nuget,代碼行數:11,代碼來源:ProcessPackageBaseCommand.cs

示例13: OnPackageInstalled

 private void OnPackageInstalled(object sender, PackageOperationEventArgs e)
 {
     AddToolsFolderToEnvironmentPath(e.InstallPath);
     ExecuteScript(e.InstallPath, PowerShellScripts.Init, e.Package, null);
 }
開發者ID:larsw,項目名稱:nuget,代碼行數:5,代碼來源:ProcessPackageBaseCommand.cs

示例14: OnPackageInstalled

 private void OnPackageInstalled(object sender, PackageOperationEventArgs e)
 {
     _providerServices.ScriptExecutor.ExecuteInitScript(e.InstallPath, e.Package, this);
     PrepareOpenReadMeFile(e);
 }
開發者ID:themotleyfool,項目名稱:NuGet,代碼行數:5,代碼來源:PackagesProviderBase.cs

示例15: OnPackageInstalling

 private void OnPackageInstalling(object sender, PackageOperationEventArgs e)
 {
     // Write disclaimer text before a package is installed
     WriteDisclaimerText(e.Package);
 }
開發者ID:sistoimenov,項目名稱:NuGet2,代碼行數:5,代碼來源:ProcessPackageBaseCommand.cs


注:本文中的NuGet.VisualStudio.PackageOperationEventArgs類示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。