Class FeatureExtensions
Provides a set of extension methods related to the Feature class.
public static class FeatureExtensions
- Inheritance
-
FeatureExtensions
- Inherited Members
Methods
GetFeatureOfRepresentation<T>(Feature, out T?)
Gets the feature itself if its representation is of the specified type, or the value of the location tag as a feature if it is of the specified type, or null.
public static Feature? GetFeatureOfRepresentation<T>(this Feature f, out T? representation)
Parameters
fFeature- The feature.
representationT- When the method returns, set to the representation of the feature returned, or null if null is returned.
Returns
- Feature
- The feature itself if its representation is of the specified type, or the value of the location tag as a feature if it is of the specified type, or null.
Type Parameters
T- The type of the representation.
GetValues<T>(Feature, TagTypeKey)
Gets the value of the specified key if it is of the specified type, or the items of the specified type if the value is an enumerable.
public static IEnumerable<T> GetValues<T>(this Feature f, TagTypeKey key)
Parameters
fFeature- The feature.
keyTagTypeKey- The key.
Returns
- IEnumerable<T>
- An enumerable containing the instances of the specified type within the value of the specified key.
Type Parameters
T- The type of the items.
TryGetValue<T>(Feature, TagTypeKey, out T?)
Gets the value associated with the specified key.
public static bool TryGetValue<T>(this Feature f, TagTypeKey key, out T? value)
Parameters
fFeature- The feature.
keyTagTypeKey- The key whose value to get.
valueT- When this method returns, the value associated with the specified key, if the key is found; otherwise, the default value for the type of the value parameter. This parameter is passed uninitialized.
Returns
Type Parameters
T- The type of the value.