Beispiel #1
0
        private void CopyAs_Click(object sender, EventArgs e)
        {
            if (m_listBoxLayerSettings.SelectedIndex < 0)
            {
                return;
            }

            try
            {
                JobMode Mode = (JobMode)m_listBoxLayerSettings.SelectedItem;
                if (Mode != null)
                {
                    List <string> ExistModes = new List <string>();
                    foreach (JobMode item in m_LayerSettings.Items)
                    {
                        ExistModes.Add(item.Name);
                    }

                    NameEdit Form = new NameEdit(ExistModes);
                    Form.Text = ResString.GetResString("Add_Mode");
                    if (DialogResult.OK == Form.ShowDialog())
                    {
                        JobMode newMode = new JobMode();
                        newMode.Name            = Form.Input;
                        newMode.Item            = Mode.Item.Clone();
                        newMode.LayerNum        = Mode.LayerNum;
                        newMode.LayerColorArray = Mode.LayerColorArray;
                        newMode.SpotColor1Mask  = Mode.SpotColor1Mask;
                        m_LayerSettings.Items.Add(newMode);

                        Bind();

                        m_listBoxLayerSettings.SelectedIndex = m_listBoxLayerSettings.Items.Count - 1;
                    }
                }
            }
            catch (Exception ex)
            {
                MessageBox.Show("Failed to save the config:" + ex.Message);
            }
        }
Beispiel #2
0
        private void AddMode_Click(object sender, EventArgs e)
        {
            List <string> ExistModes = new List <string>();

            foreach (JobMode Mode in m_LayerSettings.Items)
            {
                ExistModes.Add(Mode.Name);
            }
            NameEdit Form = new NameEdit(ExistModes);

            Form.Text = ResString.GetResString("Add_Mode");
            if (DialogResult.OK == Form.ShowDialog())
            {
                JobMode Mode = new JobMode();
                Mode.Name = Form.Input;
                m_LayerSettings.Items.Add(Mode);

                Bind();

                m_listBoxLayerSettings.SelectedIndex = m_listBoxLayerSettings.Items.Count - 1;
            }
        }