Class FormatDecoderAttribute
Specifies that a class can be used to decode a particular file type.
Inheritance
Attribute
FormatDecoderAttribute
Assembly: Mars.Common.dll
public sealed class FormatDecoderAttribute : FormatHandlerAttribute
Constructors
Declaration
public FormatDecoderAttribute(string extension)
Parameters
Type |
Name |
Description |
System.String |
extension |
|
Methods
Finds a decoder that can process the given normalized file extension.
Declaration
public static TDecoder GetDecoders<TDecoder>(string fileExtension, Dictionary<string, Type> decoderTypes, Dictionary<string, TDecoder> cache)
where TDecoder : class
Parameters
Type |
Name |
Description |
System.String |
fileExtension |
The normalized file extension (
GetNormalizedExtension(String).
|
Dictionary<System.String, Type> |
decoderTypes |
The decoder types. |
Dictionary<System.String, TDecoder> |
cache |
The cache of already instantiated decoder types. |
Returns
Type |
Description |
TDecoder |
A decoder implementing the TDecoder interface, or null if none have been found. |
Type Parameters
Name |
Description |
TDecoder |
The type of the the decoder to be found (e.g. IImageDecoder or IAudioDecoder). |
Extension Methods