private void NotifyScreenChanged(BitmapContainer bitmapContainer) { if (this.ScreenCaptured != null) { this.ScreenCaptured(this, new GenericDataEventArgs <BitmapContainer>(bitmapContainer)); } }
private CaptureService(IScreenCapture screenCapture, int timerInterval) { this.screenCapture = screenCapture; this.screenCaptureTimer = new Timer(); this.screenCaptureTimer.Interval = timerInterval; this.screenCaptureTimer.Elapsed += (sender, e) => { BitmapContainer bitmapContainer = null; lock (this.bitmapLock) { bitmapContainer = this.CaptureBitmap(); } this.NotifyScreenChanged(bitmapContainer); }; }