incubator-callback-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From purplecabb...@apache.org
Subject [4/5] wp7 commit: added image capture view - wip
Date Thu, 21 Jun 2012 00:14:12 GMT
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 <purplecabbage@gmail.com>
Authored: Wed Jun 20 16:11:56 2012 -0700
Committer: Jesse MacFadyen <purplecabbage@gmail.com>
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 @@
+<phone:PhoneApplicationPage 
+    x:Class="WP7CordovaClassLib.Cordova.UI.ImageCapture"
+    xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
+    xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
+    xmlns:phone="clr-namespace:Microsoft.Phone.Controls;assembly=Microsoft.Phone"
+    xmlns:shell="clr-namespace:Microsoft.Phone.Shell;assembly=Microsoft.Phone"
+    xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
+    xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
+    FontFamily="{StaticResource PhoneFontFamilyNormal}"
+    FontSize="{StaticResource PhoneFontSizeNormal}"
+    Foreground="{StaticResource PhoneForegroundBrush}"
+    SupportedOrientations="PortraitOrLandscape" Orientation="Portrait"
+    mc:Ignorable="d" d:DesignHeight="768" d:DesignWidth="480"
+    shell:SystemTray.IsVisible="True">
+
+    <!--LayoutRoot is the root grid where all page content is placed-->
+    <Grid x:Name="LayoutRoot" Background="Yellow">
+        <Grid.RowDefinitions>
+            <RowDefinition Height="Auto"/>
+            <RowDefinition Height="*"/>
+        </Grid.RowDefinitions>
+
+    </Grid>
+ 
+
+</phone:PhoneApplicationPage>

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
+    {
+        /// <summary>
+        /// Represents an image returned from a call to the Show method of
+        /// a WP7CordovaClassLib.Cordova.Controls.ImageCaptureTask object
+        /// </summary>
+        //public class AudioResult : TaskEventArgs
+        //{
+        //    /// <summary>
+        //    /// Initializes a new instance of the AudioResult class.
+        //    /// </summary>
+        //    public AudioResult()
+        //    { }
+
+        //    /// <summary>
+        //    /// Initializes a new instance of the AudioResult class
+        //    /// with the specified Microsoft.Phone.Tasks.TaskResult.
+        //    /// </summary>
+        //    /// <param name="taskResult">Associated Microsoft.Phone.Tasks.TaskResult</param>
+        //    public AudioResult(TaskResult taskResult)
+        //        : base(taskResult)
+        //    { }
+
+        //    /// <summary>
+        //    ///  Gets the file name of the recorded audio.
+        //    /// </summary>
+        //    public Stream AudioFile { get; internal set; }
+
+        //    /// <summary>
+        //    /// Gets the stream containing the data for the recorded audio.
+        //    /// </summary>
+        //    public string AudioFileName { get; internal set; }
+        //}
+
+        ///// <summary>
+        ///// Occurs when a audio recording task is completed.
+        ///// </summary>
+        //public event EventHandler<AudioResult> Completed;
+
+        /// <summary>
+        /// Shows Audio Recording application
+        /// </summary>
+        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));
+            });
+        }
+
+        /// <summary>
+        /// Performs additional configuration of the recording application.
+        /// </summary>
+        /// <param name="sender"></param>
+        /// <param name="e"></param>
+        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


Mime
View raw message