Table of Contents

Class Convert

Namespace
xFunc.Maths.Expressions.Units
Assembly
xFunc.Maths.dll

Represents the convert function.

public class Convert : IExpression
Inheritance
Convert
Implements
Inherited Members
Extension Methods

Constructors

Convert(IConverter, IExpression, IExpression)

Initializes a new instance of the Convert class.

public Convert(IConverter converter, IExpression value, IExpression unit)

Parameters

converter IConverter

The converter.

value IExpression

The value to convert.

unit IExpression

The target unit.

Properties

Unit

Gets the target unit.

public IExpression Unit { get; }

Property Value

IExpression

Value

Gets the value.

public IExpression Value { get; }

Property Value

IExpression

Methods

Analyze<TResult>(IAnalyzer<TResult>)

Analyzes the current expression.

public TResult Analyze<TResult>(IAnalyzer<TResult> analyzer)

Parameters

analyzer IAnalyzer<TResult>

The analyzer.

Returns

TResult

The analysis result.

Type Parameters

TResult

The type of the result.

Exceptions

ArgumentNullException

analyzer is null.

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

Analyzes the current expression.

public TResult Analyze<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.

Exceptions

ArgumentNullException

analyzer is null.

Clone(IExpression?, StringExpression?)

Clones this instance of the IExpression.

public IExpression Clone(IExpression? left = null, StringExpression? right = null)

Parameters

left IExpression

The left argument of new expression.

right StringExpression

The right argument of new expression.

Returns

IExpression

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

Deconstruct(out IExpression, out IExpression)

Deconstructs Convert.

public void Deconstruct(out IExpression value, out IExpression unit)

Parameters

value IExpression

The value to convert.

unit IExpression

The target unit.

Equals(object?)

Determines whether the specified object is equal to the current object.

public override bool Equals(object? obj)

Parameters

obj object

The object to compare with the current object.

Returns

bool

true if the specified object is equal to the current object; otherwise, false.

Execute()

Executes this expression. Don't use this method if your expression has variables or user-functions.

public object Execute()

Returns

object

A result of the execution.

Exceptions

ExecutionException

The result of evaluation of arguments is not supported.

Execute(ExpressionParameters?)

Executes this expression.

public 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

ToString()

Returns a string that represents the current object.

public override string ToString()

Returns

string

A string that represents the current object.

ToString(IFormatter)

Returns a string that represents this instance.

public string ToString(IFormatter formatter)

Parameters

formatter IFormatter

The formatter.

Returns

string

A string that represents this instance.