/// <summary>
 ///     Weakly determines the node's type, if possible, and, optionally, strongly determines if there is only one possible
 ///     type left.
 /// </summary>
 /// <param name="type">The type or types to determine to.</param>
 public sealed override void DetermineWeakly(SupportableValueType type)
 {
     if ((type & SupportableValueType.Numeric) == 0)
     {
         throw new ExpressionNotValidLogicallyException();
     }
 }
    public void LimitPossibleType(SupportableValueType limit)
    {
        if (limit == SupportableValueType.None)
        {
            throw new ArgumentException(
                      string.Format(
                          CultureInfo.CurrentCulture,
                          Resources.ParameterTypeNotRecognized,
                          nameof(limit)),
                      nameof(limit));
        }

        var newVal = limit & SupportedReturnType;

        if (newVal == SupportableValueType.None)
        {
            throw new ExpressionNotValidLogicallyException();
        }

        SupportedReturnType = newVal;

        int iVal = (int)newVal;

        if (Enum.IsDefined(
                typeof(SupportedValueType),
                iVal))
        {
            DetermineType((SupportedValueType)iVal);
        }
    }
 /// <summary>
 ///     Weakly determines the node's type, if possible, and, optionally, strongly determines if there is only one possible
 ///     type left.
 /// </summary>
 /// <param name="type">The type or types to determine to.</param>
 public abstract void DetermineWeakly(SupportableValueType type);
Exemple #4
0
 /// <summary>
 /// Weakly determines the node's type, if possible, and, optionally, strongly determines if there is only one possible type left.
 /// </summary>
 /// <param name="type">The type or types to determine to.</param>
 public override void DetermineWeakly(SupportableValueType type) => parametersRegistry.AdvertiseParameter(Name).LimitPossibleType(type);