public void Register(object key, CodecFactoryEntry codec) { if (key is string) { key = (key as string).ToLower(); } if (_codecs.ContainsKey(key) != true) { _codecs.Add(key, codec); } }
/// <summary> /// Registers a new codec. /// </summary> /// <param name="key"> /// The key which gets used internally to save the <paramref name="codec" /> in a /// <see cref="Dictionary{TKey,TValue}" />. This is typically the associated file extension. For example: the mp3 codec /// uses the string "mp3" as its key. /// </param> /// <param name="codec"><see cref="CodecFactoryEntry" /> which provides information about the codec.</param> public void Register(object key, CodecFactoryEntry codec) { var keyString = key as string; if (keyString != null) { key = keyString.ToLower(); } if (_codecs.ContainsKey(key) != true) { _codecs.Add(key, codec); } }
/// <summary> /// Registers a new codec. /// </summary> /// <param name="key"> /// The key which gets used internally to save the <paramref name="codec" /> in a /// <see cref="Dictionary{TKey,TValue}" />. This is typically the associated file extension. For example: the mp3 codec /// uses the string "mp3" as its key. /// </param> /// <param name="codec"><see cref="CodecFactoryEntry" /> which provides information about the codec.</param> public void Register(object key, CodecFactoryEntry codec) { var keyString = key as string; if (keyString != null) key = keyString.ToLower(); if (_codecs.ContainsKey(key) != true) _codecs.Add(key, codec); }
public void Register(object key, CodecFactoryEntry codec) { if (key is string) key = (key as string).ToLower(); if (_codecs.ContainsKey(key) != true) _codecs.Add(key, codec); }