Class FormatDecoderAttribute
Specifies that a class can be used to decode a particular file type.
Inherited Members
System.Attribute.Equals(System.Object)
System.Attribute.GetCustomAttribute(System.Reflection.Assembly, System.Type)
System.Attribute.GetCustomAttribute(System.Reflection.Assembly, System.Type, System.Boolean)
System.Attribute.GetCustomAttribute(System.Reflection.MemberInfo, System.Type)
System.Attribute.GetCustomAttribute(System.Reflection.MemberInfo, System.Type, System.Boolean)
System.Attribute.GetCustomAttribute(System.Reflection.Module, System.Type)
System.Attribute.GetCustomAttribute(System.Reflection.Module, System.Type, System.Boolean)
System.Attribute.GetCustomAttribute(System.Reflection.ParameterInfo, System.Type)
System.Attribute.GetCustomAttribute(System.Reflection.ParameterInfo, System.Type, System.Boolean)
System.Attribute.GetCustomAttributes(System.Reflection.Assembly)
System.Attribute.GetCustomAttributes(System.Reflection.Assembly, System.Boolean)
System.Attribute.GetCustomAttributes(System.Reflection.Assembly, System.Type)
System.Attribute.GetCustomAttributes(System.Reflection.Assembly, System.Type, System.Boolean)
System.Attribute.GetCustomAttributes(System.Reflection.MemberInfo)
System.Attribute.GetCustomAttributes(System.Reflection.MemberInfo, System.Boolean)
System.Attribute.GetCustomAttributes(System.Reflection.MemberInfo, System.Type)
System.Attribute.GetCustomAttributes(System.Reflection.MemberInfo, System.Type, System.Boolean)
System.Attribute.GetCustomAttributes(System.Reflection.Module)
System.Attribute.GetCustomAttributes(System.Reflection.Module, System.Boolean)
System.Attribute.GetCustomAttributes(System.Reflection.Module, System.Type)
System.Attribute.GetCustomAttributes(System.Reflection.Module, System.Type, System.Boolean)
System.Attribute.GetCustomAttributes(System.Reflection.ParameterInfo)
System.Attribute.GetCustomAttributes(System.Reflection.ParameterInfo, System.Boolean)
System.Attribute.GetCustomAttributes(System.Reflection.ParameterInfo, System.Type)
System.Attribute.GetCustomAttributes(System.Reflection.ParameterInfo, System.Type, System.Boolean)
System.Attribute.GetHashCode()
System.Attribute.IsDefaultAttribute()
System.Attribute.IsDefined(System.Reflection.Assembly, System.Type)
System.Attribute.IsDefined(System.Reflection.Assembly, System.Type, System.Boolean)
System.Attribute.IsDefined(System.Reflection.MemberInfo, System.Type)
System.Attribute.IsDefined(System.Reflection.MemberInfo, System.Type, System.Boolean)
System.Attribute.IsDefined(System.Reflection.Module, System.Type)
System.Attribute.IsDefined(System.Reflection.Module, System.Type, System.Boolean)
System.Attribute.IsDefined(System.Reflection.ParameterInfo, System.Type)
System.Attribute.IsDefined(System.Reflection.ParameterInfo, System.Type, System.Boolean)
System.Attribute.Match(System.Object)
System.Attribute.TypeId
System.Object.Equals(System.Object, System.Object)
System.Object.GetType()
System.Object.MemberwiseClone()
System.Object.ReferenceEquals(System.Object, System.Object)
System.Object.ToString()
Namespace: Mars.Common.Compat
Assembly: Mars.Common.dll
Syntax
[AttributeUsage(AttributeTargets.Class, AllowMultiple = true)]
public sealed class FormatDecoderAttribute : FormatHandlerAttribute
Constructors
| Improve this Doc View SourceFormatDecoderAttribute(String)
Initializes a new instance of the FormatDecoderAttribute class.
Declaration
public FormatDecoderAttribute(string extension)
Parameters
Type | Name | Description |
---|---|---|
System.String | extension |
Methods
| Improve this Doc View SourceGetDecoders<TDecoder>(String, Dictionary<String, Type>, Dictionary<String, TDecoder>)
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). |
System.Collections.Generic.Dictionary<System.String, System.Type> | decoderTypes | The decoder types. |
System.Collections.Generic.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). |