当前位置: 首页>>代码示例>>C#>>正文


C# IPackage.HasProjectContent方法代码示例

本文整理汇总了C#中IPackage.HasProjectContent方法的典型用法代码示例。如果您正苦于以下问题:C# IPackage.HasProjectContent方法的具体用法?C# IPackage.HasProjectContent怎么用?C# IPackage.HasProjectContent使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在IPackage的用法示例。


在下文中一共展示了IPackage.HasProjectContent方法的10个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。

示例1: AddPackage

        public override void AddPackage(IPackage package)
        {
            base.AddPackage(package);

            if (!package.HasProjectContent())
            {
                AddPackageReferenceEntry(package.Id, package.Version);
            }
        }
开发者ID:njannink,项目名称:sonarlint-vs,代码行数:9,代码来源:MockSharedPackageRepository.cs

示例2: RemovePackage

        public override void RemovePackage(IPackage package)
        {
            base.RemovePackage(package);

            if (package.HasProjectContent())
            {
                _references.Remove(package.Id);
            }
            else
            {
                _solutionReferences.Remove(package.Id);
            }
        }
开发者ID:sistoimenov,项目名称:NuGet2,代码行数:13,代码来源:MockSharedPackageRepository.cs

示例3: AddPackage

        public override void AddPackage(IPackage package)
        {
            base.AddPackage(package);

            if (package.HasProjectContent())
            {
                _references[package.Id] = package.Version;
            }
            else
            {
                _solutionReferences[package.Id] = package.Version;
            }
        }
开发者ID:sistoimenov,项目名称:NuGet2,代码行数:13,代码来源:MockSharedPackageRepository.cs

示例4: IsSolutionLevel

        private bool IsSolutionLevel(IPackage package)
        {
            // A package is solution level if 
            // - it doesn't have project content & 
            // - it doesn't have dependency on non solution-level package &
            // - it is not referenced by any project.
            if (package.HasProjectContent())
            {
                return false;
            }

            if (HasProjectLevelPackageDependency(package))
            {
                return false;
            }

            if (IsReferenced(package.Id, package.Version))
            {
                return false;
            }

            return true;
        }
开发者ID:rikoe,项目名称:nuget,代码行数:23,代码来源:SharedPackageRepository.cs

示例5: IsProjectLevel

 /// <summary>
 /// Check to see if this package applies to a project based on 2 criteria:
 /// 1. The package has project content (i.e. content that can be applied to a project lib or content files)
 /// 2. The package is referenced by any other project
 /// 3. The package has at least one dependecy
 /// 
 /// This logic will probably fail in one edge case. If there is a meta package that applies to a project
 /// that ended up not being installed in any of the projects and it only exists at solution level.
 /// If this happens, then we think that the following operation applies to the solution instead of showing an error.
 /// To solve that edge case we'd have to walk the graph to find out what the package applies to.
 /// 
 /// Technically, the third condition is not totally accurate because a solution-level package can depend on another 
 /// solution-level package. However, doing that check here is expensive and we haven't seen such a package. 
 /// This condition here is more geared towards guarding against metadata packages, i.e. we shouldn't treat metadata packages 
 /// as solution-level ones.
 /// </summary>
 public bool IsProjectLevel(IPackage package)
 {
     return package.HasProjectContent() ||
          package.DependencySets.SelectMany(p => p.Dependencies).Any() ||
         LocalRepository.IsReferenced(package.Id, package.Version);
 }
开发者ID:sistoimenov,项目名称:NuGet2,代码行数:22,代码来源:PackageManager.cs

示例6: GetPackageTarget

        protected static PackageTargets GetPackageTarget(IPackage package)
        {
            IV3PackageMetadata v3package = package as IV3PackageMetadata;
            if (v3package != null)
            {
                return v3package.PackageTarget;
            }
            else
            {
                if (package.HasProjectContent())
                {
                    return PackageTargets.Project;
                }

                if (IsDependencyOnly(package))
                {
                    return PackageTargets.None;
                }

                return PackageTargets.External;
            }
        }
开发者ID:sistoimenov,项目名称:NuGet2,代码行数:22,代码来源:PackageWalker.cs

示例7: IsSolutionLevel

 private bool IsSolutionLevel(IPackage package)
 {
     // A package is solution level if it doesn't have project content & doesn't have dependency & not referenced by any project.
     //
     // Technically, the second condition is not totally accurate because a solution-level package can depend on another 
     // solution-level package. However, doing that check here is expensive and we haven't seen such a package. 
     // This condition here is more geared towards guarding against metadata packages, i.e. we shouldn't treat metadata packages 
     // as solution-level ones.
     return !package.HasProjectContent() && 
            !package.DependencySets.SelectMany(p => p.Dependencies).Any() &&
            !IsReferenced(package.Id, package.Version);
 }
开发者ID:shrknt35,项目名称:sonarlint-vs,代码行数:12,代码来源:SharedPackageRepository.cs

示例8: IsProjectPackage

		bool IsProjectPackage (IPackage package)
		{
			return package.HasProjectContent () ||
				package.DependencySets.SelectMany (p => p.Dependencies).Any ();
		}
开发者ID:modulexcite,项目名称:monodevelop-nuget-extensions,代码行数:5,代码来源:MonoDevelopPackageManager.cs

示例9: GetPackageTarget

        private static PackageTargets GetPackageTarget(IPackage package)
        {
            if (package.HasProjectContent())
            {
                return PackageTargets.Project;
            }

            if (IsDependencyOnly(package))
            {
                return PackageTargets.None;
            }

            return PackageTargets.External;
        }
开发者ID:shrknt35,项目名称:sonarlint-vs,代码行数:14,代码来源:PackageWalker.cs

示例10: IsProjectLevel

 /// <summary>
 /// Check to see if this package applies to a project based on 2 criteria:
 /// 1. The package has project content (i.e. content that can be applied to a project lib or content files)
 /// 2. The package is referenced by any other project
 /// 
 /// This logic will probably fail in one edge case. If there is a meta package that applies to a project
 /// that ended up not being installed in any of the projects and it only exists at solution level.
 /// If this happens, then we think that the following operation applies to the solution instead of showing an error.
 /// To solve that edge case we'd have to walk the graph to find out what the package applies to.
 /// </summary>
 public bool IsProjectLevel(IPackage package)
 {
     return package.HasProjectContent() || _sharedRepository.IsReferenced(package.Id, package.Version);
 }
开发者ID:nickfloyd,项目名称:NuGet,代码行数:14,代码来源:VSPackageManager.cs


注:本文中的IPackage.HasProjectContent方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。