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 2013/01/23 01:19:52 UTC
[4/21] git commit: more consolidation of props between wp7+wp8
more consolidation of props between wp7+wp8
Project: http://git-wip-us.apache.org/repos/asf/cordova-wp8/repo
Commit: http://git-wip-us.apache.org/repos/asf/cordova-wp8/commit/224c484b
Tree: http://git-wip-us.apache.org/repos/asf/cordova-wp8/tree/224c484b
Diff: http://git-wip-us.apache.org/repos/asf/cordova-wp8/diff/224c484b
Branch: refs/heads/master
Commit: 224c484b5867fc3bc1bd1bace78e366fe759b885
Parents: 0799dc0
Author: Jesse MacFadyen <pu...@gmail.com>
Authored: Tue Jan 15 17:53:12 2013 -0800
Committer: Jesse MacFadyen <pu...@gmail.com>
Committed: Tue Jan 15 17:53:12 2013 -0800
----------------------------------------------------------------------
templates/standalone/cordovalib/CommandFactory.cs | 8 ++++++++
.../standalone/cordovalib/CordovaView.xaml.cs | 6 ++++--
templates/standalone/cordovalib/NativeExecution.cs | 5 +++++
3 files changed, 17 insertions(+), 2 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/cordova-wp8/blob/224c484b/templates/standalone/cordovalib/CommandFactory.cs
----------------------------------------------------------------------
diff --git a/templates/standalone/cordovalib/CommandFactory.cs b/templates/standalone/cordovalib/CommandFactory.cs
index ef67c88..893ce80 100644
--- a/templates/standalone/cordovalib/CommandFactory.cs
+++ b/templates/standalone/cordovalib/CommandFactory.cs
@@ -100,5 +100,13 @@ namespace WPCordovaClassLib.Cordova
return commandMap[service];
}
+
+ public static void ResetAllCommands()
+ {
+ foreach (BaseCommand bc in commandMap.Values)
+ {
+ bc.OnReset();
+ }
+ }
}
}
http://git-wip-us.apache.org/repos/asf/cordova-wp8/blob/224c484b/templates/standalone/cordovalib/CordovaView.xaml.cs
----------------------------------------------------------------------
diff --git a/templates/standalone/cordovalib/CordovaView.xaml.cs b/templates/standalone/cordovalib/CordovaView.xaml.cs
index 526c9f8..4b13644 100644
--- a/templates/standalone/cordovalib/CordovaView.xaml.cs
+++ b/templates/standalone/cordovalib/CordovaView.xaml.cs
@@ -37,6 +37,7 @@ using System.Text;
using WPCordovaClassLib.Cordova;
using System.Threading;
using Microsoft.Phone.Shell;
+using WPCordovaClassLib.Cordova.JSON;
@@ -395,7 +396,8 @@ namespace WPCordovaClassLib
{
this.PageDidChange = true;
// Debug.WriteLine("GapBrowser_Navigating to :: " + e.Uri.ToString());
- // TODO: tell any running plugins to stop doing what they are doing.
+ this.nativeExecution.ResetAllCommands();
+
// TODO: check whitelist / blacklist
// NOTE: Navigation can be cancelled by setting : e.Cancel = true;
}
@@ -436,7 +438,7 @@ namespace WPCordovaClassLib
switch (commandCallParams.Action.ToLower())
{
case "overridebackbutton":
- string arg0 = WPCordovaClassLib.Cordova.JSON.JsonHelper.Deserialize<string[]>(commandCallParams.Args)[0];
+ string arg0 = JsonHelper.Deserialize<string[]>(commandCallParams.Args)[0];
this.OverrideBackButton = (arg0 != null && arg0.Length > 0 && arg0.ToLower() == "true");
break;
}
http://git-wip-us.apache.org/repos/asf/cordova-wp8/blob/224c484b/templates/standalone/cordovalib/NativeExecution.cs
----------------------------------------------------------------------
diff --git a/templates/standalone/cordovalib/NativeExecution.cs b/templates/standalone/cordovalib/NativeExecution.cs
index bd19f7c..e02625b 100644
--- a/templates/standalone/cordovalib/NativeExecution.cs
+++ b/templates/standalone/cordovalib/NativeExecution.cs
@@ -56,6 +56,11 @@ namespace WPCordovaClassLib.Cordova
return Microsoft.Devices.Environment.DeviceType == DeviceType.Emulator;
}
+ public void ResetAllCommands()
+ {
+ CommandFactory.ResetAllCommands();
+ }
+
/// <summary>
/// Executes command and returns result back.
/// </summary>