You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@cordova.apache.org by pu...@apache.org on 2012/07/18 23:10:15 UTC
[4/7] wp7 commit: update Capture methods"
update Capture methods"
Project: http://git-wip-us.apache.org/repos/asf/incubator-cordova-wp7/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-cordova-wp7/commit/c8336eaf
Tree: http://git-wip-us.apache.org/repos/asf/incubator-cordova-wp7/tree/c8336eaf
Diff: http://git-wip-us.apache.org/repos/asf/incubator-cordova-wp7/diff/c8336eaf
Branch: refs/heads/master
Commit: c8336eafa40cdb381ef7d939c1e0b4a89caca7d3
Parents: bb20932
Author: Jesse MacFadyen <pu...@gmail.com>
Authored: Tue Jul 17 15:19:42 2012 -0700
Committer: Jesse MacFadyen <pu...@gmail.com>
Committed: Tue Jul 17 15:19:42 2012 -0700
----------------------------------------------------------------------
.../standalone/cordovalib/Commands/Capture.cs | 19 ++++++--------
1 files changed, 8 insertions(+), 11 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/incubator-cordova-wp7/blob/c8336eaf/templates/standalone/cordovalib/Commands/Capture.cs
----------------------------------------------------------------------
diff --git a/templates/standalone/cordovalib/Commands/Capture.cs b/templates/standalone/cordovalib/Commands/Capture.cs
index b003071..3dfc0cf 100644
--- a/templates/standalone/cordovalib/Commands/Capture.cs
+++ b/templates/standalone/cordovalib/Commands/Capture.cs
@@ -245,7 +245,7 @@ namespace WP7CordovaClassLib.Cordova.Commands
try
{
this.captureImageOptions = String.IsNullOrEmpty(options) ?
- CaptureImageOptions.Default : JSON.JsonHelper.Deserialize<CaptureImageOptions>(options);
+ CaptureImageOptions.Default : JSON.JsonHelper.Deserialize<CaptureImageOptions[]>(options)[0];
}
catch (Exception ex)
@@ -276,7 +276,7 @@ namespace WP7CordovaClassLib.Cordova.Commands
try
{
this.captureAudioOptions = String.IsNullOrEmpty(options) ?
- CaptureAudioOptions.Default : JSON.JsonHelper.Deserialize<CaptureAudioOptions>(options);
+ CaptureAudioOptions.Default : JSON.JsonHelper.Deserialize<CaptureAudioOptions[]>(options)[0];
}
catch (Exception ex)
@@ -307,7 +307,7 @@ namespace WP7CordovaClassLib.Cordova.Commands
try
{
this.captureVideoOptions = String.IsNullOrEmpty(options) ?
- CaptureVideoOptions.Default : JSON.JsonHelper.Deserialize<CaptureVideoOptions>(options);
+ CaptureVideoOptions.Default : JSON.JsonHelper.Deserialize<CaptureVideoOptions[]>(options)[0];
}
catch (Exception ex)
@@ -333,18 +333,15 @@ namespace WP7CordovaClassLib.Cordova.Commands
/// <param name="options"></param>
public void getFormatData(string options)
{
- if (String.IsNullOrEmpty(options))
- {
- this.DispatchCommandResult(new PluginResult(PluginResult.Status.JSON_EXCEPTION));
- return;
- }
-
try
{
MediaFormatOptions mediaFormatOptions;
try
{
- mediaFormatOptions = JSON.JsonHelper.Deserialize<MediaFormatOptions>(options);
+ mediaFormatOptions = new MediaFormatOptions();
+ string[] optionStrings = JSON.JsonHelper.Deserialize<string[]>(options);
+ mediaFormatOptions.FullPath = optionStrings[0];
+ mediaFormatOptions.Type = optionStrings[1];
}
catch (Exception ex)
{
@@ -403,7 +400,7 @@ namespace WP7CordovaClassLib.Cordova.Commands
try
{
- file = String.IsNullOrEmpty(options) ? null : JSON.JsonHelper.Deserialize<MediaFile>(options);
+ file = String.IsNullOrEmpty(options) ? null : JSON.JsonHelper.Deserialize<MediaFile[]>(options)[0];
}
catch (Exception ex)