Table of Contents

Class FeatureExtensions

Namespace
Cryville.EEW.Features
Assembly
Cryville.EEW.Features.dll
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

f Feature
The feature.
representation T
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

f Feature
The feature.
key TagTypeKey
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

f Feature
The feature.
key TagTypeKey
The key whose value to get.
value T
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

bool
true if the feature contains an tag with the specified key; otherwise, false.

Type Parameters

T
The type of the value.