Click or drag to resize

BinaryOperationProcessor Class

Applies the Operation on the values.

Inheritance Hierarchy
SystemObject
  TomsToolbox.DesktopBinaryOperationProcessor

Namespace:  TomsToolbox.Desktop
Assembly:  TomsToolbox.Desktop (in TomsToolbox.Desktop.dll) Version: 1.0.64.0 (1.0.64.0)
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...

For Rect the Addition is mapped to Offset(Vector) and the Multiply is mapped to Transform(Matrix)

Contracts
Invariants
_operationMethodNames != null
_operationMethod != null
_additionMethod != null
_subtractionMethod != null
_multiplyMethod != null
_divisionMethod != null
_equalityMethod != null
_inequalityMethod != null
_greaterThanMethod != null
_lessThanMethod != null
_greaterThanOrEqualMethod != null
_lessThanOrEqualMethod != null
Learn more about contracts
See Also