Exemplo n.º 1
0
 /// <summary>
 /// Creates instance with default converter registrations.
 /// </summary>
 /// <param name="storage">'First is the source type, second key is the target type' storage.</param>
 /// <param name="exceptionHandler">A handler for expcetions raised by converters.</param>
 public DefaultConverterRepository(Dictionary <Type, Dictionary <Type, IConverter> > storage, Action <Exception> exceptionHandler)
 {
     Ensure.NotNull(storage, "storage");
     Ensure.NotNull(exceptionHandler, "exceptionHandler");
     this.storage           = storage;
     this.exceptionHandler  = exceptionHandler;
     this.onSearchConverter = new OutFuncCollection <ConverterSearchContext, IConverter, bool>();
 }
Exemplo n.º 2
0
 /// <summary>
 /// Creates a new instance that uses <paramref name="inner"/> if converter is not found.
 /// </summary>
 /// <param name="inner"></param>
 /// <param name="exceptionHandler">A handler for expcetions raised by converters.</param>
 public DefaultConverterRepository(IConverterRepository inner, Action <Exception> exceptionHandler)
 {
     Ensure.NotNull(inner, "inner");
     Ensure.NotNull(exceptionHandler, "exceptionHandler");
     this.inner             = inner;
     this.exceptionHandler  = exceptionHandler;
     this.onSearchConverter = new OutFuncCollection <ConverterSearchContext, IConverter, bool>();
 }
 /// <summary>
 /// Creates instance with default converter registrations.
 /// </summary>
 /// <param name="storage">'First is the source type, second key is the target type' storage.</param>
 public DefaultConverterRepository(Dictionary <Type, Dictionary <Type, IConverter> > storage)
 {
     Ensure.NotNull(storage, "storage");
     this.storage           = storage;
     this.onSearchConverter = new OutFuncCollection <ConverterSearchContext, IConverter, bool>();
 }