Example #1
0
        /// <summary>Display a screen showing the matching part program.
        /// </summary>
        /// <param name="program">The part program to display.</param>
        private void ShowOne(PartProgram program)
        {
            PartProgramPanel.Visible = true;
            NonePanel.Visible = false;
            MultiplePanel.Visible = false;
            LoadButton.Enabled = true;

            if (program == _currentPartProgram) return;
            _currentPartProgram = program;

            PartProgramPanel.Controls.Clear();
            PartProgramBox box = new PartProgramBox();

            PartProgramPanel.Controls.Add(box);
            box.Dock = DockStyle.Fill;
            box.PartProgram = program;

            if (AutoLoadCheckBox.Checked) LoadPartProgram(program);
        }
Example #2
0
        /// <summary>Populates the configuration list with part programs.
        /// </summary>
        /// <param name="programs"></param>
        private void LoadPartProgramsIntoList(PartProgram[] programs)
        {
            ConfigurationTable.RowCount = 0;
            ConfigurationTable.Controls.Clear();

            foreach (PartProgram program in programs)
            {
                PartProgramBox box = new PartProgramBox();
                box.PartProgram = program;
                box.Dock = DockStyle.Fill;

                Button delete = new Button();
                delete.Text = "Remove";
                delete.Dock = DockStyle.Fill;
                delete.Tag = program;
                delete.Click += PartProgramDeleteButton_Click;

                ConfigurationTable.RowCount += 1;
                ConfigurationTable.Controls.Add(box);
                ConfigurationTable.Controls.Add(delete);

            }

            ConfigurationTable.RowCount += 1;
        }