/// <summary> /// Dismisses the specified picker. /// </summary> /// <param name="picker">The picker.</param> /// <param name="onDismiss">The on dismiss.</param> private void Dismiss(UIImagePickerController picker, Action onDismiss) { if (_viewController == null) { onDismiss(); } else { NSNotificationCenter.DefaultCenter.RemoveObserver(_observer); UIDevice.CurrentDevice.EndGeneratingDeviceOrientationNotifications(); _observer.Dispose(); if (Popover != null) { Popover.Dismiss(true); Popover.Dispose(); Popover = null; onDismiss(); } else { picker.DismissViewController(true, onDismiss); picker.Dispose(); } } }
private void Dismiss(UIImagePickerController picker, NSAction onDismiss) { if (this.viewController == null) { onDismiss(); tcs = new TaskCompletionSource <MediaFile>(); } else { NSNotificationCenter.DefaultCenter.RemoveObserver(this.observer); UIDevice.CurrentDevice.EndGeneratingDeviceOrientationNotifications(); this.observer.Dispose(); if (Popover != null) { Popover.Dismiss(animated: true); Popover.Dispose(); Popover = null; onDismiss(); } else { picker.DismissViewController(true, onDismiss); picker.Dispose(); } } }
private void Dismiss(UIImagePickerController picker, NSAction onDismiss) { if (viewController == null) { onDismiss(); tcs = new TaskCompletionSource <MediaFile>(); } else { if (Popover != null) { Popover.Dismiss(animated: true); Popover.Dispose(); Popover = null; onDismiss(); } else { picker.DismissViewController(true, onDismiss); picker.Dispose(); } } }