Пример #1
0
        public void ClearAndStart(int[][] groups, string[][] mainArray)
        {
            Calculation3 c3 = new Calculation3(groups.Clone() as int[][], mainArray.Clone() as string[][]);

            c3.StartCalculation(out relationMatrix, out distinctGroups);

            df3 = new DrawingForm3();
            df3.StartDraw(mainPanel, relationMatrix, distinctGroups);

            groupCount = new Label
            {
                Location    = new System.Drawing.Point(5 * mainPanel.Width / 12, 0),
                Font        = new System.Drawing.Font("Times New Roman", 36, System.Drawing.FontStyle.Regular),
                ForeColor   = System.Drawing.ColorTranslator.FromHtml("#C4DFE6"),
                BackColor   = System.Drawing.ColorTranslator.FromHtml("#003B46"),
                Size        = new System.Drawing.Size(mainPanel.Width / 6, mainPanel.Height / 10),
                BorderStyle = BorderStyle.None
            };
            groupCount.Enter += GroupCount_Enter;
            mainPanel.Controls.Add(groupCount);

            groupCount.Text      = currentGroup.ToString();
            groupCount.TextAlign = System.Drawing.ContentAlignment.MiddleCenter;

            arrowLeft = new Button
            {
                Location  = new System.Drawing.Point(mainPanel.Width / 4, 0),
                Font      = new System.Drawing.Font("Times New Roman", 24, System.Drawing.FontStyle.Regular),
                ForeColor = System.Drawing.ColorTranslator.FromHtml("#C4DFE6"),
                BackColor = System.Drawing.ColorTranslator.FromHtml("#003B46"),
                Size      = new System.Drawing.Size(mainPanel.Width / 6, mainPanel.Height / 10),
                FlatStyle = FlatStyle.Flat,
                Text      = "←"
            };
            arrowLeft.FlatAppearance.BorderSize = 0;
            arrowLeft.Click += ArrowLeft_Click;
            mainPanel.Controls.Add(arrowLeft);

            arrowRight = new Button
            {
                Location  = new System.Drawing.Point(7 * mainPanel.Width / 12, 0),
                Font      = new System.Drawing.Font("Times New Roman", 24, System.Drawing.FontStyle.Regular),
                ForeColor = System.Drawing.ColorTranslator.FromHtml("#C4DFE6"),
                BackColor = System.Drawing.ColorTranslator.FromHtml("#003B46"),
                Size      = new System.Drawing.Size(mainPanel.Width / 6, mainPanel.Height / 10),
                FlatStyle = FlatStyle.Flat,
                Text      = "→"
            };
            arrowRight.FlatAppearance.BorderSize = 0;
            arrowRight.Click += ArrowRight_Click;
            mainPanel.Controls.Add(arrowRight);
        }
Пример #2
0
 public void ChangeState()
 {
     df3.ChangeFormState(mainPanel);
     arrowLeft.Click -= ArrowLeft_Click;
     mainPanel.Controls.Remove(arrowLeft);
     arrowRight.Click -= ArrowRight_Click;
     mainPanel.Controls.Remove(arrowRight);
     groupCount.Enter -= GroupCount_Enter;
     mainPanel.Controls.Remove(groupCount);
     mainPanel  = null;
     arrowLeft  = null;
     arrowRight = null;
     groupCount = null;
     groupCount = null;
     df3        = null;
 }
Пример #3
0
        public string[][] ChangeState(out Dictionary <string, Dictionary <string, int> >[] relationMatrix)
        {
            df3.ChangeFormState(mainPanel);
            arrowLeft.Click -= ArrowLeft_Click;
            mainPanel.Controls.Remove(arrowLeft);
            arrowRight.Click -= ArrowRight_Click;
            mainPanel.Controls.Remove(arrowRight);
            groupCount.Enter -= GroupCount_Enter;
            mainPanel.Controls.Remove(groupCount);
            mainPanel  = null;
            arrowLeft  = null;
            arrowRight = null;
            groupCount = null;
            groupCount = null;
            df3        = null;

            relationMatrix = this.relationMatrix;
            return(distinctGroups);
        }