本文整理匯總了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);
}