Class FeatureCollection
Default implementation of IFeatureCollection.
public class FeatureCollection : IFeatureCollection, IEnumerable<KeyValuePair<Type, object>>, IEnumerable
- Inheritance
-
FeatureCollection
- Implements
- Inherited Members
- Extension Methods
Constructors
FeatureCollection()
Constructs an empty read-write feature collection.
public FeatureCollection()
FeatureCollection(IFeatureCollection)
Constructs an empty read-write feature collection with defaults.
public FeatureCollection(IFeatureCollection defaults)
Parameters
defaults
IFeatureCollectionThe feature collection that provide default values.
Properties
Empty
Gets a shared empty read-only instance.
public static IFeatureCollection Empty { get; }
Property Value
- IFeatureCollection
An empty FeatureCollection.
IsReadOnly
Gets a value indicating whether this feature collection is read-only or read-write.
public bool IsReadOnly { get; }
Property Value
this[Type]
Gets or sets a feature. Setting null removes the feature.
public object? this[Type key] { get; set; }
Parameters
key
TypeThe feature key.
Property Value
- object
The requested feature.
Methods
GetEnumerator()
Returns an enumerator that iterates over this feature collection.
public IEnumerator<KeyValuePair<Type, object>> GetEnumerator()
Returns
- IEnumerator<KeyValuePair<Type, object>>
An IEnumerator<T> object that can be used to iterate through this feature collection.
Get<TFeature>()
Gets the requested feature. If the feature is not set, returns null.
public TFeature? Get<TFeature>()
Returns
- TFeature
The requested feature.
Type Parameters
TFeature
The feature key.
Set<TFeature>(TFeature?)
Sets a new feature. Setting null removes the feature.
public void Set<TFeature>(TFeature? feature)
Parameters
feature
TFeatureThe feature value.
Type Parameters
TFeature
The feature key.