本文整理汇总了C#中NuGet.PackageOperation类的典型用法代码示例。如果您正苦于以下问题:C# PackageOperation类的具体用法?C# PackageOperation怎么用?C# PackageOperation使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
PackageOperation类属于NuGet命名空间,在下文中一共展示了PackageOperation类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: AddOneFakeUninstallPackageOperation
public PackageOperation AddOneFakeUninstallPackageOperation()
{
var package = new FakePackage("PackageToUninstall");
var operation = new PackageOperation(package, PackageAction.Uninstall);
FakeSolution.FakeActiveProject.FakeInstallOperations.Add(operation);
return operation;
}
示例2: AddPackageInstallOperation
public FakePackage AddPackageInstallOperation ()
{
var package = new FakePackage ("Package to install");
var operation = new PackageOperation (package, PackageAction.Install);
PackageOperations.Add (operation);
return package;
}
示例3: CreateInstallActionWithOneOperation
FakeInstallPackageAction CreateInstallActionWithOneOperation()
{
var operations = new PackageOperation[] {
new PackageOperation(new FakePackage(), PackageAction.Install)
};
FakeInstallPackageAction action = CreateInstallAction();
action.Operations = operations;
return action;
}
示例4: AddInstallOperationWithFile
void AddInstallOperationWithFile(string fileName)
{
var package = new FakePackage();
package.AddFile(fileName);
var operation = new PackageOperation(package, PackageAction.Install);
var operations = new List<PackageOperation>();
operations.Add(operation);
action.Operations = operations;
}
示例5: AddOneFakeInstallPackageOperationForViewModelPackage
public PackageOperation AddOneFakeInstallPackageOperationForViewModelPackage()
{
var operation = new PackageOperation(FakePackage, PackageAction.Install);
FakeSolution
.FakeActiveProject
.FakeInstallOperations
.Add(operation);
return operation;
}
示例6: CreateInstallActionWithOnePowerShellScript
void CreateInstallActionWithOnePowerShellScript()
{
CreateInstallActionWithNoPowerShellScripts();
var package = new FakePackage();
package.AddFile(@"tools\init.ps1");
var operation = new PackageOperation(package, PackageAction.Install);
var operations = new List<PackageOperation>();
operations.Add(operation);
fakeAction.Operations = operations;
fakeActions.Add(fakeAction);
}
示例7: AddInstallOperationForPackage
PackageOperation AddInstallOperationForPackage(IPackage package)
{
var operation = new PackageOperation(package, PackageAction.Install);
AddInstallOperationsForPackage(package, operation);
return operation;
}
示例8: ExecuteOperation
public void ExecuteOperation(PackageOperation operation)
{
// Allow to call this method from outside of the class
base.Execute(operation);
}
示例9: GetOperationKey
private static object GetOperationKey(PackageOperation operation)
{
return Tuple.Create(operation.Action, operation.Package.Id, operation.Package.Version);
}
示例10: UpdatePackageWithPackageOperations
FakePackage UpdatePackageWithPackageOperations(PackageOperation operation)
{
var operations = new PackageOperation[] {
operation
};
FakePackage package = CreateFakePackage();
packageManager.UpdatePackage(package, operations, true);
return package;
}
示例11: Execute
public void Execute(PackageOperation operation)
{
bool packageExists = LocalRepository.Exists(operation.Package);
if (operation.Action == PackageAction.Install)
{
// If the package is already installed, then skip it
if (packageExists)
{
Logger.Log(MessageLevel.Info, NuGetResources.Log_PackageAlreadyInstalled, operation.Package.GetFullName());
}
else
{
ExecuteInstall(operation.Package);
}
}
else
{
if (packageExists)
{
ExecuteUninstall(operation.Package);
}
}
}
示例12: IsMatch
bool IsMatch(PackageOperation x, PackageOperation y)
{
return (x.Package.Id == y.Package.Id) &&
(x.Package.Version == y.Package.Version) &&
(x.Action == y.Action);
}
示例13: GetOpposingOperationKey
private static object GetOpposingOperationKey(PackageOperation operation)
{
return Tuple.Create(operation.Action == PackageAction.Install ?
PackageAction.Uninstall :
PackageAction.Install, operation.Package.Id, operation.Package.Version);
}
示例14: Execute_OneProjectThatHasOlderVersionOfPackageBeingUpdated_PackageOperationsAreRun
public void Execute_OneProjectThatHasOlderVersionOfPackageBeingUpdated_PackageOperationsAreRun()
{
PackageOperation operation = CreateInstallOperationWithFile(@"tools\readme.txt");
CreateActionWithOperations(operation);
IPackageFromRepository package = AddPackageToAction("Test", "1.0");
IPackageManagementProject project = AddProjectToSolution();
var expectedOperations = new PackageOperation[] { operation };
action.Execute();
project.AssertWasCalled(p => p.RunPackageOperations(expectedOperations));
}
示例15: IsInstallingMSBuildFiles
bool IsInstallingMSBuildFiles (PackageOperation operation)
{
return (operation.Action == PackageAction.Install) &&
operation.Package.GetBuildFiles ().Any ();
}