public ImageOption GetImageOptions(ImageType type) { foreach (var i in ImageOptions) { if (i.Type == type) { return(i); } } if (DefaultImageOptions.TryGetValue(Type, out ImageOption[] options))
public ImageOption GetImageOptions(ImageType type) { foreach (ImageOption i in ImageOptions) { if (i.Type == type) { return(i); } } ImageOption[] options; if (DefaultImageOptions.TryGetValue(Type, out options)) { foreach (ImageOption i in options) { if (i.Type == type) { return(i); } } } return(DefaultInstance); }
/// <summary> /// A URL-encoded address for a custom image /// </summary> /// <remarks> /// If you'd prefer to use your own default image (perhaps your logo, a funny face, whatever), then you can easily do so by supplying the URL to an image in the d= or default= parameter. /// </remarks> /// <param name="htmlHelper">The HTML helper.</param> /// <param name="defaultImage">The default image.</param> /// <returns></returns> public GravatarImage DefaultImage(DefaultImageOptions defaultImage) { this.defaultImage = defaultImage; return(this); }
/// <summary> /// A URL-encoded address for a custom image /// </summary> /// <remarks> /// If you'd prefer to use your own default image (perhaps your logo, a funny face, whatever), then you can easily do so by supplying the URL to an image in the d= or default= parameter. /// </remarks> /// <param name="htmlHelper">The HTML helper.</param> /// <param name="defaultImage">The default image.</param> /// <returns></returns> public GravatarImage DefaultImage(DefaultImageOptions defaultImage) { this.defaultImage = defaultImage; return this; }