protected virtual void OnStopped(MiscUtil.EventArgs <Exception> args) { if (this.Stopped != null) { this.Stopped(this, args); } }
void l_Stopped(object sender, MiscUtil.EventArgs <Exception> e) { IPortraitHandler handler = sender as IPortraitHandler; this.RemoveListener(handler); if (e.Value != null) { System.Diagnostics.Debug.WriteLine(handler.Name + " Exception:" + e.Value.Message); } }
void EventAggregator_PortraitFound(object sender, MiscUtil.EventArgs <Damany.Imaging.Common.Portrait> e) { var msg = new Damany.RemoteImaging.Net.Messages.Portrait(); msg.FaceImage = e.Value.GetIpl().ToBitmap(); msg.CaptureTime = e.Value.CapturedAt; if (Bus != null) { try { Bus.Publish(msg); } catch (Exception) { throw; } } }
void _eventAggregator_PortraitFound(object sender, MiscUtil.EventArgs <Portrait> e) { var bmp = e.Value.GetIpl().ToBitmap(); this.BeginInvoke(new Action(() => { if (this.pictureBox1.Image != null) { var save = this.pictureBox1.Image; this.pictureBox1.Image = null; save.Dispose(); } if (_autoSizePicture) { this.pictureBox1.ClientSize = bmp.Size; MovePictureBox(); } this.pictureBox1.Image = bmp; this.pictureBox1.Visible = true; })); }