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