This repository has been archived by the owner on Nov 17, 2017. It is now read-only.
forked from cimbalino/Cimbalino-Phone-Toolkit
/
PhotoChooserWithCameraService.cs
40 lines (38 loc) · 1.65 KB
/
PhotoChooserWithCameraService.cs
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
// ****************************************************************************
// <copyright file="PhotoChooserWithCameraService.cs" company="Pedro Lamas">
// Copyright © Pedro Lamas 2011
// </copyright>
// ****************************************************************************
// <author>Pedro Lamas</author>
// <email>pedrolamas@gmail.com</email>
// <date>10-02-2012</date>
// <project>Cimbalino.Phone.Toolkit.Camera</project>
// <web>http://www.pedrolamas.com</web>
// <license>
// See license.txt in this solution or http://www.pedrolamas.com/license_MIT.txt
// </license>
// ****************************************************************************
using System;
using Microsoft.Phone.Tasks;
namespace Cimbalino.Phone.Toolkit.Services
{
/// <summary>
/// Represents an implementation of the <see cref="IPhotoChooserService"/>.
/// </summary>
public class PhotoChooserWithCameraService : PhotoChooserService
{
/// <summary>
/// Shows the Photo Chooser application, optionaly presenting a button for launching the camera.
/// </summary>
/// <param name="showCamera">true if the user is presented with a button for launching the camera during the photo choosing process; otherwise, false.</param>
/// <param name="resultAction">The <see cref="Action{PhotoResult}" /> to be called once the operation is finished.</param>
public override void Show(bool showCamera, Action<PhotoResult> resultAction)
{
new ChooserHandler<PhotoResult>(new PhotoChooserTask()
{
ShowCamera = showCamera
}, resultAction)
.Show();
}
}
}