Class PackageFilter
The class that is used for defining filters when asking a device for packages.
Inheritance
Inherited Members
Namespace: Phoenix.Applications
Assembly: Phoenix.Abstractions.Applications.dll
Syntax
public class PackageFilter
Constructors
View SourcePackageFilter()
Initializes a new instance of the PackageFilter class.
Declaration
public PackageFilter()
Properties
View SourceCustomExcludedPackagesIds
Gets the filter's custom excluded packages.
Declaration
public ReadOnlyCollection<string> CustomExcludedPackagesIds { get; }
Property Value
Type | Description |
---|---|
System.Collections.ObjectModel.ReadOnlyCollection<System.String> |
CustomIncludedPackageIds
Gets the filter's custom included packages.
Declaration
public ReadOnlyCollection<string> CustomIncludedPackageIds { get; }
Property Value
Type | Description |
---|---|
System.Collections.ObjectModel.ReadOnlyCollection<System.String> |
FilterTags
Gets the standard package filter that the custom includes and excludes are based on.
Declaration
public PackageFilterTags FilterTags { get; }
Property Value
Type | Description |
---|---|
PackageFilterTags |
Methods
View SourceAddPackageExclusion(String)
Adds a package to the exclusions list.
Declaration
public void AddPackageExclusion(string packageIdToExclude)
Parameters
Type | Name | Description |
---|---|---|
System.String | packageIdToExclude | The package id to exclude. |
Remarks
If the package is in the inclusions list, this will override that.
AddPackageExclusions(IEnumerable<String>)
Adds packages to the exclusions list.
Declaration
public void AddPackageExclusions(IEnumerable<string> packageIdsToExclude)
Parameters
Type | Name | Description |
---|---|---|
System.Collections.Generic.IEnumerable<System.String> | packageIdsToExclude | The package ids to exclude. |
Remarks
If the packages are in the inclusions list, this will override that.
AddPackageInclusion(String)
Adds a package to the inclusions list.
Declaration
public void AddPackageInclusion(string packageIdToInclude)
Parameters
Type | Name | Description |
---|---|---|
System.String | packageIdToInclude | The package id to include. |
Remarks
If the package is in the exclusions list, this will override that.
AddPackageInclusions(IEnumerable<String>)
Adds packages to the inclusions list.
Declaration
public void AddPackageInclusions(IEnumerable<string> packageIdsToInclude)
Parameters
Type | Name | Description |
---|---|---|
System.Collections.Generic.IEnumerable<System.String> | packageIdsToInclude | The package ids to include. |
Remarks
If the packages are in the exclusions list, this will override that.
Create(PackageFilterTags)
Creates a package filter with a specified set of tags.
Declaration
public static PackageFilter Create(PackageFilterTags filterTags)
Parameters
Type | Name | Description |
---|---|---|
PackageFilterTags | filterTags | The filter tags to base the filter on. |
Returns
Type | Description |
---|---|
PackageFilter | The new package filter. |
Create(PackageFilterTags, IEnumerable<String>, IEnumerable<String>)
Creates a package filter for a set of tags and custom included/excluded ids.
Declaration
public static PackageFilter Create(PackageFilterTags filterTags, IEnumerable<string> customExcludedIds, IEnumerable<string> customIncludedIds)
Parameters
Type | Name | Description |
---|---|---|
PackageFilterTags | filterTags | The filter tags to base the filter on. |
System.Collections.Generic.IEnumerable<System.String> | customExcludedIds | The excluded package ids. |
System.Collections.Generic.IEnumerable<System.String> | customIncludedIds | The included package ids. |
Returns
Type | Description |
---|---|
PackageFilter | The new package filter. |
Remarks
If both the excluded and included contain a specific package ID, it will default to be in the included list.
CreateFromExistingPackages(IEnumerable<IPackage>)
Creates a filter that will only match to the passed in packages.
Declaration
public static PackageFilter CreateFromExistingPackages(IEnumerable<IPackage> packages)
Parameters
Type | Name | Description |
---|---|---|
System.Collections.Generic.IEnumerable<IPackage> | packages | The packages to use to create a filter. |
Returns
Type | Description |
---|---|
PackageFilter | The new filter. |
CreateFromSinglePackage(String)
Creates a package filter for a single package id.
Declaration
public static PackageFilter CreateFromSinglePackage(string packageId)
Parameters
Type | Name | Description |
---|---|---|
System.String | packageId | The package id. |
Returns
Type | Description |
---|---|
PackageFilter | The new package filter. |
ShouldFilterAsync(IPackage)
Gets whether or not the specified package should be filtered out of the results.
Declaration
public async Task<bool> ShouldFilterAsync(IPackage package)
Parameters
Type | Name | Description |
---|---|---|
IPackage | package | The package to check. |
Returns
Type | Description |
---|---|
System.Threading.Tasks.Task<System.Boolean> | Whether or not the filter indicates this package should be filtered out. |