Example #1
0
        public bool BreakCheck()
        {
            bool BoolOutput = false;

            for (int i = 0; i < ControlOrder.Count; i++)
            {
                StatementBase us = ControlOrder[i];

                if (us.GetType() == typeof(BreakControl))
                {
                    BoolOutput = true;
                }
                else if (us.GetType() == typeof(Loop))
                {
                    Loop Me = (Loop)us;
                    BoolOutput = Me.statementBlock1.BreakCheck();
                }
                else if (us.GetType() == typeof(Conditions))
                {
                    Conditions Me = (Conditions)us;
                    BoolOutput = Me.statementBlock1.BreakCheck();
                    BoolOutput = Me.statementBlock2.BreakCheck();
                }
                else if (us.GetType() == typeof(CaseControl))
                {
                    CaseControl Me = (CaseControl)us;
                    BoolOutput = Me.statementBlock1.BreakCheck();
                }
            }
            return(BoolOutput);
        }
Example #2
0
        public void InsertContlols(StatementBase item)
        {
            IndexNumber++;
            if (item.GetType().Equals(typeof(AddMethod)))
            {
                item.Name = "AddMethod" + number.ToString();
                item.Size = new Size(460, 270);
            }
            if (item.GetType().Equals(typeof(MainMethod)))
            {
                item.Name = "Main" + number.ToString();
                item.Size = new Size(500, 400);
            }
            else if (item.GetType().Equals(typeof(VariableDefine)))
            {
                item.Name = "VariableDefine" + number.ToString();
                item.Size = new Size(400, 200);
            }
            else if (item.GetType().Equals(typeof(OutputConsole)))
            {
                item.Name = "OutputConsole" + number.ToString();
                item.Size = new Size(400, 200);
            }
            else if (item.GetType().Equals(typeof(Conditions)))
            {
                item.Name = "Conditions" + number.ToString();
                item.Size = new Size(460, 200);
            }
            else if (item.GetType().Equals(typeof(Calculation)))
            {
                item.Name = "Calculation" + number.ToString();
                item.Size = new Size(400, 200);
            }
            else if (item.GetType().Equals(typeof(InputConsole)))
            {
                item.Name = "ImputConsole" + number.ToString();
                item.Size = new Size(400, 200);
            }
            else if (item.GetType().Equals(typeof(Loop)))
            {
                item.Name = "Loop" + number.ToString();
                item.Size = new Size(460, 200);
            }
            else if (item.GetType().Equals(typeof(ListDefine)))
            {
                item.Name = "ListDefine" + number.ToString();
                item.Size = new Size(460, 200);
            }
            else if (item.GetType().Equals(typeof(ArrayDefine)))
            {
                item.Name = "ArrayDefine" + number.ToString();
                item.Size = new Size(400, 200);
            }
            else if (item.GetType().Equals(typeof(BreakControl)))
            {
                item.Name = "ArrayDefine" + number.ToString();
                item.Size = new Size(400, 100);
            }
            else if (item.GetType().Equals(typeof(ReturnMold)))
            {
                item.Name = "ReturnMold" + number.ToString();
                item.Size = new Size(400, 200);
            }
            else if (item.GetType().Equals(typeof(Assignment)))
            {
                item.Name = "Assignment" + number.ToString();
                item.Size = new Size(400, 200);
            }
            else if (item.GetType().Equals(typeof(CaseControl)))
            {
                item.Name = "CaseControl" + number.ToString();
            }

            this.Controls.Add(item);
            Button us1 = new Button();

            Name1      = "AddButton" + number.ToString();
            us1.Name   = Name1;
            us1.Size   = new Size(400, 30);
            us1.Text   = "コントロールをたす";
            us1.Click += addbutton;
            this.Controls.Add(us1);
            ControlAddButton.Insert(IndexNumber, us1);

            ControlOrder.Insert(IndexNumber, item);

            number++;

            Sorting();
        }