[]
        
(Showing Draft Content)

GrapeCity.Documents.Excel.IFormulaResolver.Evaluate

Evaluate Method

Evaluate(string)

Evaluates the specified custom name and returns its value.

Declaration
object Evaluate(string text)
Function Evaluate(text As String) As Object
Parameters
Type Name Description
string text

The custom name to evaluate.

Returns
Type Description
object

The value resolved for the specified custom name.

Examples
class CustomFormulaResolver : IFormulaResolver
{
    public bool IsCustomName(string text)
    {
        return text == "TaxRate";
    }

    public object Evaluate(string text)
    {
        return text == "TaxRate" ? 0.08 : null;
    }
}

IFormulaResolver resolver = new CustomFormulaResolver();
object value = resolver.Evaluate("TaxRate");