private void recordToolStripMenuItem_Click(object sender, EventArgs e) { Select s =r== null?new Select():new Select(r); recordToolStripMenuItem.Enabled = false; if (s.ShowDialog() == System.Windows.Forms.DialogResult.Cancel) { recordToolStripMenuItem.Enabled = true; return; } r = s.recData; if (saveFileDialog1.ShowDialog() == System.Windows.Forms.DialogResult.OK) { r.path = saveFileDialog1.FileName; } else { recordToolStripMenuItem.Enabled = true; return; } recordToolStripMenuItem.Enabled = true; ParameterizedThreadStart pts = null; recorder = RecorderFactory.CreateRecorder(Path.GetExtension(r.path).ToLower()); pts = new ParameterizedThreadStart(recorder.Record); Thread t = new Thread(pts); t.Start(r); recordToolStripMenuItem.Enabled = false; stopToolStripMenuItem.Enabled = true; pauseToolStripMenuItem.Enabled = true; }
public Select(RecData r) { InitializeComponent(); this.StartPosition = FormStartPosition.Manual; this.Location = r.pos; this.Width = r.width; this.Height = r.height; this.TopMost = true; }