本文整理汇总了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));
}
}
示例2: NotifyInstalling
internal void NotifyInstalling(PackageOperationEventArgs e)
{
if (PackageInstalling != null)
{
PackageInstalling(new VsPackageMetadata(e.Package, e.InstallPath));
}
}
示例3: OnUninstalling
protected override void OnUninstalling(PackageOperationEventArgs e)
{
PackageEvents.NotifyUninstalling(e);
base.OnUninstalling(e);
}
示例4: OnInstalled
protected override void OnInstalled(PackageOperationEventArgs e)
{
base.OnInstalled(e);
PackageEvents.NotifyInstalled(e);
}
示例5: OnUninstalled
protected override void OnUninstalled(PackageOperationEventArgs e)
{
base.OnUninstalled(e);
PackageEvents.NotifyUninstalled(e);
_deleteOnRestartManager.MarkPackageDirectoryForDeletion(e.Package);
}
示例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);
}
}
示例7: NotifyReferenceRemoved
internal void NotifyReferenceRemoved(PackageOperationEventArgs e)
{
if (PackageReferenceRemoved != null)
{
PackageReferenceRemoved(new VsPackageMetadata(e.Package, e.InstallPath));
}
}
示例8: OnPackageInstalled
private void OnPackageInstalled(object sender, PackageOperationEventArgs e)
{
_scriptExecutor.ExecuteInitScript(e.InstallPath, e.Package, this);
}
示例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);
}
}
示例10: OnUninstalled
protected override void OnUninstalled(PackageOperationEventArgs e)
{
base.OnUninstalled(e);
_deleteOnRestartManager.MarkPackageDirectoryForDeletion(e.Package, createZipPackageFromPath: path => new ZipPackage(path));
}
示例11: NotifyReferenceRemoved
internal void NotifyReferenceRemoved(PackageOperationEventArgs e)
{
PackageReferenceRemoved(new VsPackageMetadata(e.Package, e.InstallPath, e.FileSystem));
}
示例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);
}
示例13: OnPackageInstalled
private void OnPackageInstalled(object sender, PackageOperationEventArgs e)
{
AddToolsFolderToEnvironmentPath(e.InstallPath);
ExecuteScript(e.InstallPath, PowerShellScripts.Init, e.Package, null);
}
示例14: OnPackageInstalled
private void OnPackageInstalled(object sender, PackageOperationEventArgs e)
{
_providerServices.ScriptExecutor.ExecuteInitScript(e.InstallPath, e.Package, this);
PrepareOpenReadMeFile(e);
}
示例15: OnPackageInstalling
private void OnPackageInstalling(object sender, PackageOperationEventArgs e)
{
// Write disclaimer text before a package is installed
WriteDisclaimerText(e.Package);
}