Exemplo n.º 1
0
        /// <summary>
        /// Takes the picture.
        /// </summary>
        /// <param name="options">The storage options.</param>
        /// <returns>Task with a return type of MediaFile.</returns>
        /// <exception cref="System.NotSupportedException">Throws an exception if feature is not supported.</exception>
        public Task<MediaFile> TakePhotoAsync(CameraMediaStorageOptions options)
        {
            if (!IsCameraAvailable)
            {
                throw new NotSupportedException();
            }

            options.VerifyOptions();

            return TakeMediaAsync("image/*", MediaStore.ActionImageCapture, options);
        }
Exemplo n.º 2
0
        /// <summary>
        /// Select a picture from library.
        /// </summary>
        /// <param name="options">The storage options.</param>
        /// <returns>Task with a return type of MediaFile.</returns>
        /// <exception cref="System.NotSupportedException">Throws an exception if feature is not supported.</exception>
        public Task<MediaFile> SelectPhotoAsync(CameraMediaStorageOptions options)
        {
            if (!IsCameraAvailable)
            {
                throw new NotSupportedException();
            }

            options.VerifyOptions();

            return TakeMediaAsync("image/*", Intent.ActionPick, options);
        }
Exemplo n.º 3
0
 public Task<System.Collections.Generic.List<MediaFile>> SelectMultiPhotoAsync(CameraMediaStorageOptions options)
 {
     throw new NotImplementedException ();
 }
Exemplo n.º 4
0
        /// <summary>
        /// Select a multi picture from library.
        /// </summary>
        /// <param name="options">The storage options.</param>
        /// <returns>Task&lt;IMediaFile&gt;.</returns>
        public Task<List<MediaFile>> SelectMultiPhotoAsync(CameraMediaStorageOptions options)
        {
            if (!IsPhotosSupported)
                throw new NotSupportedException ();

            return GetPickMediaAsync (UIImagePickerControllerSourceType.PhotoLibrary, TypeImage);
        }
Exemplo n.º 5
0
 private void VerifyCameraOptions(CameraMediaStorageOptions options)
 {
     VerifyOptions (options);
     if (!Enum.IsDefined (typeof(CameraDevice), options.DefaultCamera))
         throw new ArgumentException ("options.Camera is not a member of CameraDevice");
 }
Exemplo n.º 6
0
        /// <summary>
        /// Takes the picture.
        /// </summary>
        /// <param name="options">The storage options.</param>
        /// <returns>Task&lt;IMediaFile&gt;.</returns>
        public Task<MediaFile> TakePhotoAsync(CameraMediaStorageOptions options)
        {
            if (!IsPhotosSupported)
                throw new NotSupportedException();
            if (!IsCameraAvailable)
                throw new NotSupportedException();

            VerifyCameraOptions (options);

            return GetMediaAsync (UIImagePickerControllerSourceType.Camera, TypeImage, options);
        }