|
using System.Collections.Generic;
using System.Text.RegularExpressions;
namespace MinifyContent.Expressions
{
/// <summary>
/// Delegate allows to define method for minify content
/// </summary>
/// <param name="sender">Expression object</param>
/// <param name="input">Content string</param>
/// <returns></returns>
internal delegate string Replace(Expression sender, string input);
/// <summary>
/// A class to define expressions to minify content
/// </summary>
class Expression
{
public Expression()
{ }
public Expression(Regex expr, string replaceWith = "")
{ RegularExpression = expr; ReplaceWith = replaceWith; }
public Expression(List<Regex> exprs, string replaceWith = "")
{ RegularExpressions = exprs; ReplaceWith = replaceWith; }
public bool EscapeInCss { get; set; }
public bool EscapeInJs { get; set; }
public Regex RegularExpression { get; private set; }
public List<Regex> RegularExpressions { get; private set; }
public string ReplaceWith { get; private set; }
public Replace ReplaceHandler { get; set; }
}
}
|
By viewing downloads associated with this article you agree to the Terms of Service and the article's licence.
If a file you wish to view isn't highlighted, and is a text file (not binary), please
let us know and we'll add colourisation support for it.
Mehul Thakkar is having 8 yrs of experience in IT industry. He is having good command over Ms .Net and Ms Sql Server