Example #1
0
        /// <inheritdoc />
        protected override bool HandleDynamic(CodeBinaryOperatorExpressionMore obj, Context ctx)
        {
            if (obj.OperatorType == CodeBinaryOperatorTypeMore.NullCoalescing)
            {
                ctx.Writer.Write("If(");
                ctx.HandlerProvider.ExpressionHandler.Handle(obj.LeftExpression, ctx);
                ctx.Writer.Write(", ");
                ctx.HandlerProvider.ExpressionHandler.Handle(obj.RightExpression, ctx);
                ctx.Writer.Write(")");
            }
            else
            {
                WrapIfNecessaryAndHandle(obj.LeftExpression, ctx);
                ctx.Writer.Write($" {VisualBasicKeywordsUtils.OperatorSymbol(obj.OperatorType)} ");
                WrapIfNecessaryAndHandle(obj.RightExpression, ctx);
            }

            return(true);
        }
Example #2
0
 /// <inheritdoc />
 protected override string GetShorthandOperatorSymbol(CodeBinaryOperatorTypeMore op)
 {
     return(op.CanBeShorthandOperator() ? VisualBasicKeywordsUtils.OperatorSymbol(op) : null);
 }