/// <summary> /// 对输出值的类型为字节数组使用默认管道。 /// </summary> /// <param name="options">ImageEx 配置项。</param> /// <returns>ImageEx 配置项。</returns> public static IImageExOptions <byte[]> WithDefaultPipes([NotNull] this IImageExOptions <byte[]> options) { if (options == null) { throw new ArgumentNullException(nameof(options)); } options.AddPipe(typeof(MemoryCachePipe <>)); options.AddPipe(typeof(StringPipe <>)); options.AddPipe(typeof(DiskCachePipe <>)); options.AddPipe(typeof(UriPipe <>)); return(options); }
/// <summary> /// 对输出值的类型为 <see cref="ImageSource" /> 使用默认管道。 /// </summary> /// <param name="options">ImageEx 配置项。</param> /// <returns>ImageEx 配置项。</returns> public static IImageExOptions <ImageSource> WithDefaultPipes([NotNull] this IImageExOptions <ImageSource> options) { if (options == null) { throw new ArgumentNullException(nameof(options)); } ((IImageExOptions)options).WithDefaultPipes(); options.AddPipe <ImageSource, StreamToImageSourcePipe>(); return(options); }