Neos.IdentityServer 3.0/Neos.IdentityServer.MultiFactor.WebAuthN.Common/Library/PeterO.Cbor.Internal.cs
/// <summary>Registers an object that converts objects of a given type
/// to CBOR objects (called a CBOR converter).</summary>
/// <param name='type'>A Type object specifying the type that the
/// converter converts to CBOR objects.</param>
/// <param name='converter'>The parameter <paramref name='converter'/>
/// is an ICBORConverter object.</param>
/// <typeparam name='T'>Must be the same as the "type"
/// parameter.</typeparam>
/// <returns>This object.</returns>
/// <exception cref='T:System.ArgumentNullException'>The parameter
/// <paramref name='type'/> or <paramref name='converter'/> is
/// null.</exception>
/// <exception cref='T:System.ArgumentException'>"Converter doesn't
/// contain a proper ToCBORObject method".</exception>
Registers an object that converts objects of a given type
to CBOR objects (called a CBOR converter).
Registers an object that converts objects of a given type to CBOR objects ( called a CBOR converter ) .
public CBORTypeMapper AddConverter<T>(
          Type type,
          ICBORConverter<T> converter)
        {
            if (type == null)
            {
                throw new ArgumentNullException(nameof(type));
            }
            if (converter == null)
            {
                throw new ArgumentNullException(nameof(converter));
            }
            ConverterInfo ci = new ConverterInfo
            {
                Converter = converter,
                ToObject = PropertyMap.FindOneArgumentMethod(
              converter,
              "ToCBORObject",
              type)
            };
            if (ci.ToObject == null)
            {
                throw new ArgumentException(
                  "Converter doesn't contain a proper ToCBORObject method");
            }
            ci.FromObject = PropertyMap.FindOneArgumentMethod(
              converter,
              "FromCBORObject",
              typeof(CBORObject));
            this.converters[type] = ci;
            return this;
        }
public CBORTypeMapper AddConverter < T > ( Type type , ICBORConverter < T > converter ) { if ( type == null ) { throw new ArgumentNullException ( nameof ( type ) ) ; } if ( converter == null ) { throw new ArgumentNullException ( nameof ( converter ) ) ; } ConverterInfo ci = new ConverterInfo { Converter = converter , ToObject = PropertyMap . FindOneArgumentMethod ( converter , " " , type ) } ; if ( ci . ToObject == null ) { throw new ArgumentException ( " " ) ; } ci . FromObject = PropertyMap . FindOneArgumentMethod ( converter , " " , typeof ( CBORObject ) ) ; this . converters [ type ] = ci ; return this ; }
Registers an object that converts objects of a given type
to CBOR objects (called a CBOR converter).
Registers an object that converts objects of a given type to CBOR objects ( called a CBOR converter ) .
None
The parameter
or  is
null.
The parameter or is null .
"Converter doesn't
contain a proper ToCBORObject method".
" Converter doesn ' t contain a proper ToCBORObject method " .
type
Type
A Type object specifying the type that the
converter converts to CBOR objects.
A Type object specifying the type that the converter converts to CBOR objects .
converter
ICBORConverter<T>
The parameter
is an ICBORConverter object.
The parameter is an ICBORConverter object .
typeparam
Must be the same as the "type"
parameter.
Must be the same as the " type " parameter .