Table of Contents

Class If

Namespace
xFunc.Maths.Expressions.Programming
Assembly
xFunc.Maths.dll

Represents the "if-else" statement.

public class If : DifferentParametersExpression, IExpression
Inheritance
If
Implements
Inherited Members
Extension Methods

Constructors

If(ImmutableArray<IExpression>)

Initializes a new instance of the If class.

public If(ImmutableArray<IExpression> arguments)

Parameters

arguments ImmutableArray<IExpression>

The arguments.

If(IExpression, IExpression)

Initializes a new instance of the If class.

public If(IExpression condition, IExpression then)

Parameters

condition IExpression

The condition.

then IExpression

The "then" statement.

If(IExpression, IExpression, IExpression)

Initializes a new instance of the If class.

public If(IExpression condition, IExpression then, IExpression @else)

Parameters

condition IExpression

The condition.

then IExpression

The "then" statement.

else IExpression

The "else" statement.

Properties

Condition

Gets the condition.

public IExpression Condition { get; }

Property Value

IExpression

Else

Gets the "else" statement.

public IExpression? Else { get; }

Property Value

IExpression

MaxParametersCount

Gets the maximum count of parameters. null - Infinity.

public override int? MaxParametersCount { get; }

Property Value

int?

MinParametersCount

Gets the minimum count of parameters.

public override int? MinParametersCount { get; }

Property Value

int?

Then

Gets the "then" statement.

public IExpression Then { get; }

Property Value

IExpression

Methods

AnalyzeInternal<TResult>(IAnalyzer<TResult>)

Analyzes the current expression.

protected override TResult AnalyzeInternal<TResult>(IAnalyzer<TResult> analyzer)

Parameters

analyzer IAnalyzer<TResult>

The analyzer.

Returns

TResult

The analysis result.

Type Parameters

TResult

The type of the result.

AnalyzeInternal<TResult, TContext>(IAnalyzer<TResult, TContext>, TContext)

Analyzes the current expression.

protected override TResult AnalyzeInternal<TResult, TContext>(IAnalyzer<TResult, TContext> analyzer, TContext context)

Parameters

analyzer IAnalyzer<TResult, TContext>

The analyzer.

context TContext

The context.

Returns

TResult

The analysis result.

Type Parameters

TResult

The type of the result.

TContext

The type of additional parameter for analyzer.

Clone(ImmutableArray<IExpression>?)

Clones this instance of the IExpression.

public override IExpression Clone(ImmutableArray<IExpression>? arguments = null)

Parameters

arguments ImmutableArray<IExpression>?

The list of arguments.

Returns

IExpression

Returns the new instance of IExpression that is a clone of this instance.

Execute(ExpressionParameters?)

Executes this expression.

public override object Execute(ExpressionParameters? parameters)

Parameters

parameters ExpressionParameters

An object that contains all parameters and functions for expressions.

Returns

object

A result of the execution.

Exceptions

ExecutionException

The result of evaluation of arguments is not supported.

See Also