コード例 #1
0
ファイル: Profile.cs プロジェクト: Craftitude-Team/Craftitude
 /// <summary>
 /// Get all packages which depend on the given package.
 /// </summary>
 /// <param name="package">The package for which to check as a dependency</param>
 /// <param name="type">Dependency types to search for. Defaults to all (including incompatibilities, might not be intended).</param>
 /// <returns>All packages which found to have a dependency to the given package.</returns>
 private IEnumerable<InstalledPackageInfo> GetDependingInstalledPackages(Package package, DependencyType type = DependencyType.Inclusion | DependencyType.Incompatibility | DependencyType.Prerequirement | DependencyType.Requirement | DependencyType.Suggestion)
 {
     // We expect to have only installed one version of a package at the same time, so we don't check the versions here.
     return ProfileInfo.InstalledPackages.Where(
         installedPackage => GetInstalledPackage(installedPackage).Metadata.Dependencies.Any(d => d.Name.Equals(package.Metadata.Id) && type.HasFlag(d.Type))
         );
 }