예제 #1
0
        private void ToolStripMenuItemEdit_Click(object sender, EventArgs e)
        {
            if (rightClickedTapeSide != null)
            {
                using (var form = new EditTapeForm(true))
                {
                    var tape = rightClickedTapeSide.Parent;

                    form.LabelSideA = tape.SideA.Label;
                    form.LabelSideB = tape.SideB.Label;
                    form.Color      = tape.Color;

                    var result = form.ShowDialog();

                    if (result == DialogResult.OK)
                    {
                        tape.SideA.Label = form.LabelSideA;
                        tape.SideB.Label = form.LabelSideB;
                        tape.Color       = form.Color;

                        SaveList();
                    }
                }
            }
        }
예제 #2
0
        public void CreateTape()
        {
            using (EditTapeForm form = new EditTapeForm(false))
            {
                var result = form.ShowDialog();

                if (result == DialogResult.OK)
                {
                    Tape tape = null;

                    ProgressForm progressForm = new ProgressForm(string.Format("Creating tape..."));
                    var          thread       = new Thread(() =>
                    {
                        tape = CreateTape(form.SideLengthSeconds, form.LabelSideA, form.LabelSideB, form.Color, progressForm);
                        progressForm.Finish();
                    });

                    thread.Start();
                    progressForm.ShowDialog();

                    listOfTapes.Tapes.Add(tape);
                    listBox.Items.Add(tape);

                    SaveList();
                }
            }
        }