Click or drag to resize

BinaryOperationProcessor Class

Applies the Operation on the values.

Inheritance Hierarchy
SystemObject
  TomsToolbox.EssentialsBinaryOperationProcessor

Namespace:  TomsToolbox.Essentials
Assembly:  TomsToolbox.Essentials (in TomsToolbox.Essentials.dll)
Syntax
public sealed class BinaryOperationProcessor

Return Value

Type: 
If the conversions succeed, the result of the operation is returned. If any error occurs, the result is null.

The BinaryOperationProcessor type exposes the following members.

Constructors
  NameDescription
Public methodBinaryOperationProcessor
Initializes a new instance of the BinaryOperationProcessor class.
Top
Properties
  NameDescription
Public propertyOperation
Gets the operation the converter is performing.
Top
Methods
  NameDescription
Public methodExecute
Executes the operation.
Top
Extension Methods
Remarks
This processor works with different types on both sides.

Either

- both values must be convertible to a double

or

- value1 must have an explicit operator for the specified operation and value2 has a type converter matching the expected operator parameter.

If the value supports implicit or explicit casts, the operation is retried on all types that the type can be casted to. This enables the converter to handle most operations on Vector, Size, Point, etc...

E.g. for System.Windows.Rect the Addition is mapped to "Rect.Offset(Vector)" and the Multiply is mapped to "Rect.Transform(Matrix)"

See Also