Class PackageExtensions
Extensions for Package
public static class PackageExtensions
- Inheritance
-
PackageExtensions
Methods
ContainsAsset(IEnumerable<Package>, AssetId)
Determines whether the specified packages contains an asset by its guid.
public static bool ContainsAsset(this IEnumerable<Package> packages, AssetId assetId)
Parameters
packagesIEnumerable<Package>The packages.
assetIdAssetIdThe asset unique identifier.
Returns
- bool
trueif the specified packages contains asset; otherwise,false.
ContainsAsset(IEnumerable<Package>, UFile)
Determines whether the specified packages contains an asset by its location.
public static bool ContainsAsset(this IEnumerable<Package> packages, UFile location)
Parameters
packagesIEnumerable<Package>The packages.
locationUFileThe location.
Returns
- bool
trueif the specified packages contains asset; otherwise,false.
FindAsset(Package, IReference)
Finds an asset from all the packages by its asset reference. It will first try by id, then location.
public static AssetItem FindAsset(this Package package, IReference reference)
Parameters
packagePackageThe package.
referenceIReferenceThe reference to the asset.
Returns
FindDependencies(Package, bool)
Finds the package dependencies for the specified Package. See remarks.
public static PackageCollection FindDependencies(this Package rootPackage, bool includeRootPackage = false)
Parameters
rootPackagePackageThe root package.
includeRootPackageboolif set to
true[include root package].
Returns
- PackageCollection
List<Package>.
Exceptions
- ArgumentNullException
rootPackage
- ArgumentException
Root package must be part of a session;rootPackage