예제 #1
0
        /// <summary>
        /// Добавить новую нить
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="e"></param>
        private void addThreadToolStripMenuItem_Click(object sender, EventArgs e)
        {
            AddThread addThread = new AddThread();

            addThread.Mode = FormMode.Add;
            addThread.ShowDialog();
            if (addThread.Result == DialogResult.OK)
            {
                ThreadUnit thread = addThread.Thread;
                _configuration.ListThreadUnits.Add(thread);

                UpdateThreadsList();
                _statusBarMessage = $"Добавлена новая нить [{thread.Name}]";
                statusBar1.Text   = _statusBarMessage;
                _modified         = true;
            }

            addThread.Dispose();
        }
예제 #2
0
        /// <summary>
        /// Изменить параметры линии производства
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="e"></param>
        private void editThreadToolStripMenuItem_Click(object sender, EventArgs e)
        {
            AddThread  addThread = new AddThread();
            ThreadUnit unit      = _configuration.FindThreadByName(threadsList.Text);

            addThread.Mode   = FormMode.Edit;
            addThread.Thread = unit;
            addThread.EditThread();
            if (addThread.Result == DialogResult.OK)
            {
                ThreadUnit thread = addThread.Thread;
                _configuration.ReplaceThreadUnit(thread);

                UpdateThreadsList();
                _statusBarMessage = $"Изменены параметры нити [{thread.Name}]";
                statusBar1.Text   = _statusBarMessage;
                _modified         = true;
            }

            addThread.Dispose();
        }