Return-Path: X-Original-To: apmail-incubator-callback-commits-archive@minotaur.apache.org Delivered-To: apmail-incubator-callback-commits-archive@minotaur.apache.org Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by minotaur.apache.org (Postfix) with SMTP id 59FE99142 for ; Thu, 21 Jun 2012 00:14:13 +0000 (UTC) Received: (qmail 33522 invoked by uid 500); 21 Jun 2012 00:14:13 -0000 Delivered-To: apmail-incubator-callback-commits-archive@incubator.apache.org Received: (qmail 33487 invoked by uid 500); 21 Jun 2012 00:14:13 -0000 Mailing-List: contact callback-commits-help@incubator.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: callback-dev@incubator.apache.org Delivered-To: mailing list callback-commits@incubator.apache.org Received: (qmail 33309 invoked by uid 99); 21 Jun 2012 00:14:13 -0000 Received: from tyr.zones.apache.org (HELO tyr.zones.apache.org) (140.211.11.114) by apache.org (qpsmtpd/0.29) with ESMTP; Thu, 21 Jun 2012 00:14:13 +0000 Received: by tyr.zones.apache.org (Postfix, from userid 65534) id CA12B12E3D; Thu, 21 Jun 2012 00:14:12 +0000 (UTC) Content-Type: text/plain; charset="us-ascii" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit From: purplecabbage@apache.org To: callback-commits@incubator.apache.org X-Mailer: ASF-Git Admin Mailer Subject: [4/5] wp7 commit: added image capture view - wip Message-Id: <20120621001412.CA12B12E3D@tyr.zones.apache.org> Date: Thu, 21 Jun 2012 00:14:12 +0000 (UTC) added image capture view - wip 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/6410b096 Tree: http://git-wip-us.apache.org/repos/asf/incubator-cordova-wp7/tree/6410b096 Diff: http://git-wip-us.apache.org/repos/asf/incubator-cordova-wp7/diff/6410b096 Branch: refs/heads/master Commit: 6410b0966dfc6c6797c2c169ea45cd33ef1af0cf Parents: 7d21d6c Author: Jesse MacFadyen Authored: Wed Jun 20 16:11:56 2012 -0700 Committer: Jesse MacFadyen Committed: Wed Jun 20 16:11:56 2012 -0700 ---------------------------------------------------------------------- framework/Cordova/UI/ImageCapture.xaml | 26 ++++++ framework/Cordova/UI/ImageCapture.xaml.cs | 107 ++++++++++++++++++++++++ 2 files changed, 133 insertions(+), 0 deletions(-) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/incubator-cordova-wp7/blob/6410b096/framework/Cordova/UI/ImageCapture.xaml ---------------------------------------------------------------------- diff --git a/framework/Cordova/UI/ImageCapture.xaml b/framework/Cordova/UI/ImageCapture.xaml new file mode 100644 index 0000000..3fe4be6 --- /dev/null +++ b/framework/Cordova/UI/ImageCapture.xaml @@ -0,0 +1,26 @@ + + + + + + + + + + + + + http://git-wip-us.apache.org/repos/asf/incubator-cordova-wp7/blob/6410b096/framework/Cordova/UI/ImageCapture.xaml.cs ---------------------------------------------------------------------- diff --git a/framework/Cordova/UI/ImageCapture.xaml.cs b/framework/Cordova/UI/ImageCapture.xaml.cs new file mode 100644 index 0000000..bb3bbeb --- /dev/null +++ b/framework/Cordova/UI/ImageCapture.xaml.cs @@ -0,0 +1,107 @@ +/* + 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.IO; +using System.Windows; +using Microsoft.Phone.Controls; +using Microsoft.Phone.Tasks; + +namespace WP7CordovaClassLib.Cordova.UI +{ + public partial class ImageCapture : PhoneApplicationPage + { + public ImageCapture() + { + InitializeComponent(); + } + } + + public class ImageCaptureTask + { + /// + /// Represents an image returned from a call to the Show method of + /// a WP7CordovaClassLib.Cordova.Controls.ImageCaptureTask object + /// + //public class AudioResult : TaskEventArgs + //{ + // /// + // /// Initializes a new instance of the AudioResult class. + // /// + // public AudioResult() + // { } + + // /// + // /// Initializes a new instance of the AudioResult class + // /// with the specified Microsoft.Phone.Tasks.TaskResult. + // /// + // /// Associated Microsoft.Phone.Tasks.TaskResult + // public AudioResult(TaskResult taskResult) + // : base(taskResult) + // { } + + // /// + // /// Gets the file name of the recorded audio. + // /// + // public Stream AudioFile { get; internal set; } + + // /// + // /// Gets the stream containing the data for the recorded audio. + // /// + // public string AudioFileName { get; internal set; } + //} + + ///// + ///// Occurs when a audio recording task is completed. + ///// + //public event EventHandler Completed; + + /// + /// Shows Audio Recording application + /// + public void Show() + { + Deployment.Current.Dispatcher.BeginInvoke(() => + { + var root = Application.Current.RootVisual as PhoneApplicationFrame; + + root.Navigated += new System.Windows.Navigation.NavigatedEventHandler(NavigationService_Navigated); + + // dummy parameter is used to always open a fresh version + root.Navigate(new System.Uri("/WP7CordovaClassLib;component/Cordova/UI/ImageCapture.xaml?dummy=" + Guid.NewGuid().ToString(), UriKind.Relative)); + }); + } + + /// + /// Performs additional configuration of the recording application. + /// + /// + /// + private void NavigationService_Navigated(object sender, System.Windows.Navigation.NavigationEventArgs e) + { + ImageCapture imageCapture = e.Content as ImageCapture; + if (imageCapture != null) + { + (Application.Current.RootVisual as PhoneApplicationFrame).Navigated -= NavigationService_Navigated; + + //imageCapture.Completed += this.Completed; + //else if (this.Completed != null) + //{ + // this.Completed(this, new AudioResult(TaskResult.Cancel)); + //} + } + } + } +} \ No newline at end of file