protected virtual void OnCameraThumbnailProduced(CameraThumbnailProducedEventArgs e) { EventHandler <CameraThumbnailProducedEventArgs> invoker = CameraThumbnailProduced; if (invoker != null) { invoker(this, e); } }
/// <summary> /// Receive a new thumbnail from a camera and forward it upstream. /// </summary> private static void CameraManager_CameraThumbnailProduced(object sender, CameraThumbnailProducedEventArgs e) { // This runs in a worker thread. // The final event handler will have to merge back into the UI thread before using the bitmap. if (CameraThumbnailProduced != null) { CameraThumbnailProduced(sender, e); } }
/// <summary> /// Receive a new thumbnail from a camera and raise CameraThumbnailProduced in turn. /// The camera manager should make sure this runs in the UI thread. /// This event should always be raised, even if the thumbnail could not be retrieved. /// </summary> private static void CameraManager_CameraThumbnailProduced(object sender, CameraThumbnailProducedEventArgs e) { CameraThumbnailProduced?.Invoke(sender, e); }