static void Main() { ControlReceiver controlReceiver = new ControlReceiver(); VideoCapture videoCapture = new VideoCapture(); Application.EnableVisualStyles(); Application.SetCompatibleTextRenderingDefault(false); if (!IsOnlyInstance()) { return; } try { ThreadPool.QueueUserWorkItem(o => { videoCapture.Configure(0, "temp.wmv"); controlReceiver.Initialize(videoCapture); }); Application.Run(new CustomApplicationContext()); } catch (Exception ex) { MessageBox.Show(ex.Message, "Program Terminated Unexpectedly", MessageBoxButtons.OK, MessageBoxIcon.Error); } }
protected void RecordToggle(Object sender, EventArgs e) { if (!recording) { ContentView cv = View as ContentView; videoCapture = new VideoCapture(cv.ImageView, cv.InfoLabel); recording = videoCapture.StartRecording(); } else { videoCapture.StopRecording(); recording = false; } var newTitle = recording ? "Stop" : "Record"; (sender as UIButton).SetTitle(newTitle, UIControlState.Normal); }