| BinaryOperationProcessor Class |
Inheritance Hierarchy Namespace: TomsToolbox.EssentialsAssembly: TomsToolbox.Essentials (in TomsToolbox.Essentials.dll) Version: 2.21.0+44d18b541fc9419ec3c549350a832394661b2a4d
XMLNS for XAML: Not mapped to an xmlns.
Syntax public sealed class BinaryOperationProcessor
Public NotInheritable 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 Properties | Name | Description |
---|
| Operation |
Gets the operation the converter is performing.
|
TopMethods | Name | Description |
---|
| Execute |
Executes the operation.
|
TopExtension Methods | Name | Description |
---|
| SafeCastT |
Performs a cast from object to T, avoiding possible null violations if T is a value type.
(Defined by ObjectExtensions) |
TopRemarks
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