/// <inheritdoc />
        protected override void StartupCore(MethodCallExpression node)
        {
            var value = node.Object.GetValueFromExpression();

            if (value is null)
            {
                return;
            }

            Expression expression = node.Arguments[0];

            Workflow(whereIsNotEmpty =>
            {
                if (whereIsNotEmpty)
                {
                    visitor.Visit(expression);
                }
                else if (!writer.IsReverseCondition)
                {
                    writer.BooleanTrue();

                    writer.Equal();

                    writer.BooleanFalse();
                }
            }, () => VisitContains(value as IEnumerable, expression));
        }
Exemple #2
0
        private void btnDraw_Click(object sender, EventArgs e)
        {
            int x = 50, y = 100;
            var graphics = splitContainer1.Panel2.CreateGraphics();
            var oprb     = gbOperations.Controls.OfType <RadioButton>()
                           .FirstOrDefault(n => n.Checked);
            BaseVisitor visitor = Activator.CreateInstance(oprb.Tag as Type, graphics) as BaseVisitor;

            foreach (Type type in listBoxElements.Items)
            {
                Rectangle rect    = new Rectangle(x, y, 100, 100);
                var       element = Activator.CreateInstance(type, rect);
                if (element is RectangleElement)
                {
                    visitor.Visit(element as RectangleElement);
                }
                else if (element is EllipseElement)
                {
                    visitor.Visit(element as EllipseElement);
                }
                else if (element is StarElement)
                {
                    visitor.Visit(element as StarElement);
                }
                x += 150;
            }
        }
Exemple #3
0
        /// <inheritdoc />
        protected override Expression VisitMethodCall(MethodCallExpression node)
        {
            if (node.Method.DeclaringType == Types.Queryable)
            {
                VisitCore(node);

                return(node);
            }

            return(visitor.Visit(node));
        }
Exemple #4
0
 public override void Accept(BaseVisitor visitor)
 {
     visitor.Visit(this);
 }