Exemplo n.º 1
0
        public static ArgumentException FunctionWithSameNameAndSignatureAlreadyInCollection(string paramName, FunctionBinding functionBinding)
        {
            if (paramName == null)
            {
                throw new ArgumentNullException("paramName");
            }

            if (functionBinding == null)
            {
                throw new ArgumentNullException("functionBinding");
            }

            StringBuilder sb = new StringBuilder();

            sb.Append(functionBinding.Name);
            sb.Append("(");
            FormattingHelpers.FormatTypeList(functionBinding.GetParameterTypes());
            sb.Append(")");

            string signature = sb.ToString();
            string message   = String.Format(CultureInfo.CurrentCulture, Resources.FunctionWithSameNameAndSignatureAlreadyInCollection, signature);

            return(new ArgumentException(message, paramName));
        }
Exemplo n.º 2
0
        void IErrorReporter.UnterminatedParenthesizedIdentifier(SourceLocation location, string tokenText)
        {
            string message = String.Format(CultureInfo.CurrentCulture, Resources.UnterminatedParenthesizedIdentifier, FormattingHelpers.GetFirstLine(tokenText));

            HandleError(CreateSourceRange(location), ErrorId.UnterminatedParenthesizedIdentifier, message);
        }
Exemplo n.º 3
0
        void IErrorReporter.InvalidDataTypeInUnion(Type expressionType, BinaryQueryOperator unionOperator)
        {
            string unionOperatorString = unionOperator.ToString().ToUpper(CultureInfo.CurrentCulture);
            string message             = String.Format(CultureInfo.CurrentCulture, Resources.InvalidDataTypeInUnion, FormattingHelpers.FormatType(expressionType), unionOperatorString);

            HandleError(ErrorId.InvalidDataTypeInUnion, message);
        }
Exemplo n.º 4
0
        void IErrorReporter.InvalidDataTypeInOrderBy(Type expressionType)
        {
            string message = String.Format(CultureInfo.CurrentCulture, Resources.InvalidDataTypeInOrderBy, FormattingHelpers.FormatType(expressionType));

            HandleError(ErrorId.InvalidDataTypeInOrderBy, message);
        }
Exemplo n.º 5
0
        void IErrorReporter.AggregateDoesNotSupportType(AggregateBinding aggregateBinding, Type argumentType)
        {
            string message = String.Format(CultureInfo.CurrentCulture, Resources.AggregateDoesNotSupportType, aggregateBinding.Name, FormattingHelpers.FormatType(argumentType));

            HandleError(ErrorId.AggregateDoesNotSupportType, message);
        }
Exemplo n.º 6
0
        void IErrorReporter.CannotCast(ExpressionNode expression, Type targetType)
        {
            string message = String.Format(CultureInfo.CurrentCulture, Resources.CannotCast, expression.GenerateSource(), FormattingHelpers.FormatType(expression.ExpressionType), FormattingHelpers.FormatType(targetType));

            HandleError(ErrorId.CannotCast, message);
        }
Exemplo n.º 7
0
        void IErrorReporter.WhenMustEvaluateToBoolIfCaseInputIsOmitted(ExpressionNode whenExpression)
        {
            string message = String.Format(CultureInfo.CurrentCulture, Resources.WhenMustEvaluateToBoolIfCaseInputIsOmitted, whenExpression.GenerateSource(), FormattingHelpers.FormatType(typeof(bool)));

            HandleError(ErrorId.WhenMustEvaluateToBoolIfCaseInputIsOmitted, message);
        }
Exemplo n.º 8
0
        void IErrorReporter.AmbiguousOperator(CastingOperatorType castingOperatorType, MethodInfo targetFromSource, MethodInfo sourceToTarget)
        {
            string message = String.Format(CultureInfo.CurrentCulture, Resources.AmbiguousCastingOperator, castingOperatorType, FormattingHelpers.FormatMethodInfo(targetFromSource), FormattingHelpers.FormatMethodInfo(sourceToTarget));

            HandleError(ErrorId.AmbiguousCastingOperator, message);
        }
Exemplo n.º 9
0
        void IErrorReporter.CannotApplyOperator(UnaryOperator op, Type type)
        {
            string message = String.Format(CultureInfo.CurrentCulture, Resources.CannotApplyUnaryOp, op.TokenText, FormattingHelpers.FormatType(type));

            HandleError(ErrorId.CannotApplyUnaryOperator, message);
        }
Exemplo n.º 10
0
 void IErrorReporter.AmbiguousInvocation(InvocableBinding function1, InvocableBinding function2, Type[] argumentTypes)
 {
     if (argumentTypes.Length == 0)
     {
         string message = String.Format(CultureInfo.CurrentCulture, Resources.AmbiguousInvocationNoArgs, function1.GetFullName(), function2.GetFullName());
         HandleError(ErrorId.AmbiguousInvocation, message);
     }
     else
     {
         string message = String.Format(CultureInfo.CurrentCulture, Resources.AmbiguousInvocation, function1.GetFullName(), function2.GetFullName(), FormattingHelpers.FormatTypeList(argumentTypes));
         HandleError(ErrorId.AmbiguousInvocation, message);
     }
 }
Exemplo n.º 11
0
        void IErrorReporter.AmbiguousType(string typeReference, Type[] candidates)
        {
            string message = String.Format(CultureInfo.CurrentCulture, Resources.AmbiguousType, typeReference, FormattingHelpers.FormatFullyQualifiedTypeList(candidates));

            HandleError(ErrorId.AmbiguousType, message);
        }
Exemplo n.º 12
0
        void IErrorReporter.AmbiguousProperty(SourceRange sourceRange, Identifier identifier, PropertyBinding[] candidates)
        {
            string message = String.Format(CultureInfo.CurrentCulture, Resources.AmbiguousProperty, identifier, FormattingHelpers.FormatBindingList(candidates));

            HandleError(sourceRange, ErrorId.AmbiguousProperty, message);
        }
Exemplo n.º 13
0
        void IErrorReporter.AmbiguousReference(SourceRange sourceRange, Identifier identifier, Binding[] candidates)
        {
            string message = String.Format(CultureInfo.CurrentCulture, Resources.AmbiguousReference, identifier, FormattingHelpers.FormatBindingListWithCategory(candidates));

            HandleError(sourceRange, ErrorId.AmbiguousReference, message);
        }
Exemplo n.º 14
0
        void IErrorReporter.UndeclaredProperty(SourceRange sourceRange, Type type, Identifier identifier)
        {
            string message = String.Format(CultureInfo.CurrentCulture, Resources.UndeclaredProperty, FormattingHelpers.FormatType(type), identifier);

            HandleError(sourceRange, ErrorId.UndeclaredProperty, message);
        }
Exemplo n.º 15
0
        void IErrorReporter.UndeclaredMethod(SourceRange sourceRange, Type declaringType, Identifier identifier, Type[] parameterTypes)
        {
            string message = String.Format(CultureInfo.CurrentCulture, Resources.UndeclaredMethod, declaringType.Name, identifier, FormattingHelpers.FormatTypeList(parameterTypes));

            HandleError(sourceRange, ErrorId.UndeclaredMethod, message);
        }