C# Class NCombo.ComboHandler

Inheritance: BaseHttpHandler
Afficher le fichier Open project: gmoothart/NCombo Class Usage Examples

Méthodes publiques

Méthode Description
HandleRequest ( System.Web.HttpContextBase context ) : void
SetResponseCachePolicy ( System.Web.HttpCachePolicyBase cache ) : void
ValidateParameters ( System.Web.HttpContextBase context ) : bool

Validate query string. At this stage, just make sure it exists.

fixupCss ( string path, string contents ) : string

When combo-loading, css paths get mixed up. Must fix that

Regular Expressions and logic inspired by the PHP Loader: https://github.com/yui/phploader/blob/master/phploader/combo.php

getCacheFilename ( string query, bool withGzip, System.Web.HttpServerUtilityBase server ) : string

Calculate a unique filename representing this request.

isClientGzipEnabled ( System.Web.HttpRequestBase rq ) : bool

Méthodes protégées

Méthode Description
Init ( System.Web.HttpContextBase context ) : void

Private Methods

Méthode Description
GzipFile ( string sourceFilename, string destFilename ) : void

Gzip the source file to the dest filename.

Borrowed mostly from: http://msdn.microsoft.com/en-us/library/ms404280(v=VS.85).aspx There is a somewhat simpler method in .Net 4, using CopyTo: http://msdn.microsoft.com/en-us/library/ms404280.aspx I am not sure what difference, if any, it makes on performance.

allowedByWhitelist ( string relPath ) : bool
pathIsCSS ( string path ) : bool

Method Details

HandleRequest() public méthode

public HandleRequest ( System.Web.HttpContextBase context ) : void
context System.Web.HttpContextBase
Résultat void

Init() protected méthode

protected Init ( System.Web.HttpContextBase context ) : void
context System.Web.HttpContextBase
Résultat void

SetResponseCachePolicy() public méthode

public SetResponseCachePolicy ( System.Web.HttpCachePolicyBase cache ) : void
cache System.Web.HttpCachePolicyBase
Résultat void

ValidateParameters() public méthode

Validate query string. At this stage, just make sure it exists.
public ValidateParameters ( System.Web.HttpContextBase context ) : bool
context System.Web.HttpContextBase
Résultat bool

fixupCss() public méthode

When combo-loading, css paths get mixed up. Must fix that
Regular Expressions and logic inspired by the PHP Loader: https://github.com/yui/phploader/blob/master/phploader/combo.php
public fixupCss ( string path, string contents ) : string
path string
contents string
Résultat string

getCacheFilename() public méthode

Calculate a unique filename representing this request.
public getCacheFilename ( string query, bool withGzip, System.Web.HttpServerUtilityBase server ) : string
query string
withGzip bool
server System.Web.HttpServerUtilityBase
Résultat string

isClientGzipEnabled() public méthode

public isClientGzipEnabled ( System.Web.HttpRequestBase rq ) : bool
rq System.Web.HttpRequestBase
Résultat bool