Beispiel #1
0
        protected override void InitializationShapes()
        {
            RectangleTextCode = new RectangleText(
                new Size(400, 400),
                Brushes.Red,
                new Text()
            {
                Point    = new Point(LeftBorder.X + 350, LeftBorder.Y + 50),
                TextLine = UpdateTextCode()
            }
                );

            BeginEllipse = new Ellipse(
                new Point(LeftBorder.X, LeftBorder.Y + 25),
                new Size(200, 30),
                Brushes.White,
                new Text()
            {
                Point = new Point(LeftBorder.X + 50, LeftBorder.Y + 25), TextLine = "begin"
            }
                );

            InitializationIndex = new ClosedLine(
                new[]
            {
                new Point(LeftBorder.X, BeginEllipse.GetDown().Y + 25),
                new Point(LeftBorder.X + 200, BeginEllipse.GetDown().Y + 25),
                new Point(LeftBorder.X + 200, BeginEllipse.GetDown().Y + 75),
                new Point(LeftBorder.X, BeginEllipse.GetDown().Y + 75)
            },
                Brushes.White,
                new Text()
            {
                Point = new Point(LeftBorder.X + 50, BeginEllipse.GetDown().Y + 30), TextLine = $"i := {StartCycleIndex}"
            }
                );

            Cycle = new ClosedLine(
                new[]
            {
                new Point(InitializationIndex.GetLeft().X, InitializationIndex.GetLeft().Y + 75),
                new Point(InitializationIndex.GetDown().X, InitializationIndex.GetDown().Y + 25),
                new Point(InitializationIndex.GetRight().X, InitializationIndex.GetRight().Y + 75),
                new Point(InitializationIndex.GetDown().X, InitializationIndex.GetDown().Y + 75)
            },
                Brushes.White,
                new Text()
            {
                Point = new Point(LeftBorder.X + 60, InitializationIndex.GetDown().Y + 30), TextLine = $"i < {EndCycleIndex}"
            }
                );
            CycleBodySum = new ClosedLine(
                new[]
            {
                new Point(LeftBorder.X, Cycle.GetDown().Y + 50),
                new Point(LeftBorder.X + 200, Cycle.GetDown().Y + 50),
                new Point(LeftBorder.X + 200, Cycle.GetDown().Y + 100),
                new Point(LeftBorder.X, Cycle.GetDown().Y + 100)
            },
                Brushes.White,
                new Text()
            {
                Point = new Point(LeftBorder.X + 50, Cycle.GetDown().Y + 60), TextLine = "sum += i"
            }
                );
            CycleBodyIndex = new ClosedLine(
                new[]
            {
                new Point(LeftBorder.X, CycleBodySum.GetDown().Y + 50),
                new Point(LeftBorder.X + 200, CycleBodySum.GetDown().Y + 50),
                new Point(LeftBorder.X + 200, CycleBodySum.GetDown().Y + 100),
                new Point(LeftBorder.X, CycleBodySum.GetDown().Y + 100)
            },
                Brushes.White,
                new Text()
            {
                Point = new Point(LeftBorder.X + 50, CycleBodySum.GetDown().Y + 60), TextLine = "i += 1"
            }
                );
            Result = new ClosedLine(
                new[]
            {
                new Point(LeftBorder.X, CycleBodyIndex.GetDown().Y + 75),
                new Point(LeftBorder.X + 200, CycleBodyIndex.GetDown().Y + 75),
                new Point(LeftBorder.X + 200, CycleBodyIndex.GetDown().Y + 125),
                new Point(LeftBorder.X, CycleBodyIndex.GetDown().Y + 125)
            },
                Brushes.White,
                new Text()
            {
                Point = new Point(LeftBorder.X + 50, CycleBodyIndex.GetDown().Y + 80), TextLine = "sum"
            }
                );

            EndEllipse = new Ellipse(
                new Point(LeftBorder.X, Result.GetDown().Y + 50),
                new Size(200, 30),
                Brushes.White,
                new Text()
            {
                Point = new Point(LeftBorder.X + 50, Result.GetDown().Y + 50), TextLine = "end"
            }
                );
        }
Beispiel #2
0
        protected override void InitializationShapes()
        {
            RectangleTextCode = new RectangleText(
                new Size(400, 400),
                Brushes.Red,
                new Text()
            {
                Point    = new Point(LeftBorder.X + 350, LeftBorder.Y + 50),
                TextLine = UpdateTextCode()
            }
                );

            BeginEllipse = new Ellipse(
                new Point(LeftBorder.X, LeftBorder.Y + 50),
                new Size(200, 30),
                Brushes.White,
                new Text()
            {
                Point = new Point(LeftBorder.X + 50, LeftBorder.Y + 50), TextLine = "begin"
            }
                );

            Cycle = new ClosedLine(
                new[]
            {
                new Point(LeftBorder.X, BeginEllipse.GetDown().Y + 50),
                new Point(LeftBorder.X + 50, BeginEllipse.GetDown().Y + 25),
                new Point(LeftBorder.X + 150, BeginEllipse.GetDown().Y + 25),
                new Point(LeftBorder.X + 200, BeginEllipse.GetDown().Y + 50),
                new Point(LeftBorder.X + 150, BeginEllipse.GetDown().Y + 75),
                new Point(LeftBorder.X + 50, BeginEllipse.GetDown().Y + 75),
            },
                Brushes.White,
                new Text()
            {
                Point = new Point(LeftBorder.X + 23, BeginEllipse.GetDown().Y + 30), TextLine = "i:=1; 10; +1"
            }
                );
            CycleBody = new ClosedLine(
                new[]
            {
                new Point(LeftBorder.X, Cycle.GetDown().Y + 50),
                new Point(LeftBorder.X + 200, Cycle.GetDown().Y + 50),
                new Point(LeftBorder.X + 200, Cycle.GetDown().Y + 100),
                new Point(LeftBorder.X, Cycle.GetDown().Y + 100)
            },
                Brushes.White,
                new Text()
            {
                Point = new Point(LeftBorder.X + 25, Cycle.GetDown().Y + 55), TextLine = "sum += i"
            }
                );
            Result = new ClosedLine(
                new[]
            {
                new Point(LeftBorder.X, CycleBody.GetDown().Y + 75),
                new Point(LeftBorder.X + 200, CycleBody.GetDown().Y + 75),
                new Point(LeftBorder.X + 200, CycleBody.GetDown().Y + 125),
                new Point(LeftBorder.X, CycleBody.GetDown().Y + 125)
            },
                Brushes.White,
                new Text()
            {
                Point = new Point(LeftBorder.X + 50, CycleBody.GetDown().Y + 80), TextLine = "sum"
            }
                );

            EndEllipse = new Ellipse(
                new Point(LeftBorder.X, Result.GetDown().Y + 50),
                new Size(200, 30),
                Brushes.White,
                new Text()
            {
                Point = new Point(LeftBorder.X + 50, Result.GetDown().Y + 50), TextLine = "end"
            }
                );
        }