C# Class ImageResizer.FluentExtensions.ImageUrlBuilder

A class used to build URLs for the ImageResizer URL API
显示文件 Open project: benfoster/ImageResizer.FluentExtensions Class Usage Examples

Public Methods

Method Description
AddModifier ( string>.Func modifier ) : ImageUrlBuilder

Adds a URL modifier that will be applied when the image URL is generated

BuildUrl ( string imagePath ) : string

Builds an ImageResizer image URL using the current configuration and assigned modifiers

ClearModifiers ( ) : void

Clears all URL modifiers from this ImageUrlBuilder instance.

ImageUrlBuilder ( ) : System
SetParameter ( string parameterName, string parameterValue ) : ImageUrlBuilder

A quick way of adding parameters to the ImageUrlBuilder configuration

Private Methods

Method Description
ApplyConfiguration ( string imagePath ) : string

Applies the current configuration to imagePath

GetModifiedPath ( string path ) : string

Applies the current modifiers to the generated path

Method Details

AddModifier() public method

Adds a URL modifier that will be applied when the image URL is generated
If the modifier is null
public AddModifier ( string>.Func modifier ) : ImageUrlBuilder
modifier string>.Func
return ImageUrlBuilder

BuildUrl() public method

Builds an ImageResizer image URL using the current configuration and assigned modifiers
public BuildUrl ( string imagePath ) : string
imagePath string The source path of the image
return string

ClearModifiers() public method

Clears all URL modifiers from this ImageUrlBuilder instance.
public ClearModifiers ( ) : void
return void

ImageUrlBuilder() public method

public ImageUrlBuilder ( ) : System
return System

SetParameter() public method

A quick way of adding parameters to the ImageUrlBuilder configuration
If the or are null or empty
public SetParameter ( string parameterName, string parameterValue ) : ImageUrlBuilder
parameterName string The parameter name
parameterValue string The parameter value
return ImageUrlBuilder