Class ViewingGroupFilter
A per-dataset narrowing of viewing-group visibility, applied on top of the map-wide display mode and the per-product hidden viewing groups.
public sealed class ViewingGroupFilter : IEquatable<ViewingGroupFilter>
- Inheritance
-
ViewingGroupFilter
- Implements
- Inherited Members
Remarks
A filter can only hide more: a viewing group that the display mode or the per-product settings already hide stays hidden. Use ShowOnly(IEnumerable<int>) to keep a few groups of one dataset (for example the action points of an S-421 route while a planning tool draws its legs) and Hide(IEnumerable<int>) to drop a few.
Filters compare by value, so a host can skip a re-render when an equal filter is set again.
Properties
Hidden
Viewing groups the dataset doesn't draw.
public IReadOnlySet<int> Hidden { get; }
Property Value
ShownOnly
The only viewing groups the dataset may draw, or null when the
filter doesn't restrict the dataset to a set.
public IReadOnlySet<int>? ShownOnly { get; }
Property Value
Methods
Allows(int)
Whether the filter lets viewingGroup draw.
public bool Allows(int viewingGroup)
Parameters
viewingGroupintA viewing group id.
Returns
- bool
truewhen the group isn't filtered out.
Equals(ViewingGroupFilter?)
Indicates whether the current object is equal to another object of the same type.
public bool Equals(ViewingGroupFilter? other)
Parameters
otherViewingGroupFilterAn object to compare with this object.
Returns
Equals(object?)
Determines whether the specified object is equal to the current object.
public override bool Equals(object? obj)
Parameters
objobjectThe object to compare with the current object.
Returns
GetHashCode()
Serves as the default hash function.
public override int GetHashCode()
Returns
- int
A hash code for the current object.
Hide(IEnumerable<int>)
Creates a filter that hides viewingGroups.
public static ViewingGroupFilter Hide(IEnumerable<int> viewingGroups)
Parameters
viewingGroupsIEnumerable<int>The viewing groups to hide.
Returns
- ViewingGroupFilter
The filter.
Exceptions
- ArgumentNullException
viewingGroupsisnull.
ShowOnly(IEnumerable<int>)
Creates a filter that draws only viewingGroups.
public static ViewingGroupFilter ShowOnly(IEnumerable<int> viewingGroups)
Parameters
viewingGroupsIEnumerable<int>The viewing groups to keep.
Returns
- ViewingGroupFilter
The filter.
Exceptions
- ArgumentNullException
viewingGroupsisnull.
ToString()
Returns a string that represents the current object.
public override string ToString()
Returns
- string
A string that represents the current object.