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