Return-Path: X-Original-To: apmail-cordova-commits-archive@www.apache.org Delivered-To: apmail-cordova-commits-archive@www.apache.org Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by minotaur.apache.org (Postfix) with SMTP id 87665CF27 for ; Mon, 3 Jun 2013 18:36:21 +0000 (UTC) Received: (qmail 9961 invoked by uid 500); 3 Jun 2013 18:36:21 -0000 Delivered-To: apmail-cordova-commits-archive@cordova.apache.org Received: (qmail 9918 invoked by uid 500); 3 Jun 2013 18:36:21 -0000 Mailing-List: contact commits-help@cordova.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: dev@cordova.apache.org Delivered-To: mailing list commits@cordova.apache.org Received: (qmail 9863 invoked by uid 99); 3 Jun 2013 18:36:21 -0000 Received: from tyr.zones.apache.org (HELO tyr.zones.apache.org) (140.211.11.114) by apache.org (qpsmtpd/0.29) with ESMTP; Mon, 03 Jun 2013 18:36:21 +0000 Received: by tyr.zones.apache.org (Postfix, from userid 65534) id E6BD08127E8; Mon, 3 Jun 2013 18:36:20 +0000 (UTC) Content-Type: text/plain; charset="us-ascii" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit From: bennmapes@apache.org To: commits@cordova.apache.org Date: Mon, 03 Jun 2013 18:36:27 -0000 Message-Id: In-Reply-To: <471f44a672514862b6e4d16f2a3ceef7@git.apache.org> References: <471f44a672514862b6e4d16f2a3ceef7@git.apache.org> X-Mailer: ASF-Git Admin Mailer Subject: [8/9] wp7 commit: removed dependencies for Battery status plugin removed dependencies for Battery status plugin Project: http://git-wip-us.apache.org/repos/asf/cordova-wp7/repo Commit: http://git-wip-us.apache.org/repos/asf/cordova-wp7/commit/27232637 Tree: http://git-wip-us.apache.org/repos/asf/cordova-wp7/tree/27232637 Diff: http://git-wip-us.apache.org/repos/asf/cordova-wp7/diff/27232637 Branch: refs/heads/3.0.0 Commit: 272326373ddb34e20e2bf3b8ccd60448bddf2f2e Parents: eceeba2 Author: Benn Mapes Authored: Mon May 27 17:11:10 2013 -0700 Committer: Benn Mapes Committed: Mon Jun 3 11:34:54 2013 -0700 ---------------------------------------------------------------------- templates/standalone/CordovaAppProj.csproj | 1 - templates/standalone/Plugins/Battery.cs | 79 ----------------------- templates/standalone/config.xml | 1 - 3 files changed, 0 insertions(+), 81 deletions(-) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/cordova-wp7/blob/27232637/templates/standalone/CordovaAppProj.csproj ---------------------------------------------------------------------- diff --git a/templates/standalone/CordovaAppProj.csproj b/templates/standalone/CordovaAppProj.csproj index 2b43554..bcf300c 100644 --- a/templates/standalone/CordovaAppProj.csproj +++ b/templates/standalone/CordovaAppProj.csproj @@ -168,7 +168,6 @@ - http://git-wip-us.apache.org/repos/asf/cordova-wp7/blob/27232637/templates/standalone/Plugins/Battery.cs ---------------------------------------------------------------------- diff --git a/templates/standalone/Plugins/Battery.cs b/templates/standalone/Plugins/Battery.cs deleted file mode 100644 index 962959e..0000000 --- a/templates/standalone/Plugins/Battery.cs +++ /dev/null @@ -1,79 +0,0 @@ -/* - Licensed under the Apache License, Version 2.0 (the "License"); - you may not use this file except in compliance with the License. - You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - - Unless required by applicable law or agreed to in writing, software - distributed under the License is distributed on an "AS IS" BASIS, - WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - See the License for the specific language governing permissions and - limitations under the License. -*/ - -using System; -using System.Net; -using System.Windows; -using System.Windows.Controls; -using System.Windows.Documents; -using System.Windows.Ink; -using System.Windows.Input; -using System.Windows.Media; -using System.Windows.Media.Animation; -using System.Windows.Shapes; - -using Microsoft.Phone.Info; - -namespace WPCordovaClassLib.Cordova.Commands -{ - /// - /// Listens for changes to the state of the battery on the device. - /// Currently only the "isPlugged" parameter available via native APIs. - /// - public class Battery : BaseCommand - { - private bool isPlugged = false; - private EventHandler powerChanged; - - public Battery() - { - powerChanged = new EventHandler(DeviceStatus_PowerSourceChanged); - isPlugged = DeviceStatus.PowerSource.ToString().CompareTo("External") == 0; - } - - public void start(string options) - { - // Register power changed event handler - DeviceStatus.PowerSourceChanged += powerChanged; - - PluginResult result = new PluginResult(PluginResult.Status.NO_RESULT); - result.KeepCallback = true; - DispatchCommandResult(result); - } - public void stop(string options) - { - // Unregister power changed event handler - DeviceStatus.PowerSourceChanged -= powerChanged; - } - - private void DeviceStatus_PowerSourceChanged(object sender, EventArgs e) - { - isPlugged = DeviceStatus.PowerSource.ToString().CompareTo("External") == 0; - PluginResult result = new PluginResult(PluginResult.Status.OK, GetCurrentBatteryStateFormatted()); - result.KeepCallback = true; - DispatchCommandResult(result); - } - - private string GetCurrentBatteryStateFormatted() - { - string batteryState = String.Format("\"level\":{0},\"isPlugged\":{1}", - "null", - isPlugged ? "true" : "false" - ); - batteryState = "{" + batteryState + "}"; - return batteryState; - } - - } -} http://git-wip-us.apache.org/repos/asf/cordova-wp7/blob/27232637/templates/standalone/config.xml ---------------------------------------------------------------------- diff --git a/templates/standalone/config.xml b/templates/standalone/config.xml index 64aef33..56869c3 100644 --- a/templates/standalone/config.xml +++ b/templates/standalone/config.xml @@ -35,7 +35,6 @@ -