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) Version: 2.21.0+44d18b541fc9419ec3c549350a832394661b2a4d
XMLNS for XAML: Not mapped to an xmlns.
Syntax
public sealed class BinaryOperationProcessor

Return Value

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
 NameDescription
Public Extension MethodSafeCastT Performs a cast from object to T, avoiding possible null violations if T is a value type.
(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...

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