src/AppMotor.Core/Extensions/TypeExtensions.cs
/// <summary>
/// Returns the <see cref="MethodInfo"/> for the specified custom binary (i.e. two parameters/operands) operator
/// defined in this type. Returns <c>null</c>, if the operator method doesn't exist.
/// </summary>
/// <param name="type"></param>
/// <param name="operator">The operator</param>
/// <param name="otherType">The type of the other operand (one is always this type);
/// can be the same as this type</param>
/// <param name="otherTypeIsSecondOperand">Whether <paramref name="otherType"/> is used as first (<c>false</c>)
/// or as second (<c>true</c>) operand; the latter is the default</param>
Returns the  for the specified custom binary  operator
defined in this type. Returns null
Returns the for the specified custom binary operator defined in this type . Returns null
[MustUseReturnValue]
    public static MethodInfo? GetOperator(this Type type, BinaryOperators @operator, Type otherType, bool otherTypeIsSecondOperand = true)
    {
        if (otherTypeIsSecondOperand)
        {
            return type.GetMethod("op_" + @operator, BindingFlags.Public | BindingFlags.Static, new[] { type, otherType });
        }
        else
        {
            return type.GetMethod("op_" + @operator, BindingFlags.Public | BindingFlags.Static, new[] { otherType, type });
        }
    }
[ MustUseReturnValue ] public static MethodInfo ? GetOperator ( this Type type , BinaryOperators @operator , Type otherType , bool otherTypeIsSecondOperand = true ) { if ( otherTypeIsSecondOperand ) { return type . GetMethod ( " " + @operator , BindingFlags . Public | BindingFlags . Static , new [ ] { type , otherType } ) ; } else { return type . GetMethod ( " " + @operator , BindingFlags . Public | BindingFlags . Static , new [ ] { otherType , type } ) ; } }
Returns the  for the specified custom binary (i.e.
Returns the for the specified custom binary ( i . e .
Type
this
@operator
BinaryOperators
otherType
Type
The type of the other operand (one is always this type);
can be the same as this type
The type of the other operand ( one is always this type ) ; can be the same as this type
otherTypeIsSecondOperand
bool
Whether  is used as first (falsetrue
Whether is used as first ( falsetrue
type
None
operator
None