Beispiel #1
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;
            }
        }
Beispiel #2
0
        /// <inheritdoc />
        public CoreVisitor(BaseVisitor visitor, bool isNewWriter = false, ConditionType conditionType = ConditionType.Where) : base(visitor, isNewWriter)
        {
            this.visitor = visitor ?? throw new ArgumentNullException(nameof(visitor));

            hasVisitor = true;

            switch (conditionType)
            {
            case ConditionType.And:
                whereSwitch = new WhereSwitch(writer.And, writer.And);
                break;

            case ConditionType.Having:
                whereSwitch = new WhereSwitch(writer.Having, writer.And);
                break;

            case ConditionType.Where:
            default:
                whereSwitch = new WhereSwitch(writer.Where, writer.And);
                break;
            }
        }
Beispiel #3
0
 /// <inheritdoc />
 public SetExistsVisitor(BaseVisitor visitor) : base(visitor)
 {
 }
Beispiel #4
0
 /// <inheritdoc />
 public SetContainsVisitor(BaseVisitor visitor) : base(visitor, false)
 {
     this.visitor = visitor;
 }
Beispiel #5
0
 /// <inheritdoc />
 public SelectVisitor(BaseVisitor visitor, bool isNewWriter = true) : base(visitor, isNewWriter)
 {
     orderBySwitch = new OrderBySwitch(writer.OrderBy, writer.Delimiter);
 }
Beispiel #6
0
 public abstract void Accept(BaseVisitor visitor);
Beispiel #7
0
 public override void Accept(BaseVisitor visitor)
 {
     visitor.Visit(this);
 }
Beispiel #8
0
 private QueryVisitor(BaseVisitor baseVisitor) : base(baseVisitor)
 {
 }
Beispiel #9
0
 public override void Visit(BaseVisitor visitor)
 {
 }
Beispiel #10
0
 public override void Visit(BaseVisitor visitor) => visitor.VisitRealNumNode(this);
Beispiel #11
0
 public override void Visit(BaseVisitor visitor) => visitor.VisitIndexAccessExpressionNode(this);
Beispiel #12
0
 public override void Visit(BaseVisitor visitor) => visitor.VisitBinaryExpressionNode(this);
Beispiel #13
0
 public override void Visit(BaseVisitor visitor) => visitor.VisitCallFunctionNode(this);
Beispiel #14
0
 public override void Visit(BaseVisitor visitor) => visitor.VisitCallProcedureNode(this);
Beispiel #15
0
 /// <inheritdoc />
 public GroupByLinqVisitor(BaseVisitor visitor) : base(visitor, false, ConditionType.And)
 {
 }
Beispiel #16
0
 /// <inheritdoc />
 public WhereVisitor(BaseVisitor visitor) : base(visitor, false)
 {
     this.visitor = visitor;
 }
Beispiel #17
0
 public override void Visit(BaseVisitor visitor) => visitor.VisitDefineTupleNode(this);
Beispiel #18
0
 /// <inheritdoc />
 public override SelectVisitor CreateInstance(BaseVisitor baseVisitor) => new QueryVisitor(baseVisitor);
Beispiel #19
0
 public override void Visit(BaseVisitor visitor) => visitor.VisitTupleVarNode(this);
Beispiel #20
0
 public override void Visit(BaseVisitor visitor) => visitor.VisitAssignTupleNode(this);
Beispiel #21
0
 public override void Visit(BaseVisitor visitor) => visitor.VisitForNode(this);
Beispiel #22
0
 public InsertSelectVisitor(BaseVisitor visitor, List <string> insertFields) : base(visitor)
 {
     this.insertFields = insertFields;
 }
Beispiel #23
0
 public override void Visit(BaseVisitor visitor) => visitor.VisitStringNode(this);
Beispiel #24
0
 public abstract void Visit(BaseVisitor visitor);
Beispiel #25
0
 public override void Visit(BaseVisitor visitor) => visitor.VisitComplexIDNode(this);
Beispiel #26
0
 /// <inheritdoc />
 public LinqAnyVisitor(BaseVisitor visitor) : base(visitor)
 {
 }
 public InterpreterNodeTraverser(BaseVisitor visitor = null)
 {
     this.visitor = visitor ?? new defaultVisitor();
 }
Beispiel #28
0
 /// <inheritdoc />
 public NestedAnyVisitor(BaseVisitor visitor) : base(visitor, false)
 {
 }
Beispiel #29
0
 /// <inheritdoc />
 public NestedContainsVisitor(BaseVisitor visitor) : base(visitor, false)
 {
 }