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.70.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.

[CanBeNull]

Top
Extension Methods
  NameDescription
Public Extension MethodSafeCastT
Performs a cast from object to T, avoiding possible null violations if T is a value type.

[CanBeNull]

(Defined by ObjectExtensions.)
Top
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)

See Also