Permalink
Browse files

BREAKING CHANGE: moved all camera related services to the Cimbalino.P…

…hone.Tookit.Camera project
  • Loading branch information...
1 parent 61cfa58 commit e5fbc289ef32f2f17b3807c3479c8e5e6a1cb8e4 @PedroLamas committed Feb 10, 2012
@@ -51,7 +51,10 @@
<Reference Include="mscorlib.extensions" />
</ItemGroup>
<ItemGroup>
+ <Compile Include="Services\PhotoChooserWithCameraService.cs" />
<Compile Include="Properties\AssemblyInfo.cs" />
+ <Compile Include="Services\CameraCaptureService.cs" />
+ <Compile Include="Services\ICameraCaptureService.cs" />
<Compile Include="Services\IPhotoCameraService.cs" />
<Compile Include="Services\PhotoCameraService.cs" />
<Compile Include="Services\PhotoCameraServiceState.cs" />
@@ -0,0 +1,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();
+ }
+ }
+}
@@ -43,6 +43,7 @@
</PropertyGroup>
<ItemGroup>
<Reference Include="Microsoft.Phone" />
+ <Reference Include="Microsoft.Xna.Framework" />
<Reference Include="Microsoft.Xna.Framework.GamerServices" />
<Reference Include="System.Device" />
<Reference Include="System.Windows" />
@@ -75,17 +76,17 @@
<Compile Include="Extensions\IntExtensions.cs" />
<Compile Include="Extensions\StreamReaderExtensions.cs" />
<Compile Include="Extensions\StreamWriterExtensions.cs" />
- <Compile Include="Helpers\ApplicationManifest.cs" />
+ <Compile Include="Services\ApplicationManifestService.cs" />
<Compile Include="Services\ApplicationSettingsService.cs" />
<Compile Include="Services\BingMapsDirectionsService.cs" />
<Compile Include="Services\BingMapsService.cs" />
- <Compile Include="Services\CameraCaptureService.cs" />
<Compile Include="Services\ClipboardService.cs" />
<Compile Include="Services\ConnectionSettingsService.cs" />
<Compile Include="Services\DeviceStatusService.cs" />
<Compile Include="Services\AddressChooserService.cs" />
<Compile Include="Services\EmailAddressChooserService.cs" />
<Compile Include="Services\IAddressChooserService.cs" />
+ <Compile Include="Services\IApplicationManifestService.cs" />
<Compile Include="Services\IApplicationSettingsService.cs" />
<Compile Include="Converters\BooleanToStringConverter.cs" />
<Compile Include="Converters\BooleanToVisibilityConverter.cs" />
@@ -107,7 +108,6 @@
<Compile Include="Properties\AssemblyInfo.cs" />
<Compile Include="Services\IBingMapsDirectionsService.cs" />
<Compile Include="Services\IBingMapsService.cs" />
- <Compile Include="Services\ICameraCaptureService.cs" />
<Compile Include="Services\IClipboardService.cs" />
<Compile Include="Services\IConnectionSettingsService.cs" />
<Compile Include="Services\IDeviceStatusService.cs" />
@@ -118,6 +118,8 @@
<Compile Include="Services\IMessageBoxService.cs" />
<Compile Include="Services\INavigationService.cs" />
<Compile Include="Services\IEmailComposeService.cs" />
+ <Compile Include="Services\InputBoxService.cs" />
+ <Compile Include="Services\IInputBoxService.cs" />
<Compile Include="Services\IPhoneNumberChooserService.cs" />
<Compile Include="Services\IPhotoChooserService.cs" />
<Compile Include="Services\ISaveEmailAddressService.cs" />
@@ -20,7 +20,7 @@
namespace Cimbalino.Phone.Toolkit.Services
{
/// <summary>
- /// Represents a service capable of showing message boxes
+ /// Represents a service capable of showing message boxes.
/// </summary>
public interface IMessageBoxService
{
@@ -28,5 +28,12 @@ public interface IPhotoChooserService
/// </summary>
/// <param name="resultAction">The <see cref="Action{PhotoResult}" /> to be called once the operation is finished.</param>
void Show(Action<PhotoResult> resultAction);
+
+ /// <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>
+ void Show(bool showCamera, Action<PhotoResult> resultAction);
}
}
@@ -32,5 +32,15 @@ public void Show(Action<PhotoResult> resultAction)
new ChooserHandler<PhotoResult>(new PhotoChooserTask(), resultAction)
.Show();
}
+
+ /// <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 virtual void Show(bool showCamera, Action<PhotoResult> resultAction)
+ {
+ throw new NotImplementedException("To use this method, add Cimbalino.Phone.Toolkit.Camera assembly to the project and use the PhotoChooserWithCameraService instead.");
+ }
}
}

0 comments on commit e5fbc28

Please sign in to comment.