This class wraps a delegate, allowing it to be used as a parameter
to any string-formatting method (such as ).
For example:
var textWithLink = String.Format("Please click on {0:this link}.", new FormatDelegate((text) => Html.ActionLink(text, "SomeAction"));
Inheritance
FormatDelegate
public class FormatDelegate : IFormattable
Constructors
Declaration
public FormatDelegate(Func<string, IFormatProvider, string> getFormat)
Parameters
Type |
Name |
Description |
Func<String, IFormatProvider, String> |
getFormat |
|
Declaration
public FormatDelegate(Func<string, string> getFormat)
Parameters
Methods
Implements System.IFormattable
Declaration
public string ToString(string format, IFormatProvider formatProvider)
Parameters
Type |
Name |
Description |
String |
format |
|
IFormatProvider |
formatProvider |
|
Returns
Extension Methods