コード例 #1
0
ファイル: Capture.cs プロジェクト: kashwaa/Capture
        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;
        }
コード例 #2
0
 private void backgroundWorker1_DoWork(object sender, DoWorkEventArgs e)
 {
     logger.Info("Lunching Recorder Thread");
     recorderExited = false;
     Recorder rec = new Recorder(this);
     recorderExited = true;
     logger.Info("Recorder Thread Ended");
 }