C# Class ExcelFormulaParser.Engine.Excel.Functions.ExcelFunction

显示文件 Open project: swmal/ExcelFormulaParser Class Usage Examples

Public Methods

Method Description
BeforeInvoke ( ParsingContext context ) : void
ExcelFunction ( ) : System
ExcelFunction ( ArgumentCollectionUtil argumentCollectionUtil, ArgumentParsers argumentParsers ) : System
Execute ( IEnumerable arguments, ParsingContext context ) : CompileResult

Protected Methods

Method Description
ArgToBool ( IEnumerable arguments, int index ) : bool

If the argument is a boolean value its value will be returned. If the argument is an integer value, true will be returned if its value is not 0, otherwise false.

ArgToDecimal ( IEnumerable arguments, int index ) : double
ArgToDecimal ( object obj ) : double
ArgToInt ( IEnumerable arguments, int index ) : int
ArgToString ( IEnumerable arguments, int index ) : string
ArgsToDoubleEnumerable ( IEnumerable arguments ) : IEnumerable
CalculateCollection ( IEnumerable collection, double result, Func action ) : double
CreateResult ( object result, DataType dataType ) : CompileResult
IsNumeric ( object val ) : bool
ThrowArgumentExceptionIf ( Func condition, string message ) : void
ThrowExcelFunctionException ( ExcelErrorCodes code ) : void
ThrowExcelFunctionExceptionIf ( Func condition, ExcelErrorCodes code ) : void
ValidateArguments ( IEnumerable arguments, int minLength ) : void

Method Details

ArgToBool() protected method

If the argument is a boolean value its value will be returned. If the argument is an integer value, true will be returned if its value is not 0, otherwise false.
protected ArgToBool ( IEnumerable arguments, int index ) : bool
arguments IEnumerable
index int
return bool

ArgToDecimal() protected method

protected ArgToDecimal ( IEnumerable arguments, int index ) : double
arguments IEnumerable
index int
return double

ArgToDecimal() protected method

protected ArgToDecimal ( object obj ) : double
obj object
return double

ArgToInt() protected method

protected ArgToInt ( IEnumerable arguments, int index ) : int
arguments IEnumerable
index int
return int

ArgToString() protected method

protected ArgToString ( IEnumerable arguments, int index ) : string
arguments IEnumerable
index int
return string

ArgsToDoubleEnumerable() protected method

protected ArgsToDoubleEnumerable ( IEnumerable arguments ) : IEnumerable
arguments IEnumerable
return IEnumerable

BeforeInvoke() public method

public BeforeInvoke ( ParsingContext context ) : void
context ParsingContext
return void

CalculateCollection() protected method

protected CalculateCollection ( IEnumerable collection, double result, Func action ) : double
collection IEnumerable
result double
action Func
return double

CreateResult() protected method

protected CreateResult ( object result, DataType dataType ) : CompileResult
result object
dataType DataType
return ExcelFormulaParser.Engine.ExpressionGraph.CompileResult

ExcelFunction() public method

public ExcelFunction ( ) : System
return System

ExcelFunction() public method

public ExcelFunction ( ArgumentCollectionUtil argumentCollectionUtil, ArgumentParsers argumentParsers ) : System
argumentCollectionUtil ArgumentCollectionUtil
argumentParsers ArgumentParsers
return System

Execute() public abstract method

public abstract Execute ( IEnumerable arguments, ParsingContext context ) : CompileResult
arguments IEnumerable
context ParsingContext
return ExcelFormulaParser.Engine.ExpressionGraph.CompileResult

IsNumeric() protected method

protected IsNumeric ( object val ) : bool
val object
return bool

ThrowArgumentExceptionIf() protected method

protected ThrowArgumentExceptionIf ( Func condition, string message ) : void
condition Func
message string
return void

ThrowExcelFunctionException() protected method

protected ThrowExcelFunctionException ( ExcelErrorCodes code ) : void
code ExcelFormulaParser.Engine.Exceptions.ExcelErrorCodes
return void

ThrowExcelFunctionExceptionIf() protected method

protected ThrowExcelFunctionExceptionIf ( Func condition, ExcelErrorCodes code ) : void
condition Func
code ExcelFormulaParser.Engine.Exceptions.ExcelErrorCodes
return void

ValidateArguments() protected method

protected ValidateArguments ( IEnumerable arguments, int minLength ) : void
arguments IEnumerable
minLength int
return void