Class FormatEncoderAttribute
Specifies that a class can be used to encode 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 FormatEncoderAttribute : FormatHandlerAttribute
Constructors
| Improve this Doc View SourceFormatEncoderAttribute(String)
Initializes a new instance of the FormatEncoderAttribute class.
Declaration
public FormatEncoderAttribute(string extension)
Parameters
Type | Name | Description |
---|---|---|
System.String | extension |
Methods
| Improve this Doc View SourceGetEncoder<TEncoder>(String, Dictionary<String, Type>, Dictionary<String, TEncoder>)
Finds a encoder that can process the given normalized file extension.
Declaration
public static TEncoder GetEncoder<TEncoder>(string fileExtension, Dictionary<string, Type> encoderTypes, Dictionary<string, TEncoder> cache)
where TEncoder : class
Parameters
Type | Name | Description |
---|---|---|
System.String | fileExtension | The normalized file extension ( GetNormalizedExtension(String)) |
System.Collections.Generic.Dictionary<System.String, System.Type> | encoderTypes | The encoder types. |
System.Collections.Generic.Dictionary<System.String, TEncoder> | cache | The cache of already instantiated encoder types. |
Returns
Type | Description |
---|---|
TEncoder | An encoder implementing the TEncoder interface, or null if none have been found. |
Type Parameters
Name | Description |
---|---|
TEncoder | The type of the the decoder to be found (e.g. IImageEncoder or IAudioEncoder). |