Exemplo n.º 1
0
        private static bool TypeMatches(ParameterType parameterType, CallbackParameterType callbackParameterType)
        {
            switch (callbackParameterType)
            {
            case CallbackParameterType.Array:
                return(parameterType == ParameterType.BoolArray || parameterType == ParameterType.IntArray ||
                       parameterType == ParameterType.SingleArray);

            case CallbackParameterType.Value:
                return(parameterType == ParameterType.Bool || parameterType == ParameterType.Int ||
                       parameterType == ParameterType.Single);

            case CallbackParameterType.String:
                return(parameterType == ParameterType.String);

            default:
                throw new ArgumentOutOfRangeException();
            }
        }
Exemplo n.º 2
0
 /// <summary>
 ///     Initializes a new instance of the <see cref="CallbackParameterInfo" /> struct.
 /// </summary>
 /// <param name="type">The type of the parameter.</param>
 /// <param name="lengthIndex">Index of the length of the parameter.</param>
 /// <remarks>Only applies when <paramref name="type" /> is equal to <see cref="CallbackParameterType.Array" />.</remarks>
 public CallbackParameterInfo(CallbackParameterType type, uint lengthIndex)
 {
     Type        = type;
     LengthIndex = lengthIndex;
 }