C# 클래스 Sage.Extensibility.TextEvaluator

Implements a text processing system using statically and dynamically registered functions and variables.
파일 보기 프로젝트 열기: igorfrance/sage 1 사용 예제들

공개 메소드들

메소드 설명
ExtractParameter ( IEnumerable parameters, int index, string defaultValue = null ) : string

Gets the entry with the specified index from the specified parameters list.

InvokeFunction ( SageContext context, string name, string arguments ) : string

Invokes the function with the specified name using the specified context and arguments.

InvokeVariable ( SageContext context, string name ) : string

Invokes the variable with the specified name using the specified context.

Process ( string value ) : string

Processes any dynamic expressions embedded in the specified value.

Process ( string value, SageContext context ) : string

Processes any dynamic expressions embedded in the specified value, using the specified context.

RegisterFunction ( string name, TextFunction handler ) : void

Registers a function handler with the specified name.

RegisterVariable ( string name, TextVariable handler ) : void

Registers a variable handler with the specified name.

TextEvaluator ( SageContext context ) : System

Initializes a new instance of the TextEvaluator class, using the specified context.

비공개 메소드들

메소드 설명
DiscoverFunctionsAndVariables ( ) : void
OnAssembliesUpdated ( object sender, EventArgs arg ) : void
ProcessChunk ( SageContext context, string value ) : string
TextEvaluator ( ) : System

메소드 상세

ExtractParameter() 공개 정적인 메소드

Gets the entry with the specified index from the specified parameters list.
public static ExtractParameter ( IEnumerable parameters, int index, string defaultValue = null ) : string
parameters IEnumerable The list parameters.
index int The index.
defaultValue string The default value.
리턴 string

InvokeFunction() 공개 정적인 메소드

Invokes the function with the specified name using the specified context and arguments.
public static InvokeFunction ( SageContext context, string name, string arguments ) : string
context SageContext The context to use when invoking the function.
name string The name of the function to invoke.
arguments string The arguments to use when invoking the function.
리턴 string

InvokeVariable() 공개 정적인 메소드

Invokes the variable with the specified name using the specified context.
public static InvokeVariable ( SageContext context, string name ) : string
context SageContext The context to use when invoking the variable.
name string The name of the variable to invoke.
리턴 string

Process() 공개 메소드

Processes any dynamic expressions embedded in the specified value.
public Process ( string value ) : string
value string The value to process.
리턴 string

Process() 공개 정적인 메소드

Processes any dynamic expressions embedded in the specified value, using the specified context.
public static Process ( string value, SageContext context ) : string
value string The value to process.
context SageContext The context to use.
리턴 string

RegisterFunction() 공개 정적인 메소드

Registers a function handler with the specified name.
public static RegisterFunction ( string name, TextFunction handler ) : void
name string Name of the function.
handler TextFunction The function that provides the result value.
리턴 void

RegisterVariable() 공개 정적인 메소드

Registers a variable handler with the specified name.
public static RegisterVariable ( string name, TextVariable handler ) : void
name string Name of the variable.
handler TextVariable The function that provides the variable value.
리턴 void

TextEvaluator() 공개 메소드

Initializes a new instance of the TextEvaluator class, using the specified context.
public TextEvaluator ( SageContext context ) : System
context SageContext The context to use with this instance.
리턴 System