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


C# NuGet.PackageOperation類代碼示例

本文整理匯總了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;
		}
開發者ID:yuriykipnis,項目名稱:SharpDevelop,代碼行數:7,代碼來源:TestablePackageViewModel.cs

示例2: AddPackageInstallOperation

		public FakePackage AddPackageInstallOperation ()
		{
			var package = new FakePackage ("Package to install");
			var operation = new PackageOperation (package, PackageAction.Install);
			PackageOperations.Add (operation);
			return package;
		}
開發者ID:Kalnor,項目名稱:monodevelop,代碼行數:7,代碼來源:InstallPackageHelper.cs

示例3: CreateInstallActionWithOneOperation

		FakeInstallPackageAction CreateInstallActionWithOneOperation()
		{
			var operations = new PackageOperation[] {
				new PackageOperation(new FakePackage(), PackageAction.Install)
			};
			FakeInstallPackageAction action = CreateInstallAction();
			action.Operations = operations;
			return action;
		}
開發者ID:Paccc,項目名稱:SharpDevelop,代碼行數:9,代碼來源:ConsolePackageActionRunnerTests.cs

示例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;
		}
開發者ID:Netring,項目名稱:SharpDevelop,代碼行數:11,代碼來源:InstallPackageActionTests.cs

示例5: AddOneFakeInstallPackageOperationForViewModelPackage

		public PackageOperation AddOneFakeInstallPackageOperationForViewModelPackage()
		{
			var operation = new PackageOperation(FakePackage, PackageAction.Install);
			
			FakeSolution
				.FakeActiveProject
				.FakeInstallOperations
				.Add(operation);
			
			return operation;
		}
開發者ID:yuriykipnis,項目名稱:SharpDevelop,代碼行數:11,代碼來源:TestablePackageViewModel.cs

示例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);
		}
開發者ID:hpsa,項目名稱:SharpDevelop,代碼行數:14,代碼來源:PackageActionRunnerTests.cs

示例7: AddInstallOperationForPackage

 PackageOperation AddInstallOperationForPackage(IPackage package)
 {
     var operation = new PackageOperation(package, PackageAction.Install);
     AddInstallOperationsForPackage(package, operation);
     return operation;
 }
開發者ID:2594636985,項目名稱:SharpDevelop,代碼行數:6,代碼來源:ReducedPackageOperationsTests.cs

示例8: ExecuteOperation

 public void ExecuteOperation(PackageOperation operation)
 {
     // Allow to call this method from outside of the class
     base.Execute(operation);
 }
開發者ID:2594636985,項目名稱:SharpDevelop,代碼行數:5,代碼來源:NuGetPackageManager.cs

示例9: GetOperationKey

 private static object GetOperationKey(PackageOperation operation)
 {
     return Tuple.Create(operation.Action, operation.Package.Id, operation.Package.Version);
 }
開發者ID:njannink,項目名稱:sonarlint-vs,代碼行數:4,代碼來源:PackageOperationExtensions.cs

示例10: UpdatePackageWithPackageOperations

		FakePackage UpdatePackageWithPackageOperations(PackageOperation operation)
		{
			var operations = new PackageOperation[] {
				operation
			};
			FakePackage package = CreateFakePackage();
			packageManager.UpdatePackage(package, operations, true);
			return package;
		}
開發者ID:yuriykipnis,項目名稱:SharpDevelop,代碼行數:9,代碼來源:SharpDevelopPackageManagerTests.cs

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

示例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);
		}
開發者ID:Paccc,項目名稱:SharpDevelop,代碼行數:6,代碼來源:ReducedPackageOperations.cs

示例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);
 }
開發者ID:njannink,項目名稱:sonarlint-vs,代碼行數:6,代碼來源:PackageOperationExtensions.cs

示例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));
        }
開發者ID:2594636985,項目名稱:SharpDevelop,代碼行數:12,代碼來源:UpdateSolutionPackagesActionTests.cs

示例15: IsInstallingMSBuildFiles

		bool IsInstallingMSBuildFiles (PackageOperation operation)
		{
			return (operation.Action == PackageAction.Install) &&
				operation.Package.GetBuildFiles ().Any ();
		}
開發者ID:nerzhulart,項目名稱:monodevelop,代碼行數:5,代碼來源:PackageManagementEventsMonitor.cs


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