incubator-callback-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From purplecabb...@apache.org
Subject [29/46] rejigger to the new structure
Date Sat, 14 Jul 2012 00:24:42 GMT
http://git-wip-us.apache.org/repos/asf/incubator-cordova-wp7/blob/62d32605/framework/Cordova/Commands/Media.cs
----------------------------------------------------------------------
diff --git a/framework/Cordova/Commands/Media.cs b/framework/Cordova/Commands/Media.cs
deleted file mode 100644
index 7b8de51..0000000
--- a/framework/Cordova/Commands/Media.cs
+++ /dev/null
@@ -1,493 +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.Collections.Generic;
-using System.Runtime.Serialization;
-using System.Windows;
-using System.Diagnostics;
-
-namespace WP7CordovaClassLib.Cordova.Commands
-{
-    /// <summary>
-    /// Provides the ability to record and play back audio files on a device. 
-    /// </summary>
-    public class Media : BaseCommand
-    {
-        /// <summary>
-        /// Audio player objects
-        /// </summary>
-        private static Dictionary<string, AudioPlayer> players = new Dictionary<string,AudioPlayer>();
-
-        /// <summary>
-        /// Represents Media action options.
-        /// </summary>
-        [DataContract]
-        public class MediaOptions
-        {
-            /// <summary>
-            /// Audio id
-            /// </summary>
-            [DataMember(Name = "id", IsRequired = true)]
-            public string Id { get; set; }
-
-            /// <summary>
-            /// Path to audio file
-            /// </summary>
-            [DataMember(Name = "src")]
-            public string Src { get; set; }
-
-            /// <summary>
-            /// New track position
-            /// </summary>
-            [DataMember(Name = "milliseconds")]
-            public int Milliseconds { get; set; }                        
-        }
-
-        /// <summary>
-        /// Releases the audio player instance to save memory.
-        /// </summary>  
-        public void release(string options)
-        {
-            try
-            {
-                MediaOptions mediaOptions;
-
-                try
-                {
-                    mediaOptions = JSON.JsonHelper.Deserialize<MediaOptions>(options);
-                }
-                catch (Exception)
-                {
-                    DispatchCommandResult(new PluginResult(PluginResult.Status.JSON_EXCEPTION));
-                    return;
-                }
-
-                if (!Media.players.ContainsKey(mediaOptions.Id))
-                {
-                    DispatchCommandResult(new PluginResult(PluginResult.Status.OK, false));
-                    return;
-                }
-
-                Deployment.Current.Dispatcher.BeginInvoke(() =>
-                {
-                    try
-                    {
-                        AudioPlayer audio = Media.players[mediaOptions.Id];
-                        Media.players.Remove(mediaOptions.Id);
-                        audio.Dispose();
-                        DispatchCommandResult(new PluginResult(PluginResult.Status.OK, true));
-                    }
-                    catch (Exception e)
-                    {
-                        DispatchCommandResult(new PluginResult(PluginResult.Status.ERROR, e.Message));
-                    }  
-                });
-            }
-            catch (Exception e)
-            {
-                DispatchCommandResult(new PluginResult(PluginResult.Status.ERROR, e.Message));
-            }           
-        }
-
-        /// <summary>
-        /// Starts recording and save the specified file 
-        /// </summary>
-        public void startRecordingAudio(string options)
-        {
-            try
-            {
-                MediaOptions mediaOptions;
-
-                try
-                {
-                    mediaOptions = JSON.JsonHelper.Deserialize<MediaOptions>(options);
-                }
-                catch (Exception)
-                {
-                    DispatchCommandResult(new PluginResult(PluginResult.Status.JSON_EXCEPTION));
-                    return;
-                }
-
-                Deployment.Current.Dispatcher.BeginInvoke(() =>
-                {
-                    try
-                    {
-                        if (!Media.players.ContainsKey(mediaOptions.Id))
-                        {
-                            AudioPlayer audio = new AudioPlayer(this, mediaOptions.Id);
-                            Media.players.Add(mediaOptions.Id, audio);
-                            audio.startRecording(mediaOptions.Src);
-                        }
-                        DispatchCommandResult(new PluginResult(PluginResult.Status.OK));
-                    }
-                    catch (Exception e)
-                    {
-                        DispatchCommandResult(new PluginResult(PluginResult.Status.ERROR, e.Message));
-                    }
-
-                });
-            }
-            catch (Exception e)
-            {
-                DispatchCommandResult(new PluginResult(PluginResult.Status.ERROR, e.Message));
-            }
-        }
-
-        /// <summary>
-        /// Stops recording and save to the file specified when recording started 
-        /// </summary>
-        public void stopRecordingAudio(string options)
-        {
-            try
-            {
-                MediaOptions mediaOptions;
-
-                try
-                {
-                    mediaOptions = JSON.JsonHelper.Deserialize<MediaOptions>(options);
-                }
-                catch (Exception)
-                {
-                    DispatchCommandResult(new PluginResult(PluginResult.Status.JSON_EXCEPTION));
-                    return;
-                }
-
-                Deployment.Current.Dispatcher.BeginInvoke(() =>
-                {
-                    try
-                    {
-                        if (Media.players.ContainsKey(mediaOptions.Id))
-                        {
-                            AudioPlayer audio = Media.players[mediaOptions.Id];
-                            audio.stopRecording();
-                            Media.players.Remove(mediaOptions.Id);
-                        }
-                        DispatchCommandResult(new PluginResult(PluginResult.Status.OK));
-                    }
-                    catch (Exception e)
-                    {
-                        DispatchCommandResult(new PluginResult(PluginResult.Status.ERROR, e.Message));
-                    }
-                });
-            }
-            catch(Exception e)
-            {
-                DispatchCommandResult(new PluginResult(PluginResult.Status.ERROR, e.Message));
-            }
-        }
-
-        // Called when you create a new Media('blah') object in JS.
-        public void create(string options)
-        {
-            try
-            {
-                MediaOptions mediaOptions;
-
-                try
-                {
-                    mediaOptions = JSON.JsonHelper.Deserialize<MediaOptions>(options);
-                }
-                catch (Exception)
-                {
-                    DispatchCommandResult(new PluginResult(PluginResult.Status.JSON_EXCEPTION, "Error parsing options into create method"));
-                    return;
-                }
-
-                AudioPlayer audio = new AudioPlayer(this, mediaOptions.Id);
-                Media.players.Add(mediaOptions.Id, audio);
-          
-                DispatchCommandResult(new PluginResult(PluginResult.Status.OK));
-                  
-            }
-            catch (Exception e)
-            {
-                DispatchCommandResult(new PluginResult(PluginResult.Status.ERROR, e.Message));
-            }
-        }
-
-        /// <summary>
-        /// Starts or resume playing audio file 
-        /// </summary>
-        public void startPlayingAudio(string options)
-        {
-            try
-            {
-                MediaOptions mediaOptions;
-
-                try
-                {
-                    mediaOptions = JSON.JsonHelper.Deserialize<MediaOptions>(options);
-                }
-                catch (Exception)
-                {
-                    DispatchCommandResult(new PluginResult(PluginResult.Status.JSON_EXCEPTION));
-                    return;
-                }
-
-                AudioPlayer audio;
-
-                if (!Media.players.ContainsKey(mediaOptions.Id))
-                {
-                    audio = new AudioPlayer(this, mediaOptions.Id);
-                    Media.players.Add(mediaOptions.Id, audio);
-                }
-                else
-                {
-                    Debug.WriteLine("INFO: startPlayingAudio could not find mediaPlayer for " + mediaOptions.Id);
-                    audio = Media.players[mediaOptions.Id];
-                }
-
-                Deployment.Current.Dispatcher.BeginInvoke(() =>
-                {
-                    try
-                    {
-                        audio.startPlaying(mediaOptions.Src);
-
-                        DispatchCommandResult(new PluginResult(PluginResult.Status.OK));
-                    }
-                    catch (Exception e)
-                    {
-                        DispatchCommandResult(new PluginResult(PluginResult.Status.ERROR, e.Message));
-                    }
-                });
-            }
-            catch(Exception e)
-            {
-                DispatchCommandResult(new PluginResult(PluginResult.Status.ERROR, e.Message));
-            }
-        }
-
-
-        /// <summary>
-        /// Seeks to a location
-        /// </summary>
-        public void seekToAudio(string options)
-        {
-            try
-            {
-                MediaOptions mediaOptions;
-
-                try
-                {
-                    mediaOptions = JSON.JsonHelper.Deserialize<MediaOptions>(options);
-                }
-                catch (Exception)
-                {
-                    DispatchCommandResult(new PluginResult(PluginResult.Status.JSON_EXCEPTION));
-                    return;
-                }
-
-                Deployment.Current.Dispatcher.BeginInvoke(() =>
-                {
-                    try
-                    {
-                        if (Media.players.ContainsKey(mediaOptions.Id))
-                        {
-                            AudioPlayer audio = Media.players[mediaOptions.Id];
-                            audio.seekToPlaying(mediaOptions.Milliseconds);
-                        }
-                        else
-                        {
-                            Debug.WriteLine("ERROR: seekToAudio could not find mediaPlayer for " + mediaOptions.Id);
-                        }
-
-                        DispatchCommandResult(new PluginResult(PluginResult.Status.OK));
-                    }
-                    catch (Exception e)
-                    {
-                        DispatchCommandResult(new PluginResult(PluginResult.Status.ERROR, e.Message));
-                    }
-                });
-            }
-            catch (Exception e)
-            {
-                DispatchCommandResult(new PluginResult(PluginResult.Status.ERROR, e.Message));
-            }
-        }
-
-        /// <summary>
-        /// Pauses playing 
-        /// </summary>
-        public void pausePlayingAudio(string options)
-        {
-
-                MediaOptions mediaOptions;
-
-                try
-                {
-                    mediaOptions = JSON.JsonHelper.Deserialize<MediaOptions>(options);
-                }
-                catch (Exception)
-                {
-                    DispatchCommandResult(new PluginResult(PluginResult.Status.JSON_EXCEPTION));
-                    return;
-                }
-
-                Deployment.Current.Dispatcher.BeginInvoke(() =>
-                {
-                    try
-                    {
-                        if (Media.players.ContainsKey(mediaOptions.Id))
-                        {
-                            AudioPlayer audio = Media.players[mediaOptions.Id];
-                            audio.pausePlaying();
-                        }
-                        else
-                        {
-                            Debug.WriteLine("ERROR: pausePlayingAudio could not find mediaPlayer for " + mediaOptions.Id);
-                        }
-
-                        DispatchCommandResult(new PluginResult(PluginResult.Status.OK));
-                    }
-                    catch (Exception e)
-                    {
-                        DispatchCommandResult(new PluginResult(PluginResult.Status.ERROR, e.Message));
-                    }
-                });
-        }
-
-
-        /// <summary>
-        /// Stops playing the audio file
-        /// </summary>
-        public void stopPlayingAudio(String options)
-        {
-            try
-            {
-                MediaOptions mediaOptions;
-
-                try
-                {
-                    mediaOptions = JSON.JsonHelper.Deserialize<MediaOptions>(options);
-                }
-                catch (Exception)
-                {
-                    DispatchCommandResult(new PluginResult(PluginResult.Status.JSON_EXCEPTION));
-                    return;
-                }
-
-                Deployment.Current.Dispatcher.BeginInvoke(() =>
-                {
-                    try
-                    {
-                        if (Media.players.ContainsKey(mediaOptions.Id))
-                        {
-                            AudioPlayer audio = Media.players[mediaOptions.Id];
-                            audio.stopPlaying();
-                        }
-                        else
-                        {
-                            Debug.WriteLine("stopPlaying could not find mediaPlayer for " + mediaOptions.Id);
-                        }
-
-                        DispatchCommandResult(new PluginResult(PluginResult.Status.OK));
-                    }
-                    catch(Exception e)
-                    {
-                        DispatchCommandResult(new PluginResult(PluginResult.Status.ERROR, e.Message));
-                    }
-                });
-            }
-            catch(Exception e)
-            {
-                DispatchCommandResult(new PluginResult(PluginResult.Status.ERROR, e.Message));
-            }
-
-        }
-        
-        /// <summary>
-        /// Gets current position of playback
-        /// </summary>
-        public void getCurrentPositionAudio(string options)
-        {
-            try
-            {
-                MediaOptions mediaOptions;
-
-                try
-                {
-                    mediaOptions = JSON.JsonHelper.Deserialize<MediaOptions>(options);
-                }
-                catch (Exception)
-                {
-                    DispatchCommandResult(new PluginResult(PluginResult.Status.JSON_EXCEPTION));
-                    return;
-                }
-
-                if (Media.players.ContainsKey(mediaOptions.Id))
-                {
-                    AudioPlayer audio = Media.players[mediaOptions.Id];
-                    Deployment.Current.Dispatcher.BeginInvoke(() =>
-                    {
-                        DispatchCommandResult(new PluginResult(PluginResult.Status.OK, audio.getCurrentPosition()));
-                    });
-                    return;
-                }
-                else
-                {
-                    DispatchCommandResult(new PluginResult(PluginResult.Status.OK, -1));
-                }
-            }
-            catch (Exception e)
-            {
-                DispatchCommandResult(new PluginResult(PluginResult.Status.ERROR, e.Message));
-            }
-        }
-
-        
-        /// <summary>
-        /// Gets the duration of the audio file
-        /// </summary>
-        public void getDurationAudio(string options)
-        {
-            try
-            {
-                MediaOptions mediaOptions;
-
-                try
-                {
-                    mediaOptions = JSON.JsonHelper.Deserialize<MediaOptions>(options);
-                }
-                catch (Exception)
-                {
-                    DispatchCommandResult(new PluginResult(PluginResult.Status.JSON_EXCEPTION));
-                    return;
-                }
-
-                AudioPlayer audio;
-                if (Media.players.ContainsKey(mediaOptions.Id))
-                {
-                    audio = Media.players[mediaOptions.Id];                    
-                }
-                else
-                {
-                    Debug.WriteLine("ERROR: getDurationAudio could not find mediaPlayer for " + mediaOptions.Id);
-                    audio = new AudioPlayer(this, mediaOptions.Id);
-                    Media.players.Add(mediaOptions.Id, audio);
-                }
-
-                Deployment.Current.Dispatcher.BeginInvoke(() =>
-                {
-                    DispatchCommandResult(new PluginResult(PluginResult.Status.OK, audio.getDuration(mediaOptions.Src)));
-                });
-            }
-            catch(Exception e)
-            {
-                DispatchCommandResult(new PluginResult(PluginResult.Status.ERROR, e.Message));
-            }
-        }  
-
-    }
-}

http://git-wip-us.apache.org/repos/asf/incubator-cordova-wp7/blob/62d32605/framework/Cordova/Commands/MimeTypeMapper.cs
----------------------------------------------------------------------
diff --git a/framework/Cordova/Commands/MimeTypeMapper.cs b/framework/Cordova/Commands/MimeTypeMapper.cs
deleted file mode 100644
index 2ca58e6..0000000
--- a/framework/Cordova/Commands/MimeTypeMapper.cs
+++ /dev/null
@@ -1,99 +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.Collections.Generic;
-using System.IO;
-
-namespace WP7CordovaClassLib.Cordova.Commands
-{
-    /// <summary>
-    /// Represents file extension to mime type mapper.
-    /// </summary>
-    public static class MimeTypeMapper
-    {
-        /// <summary>
-        /// For unknown type it is recommended to use 'application/octet-stream'
-        /// http://stackoverflow.com/questions/1176022/unknown-file-type-mime
-        /// </summary>
-        private static string DefaultMimeType = "application/octet-stream";
-        
-        /// <summary>
-        /// Stores mime type for all necessary extension
-        /// </summary>
-        private static readonly Dictionary<string, string> MIMETypesDictionary = new Dictionary<string, string>
-                                                                             {                                                                                
-                                                                                 {"avi", "video/x-msvideo"},
-                                                                                 {"bmp", "image/bmp"},                                                                                                                                                                
-                                                                                 {"gif", "image/gif"},                                                                                                                                                               
-                                                                                 {"jpe", "image/jpeg"},
-                                                                                 {"jpeg", "image/jpeg"},
-                                                                                 {"jpg", "image/jpeg"},                                                                                                                                                             
-                                                                                 {"mov", "video/quicktime"},
-                                                                                 {"mp2", "audio/mpeg"},
-                                                                                 {"mp3", "audio/mpeg"},
-                                                                                 {"mp4", "video/mp4"},
-                                                                                 {"mpe", "video/mpeg"},
-                                                                                 {"mpeg", "video/mpeg"},
-                                                                                 {"mpg", "video/mpeg"},
-                                                                                 {"mpga", "audio/mpeg"},                                                                                
-                                                                                 {"pbm", "image/x-portable-bitmap"},
-                                                                                 {"pcm", "audio/x-pcm"},
-                                                                                 {"pct", "image/pict"},
-                                                                                 {"pgm", "image/x-portable-graymap"},
-                                                                                 {"pic", "image/pict"},
-                                                                                 {"pict", "image/pict"},
-                                                                                 {"png", "image/png"},
-                                                                                 {"pnm", "image/x-portable-anymap"},
-                                                                                 {"pnt", "image/x-macpaint"},
-                                                                                 {"pntg", "image/x-macpaint"},
-                                                                                 {"ppm", "image/x-portable-pixmap"},
-                                                                                 {"qt", "video/quicktime"},
-                                                                                 {"ra", "audio/x-pn-realaudio"},
-                                                                                 {"ram", "audio/x-pn-realaudio"},
-                                                                                 {"ras", "image/x-cmu-raster"},
-                                                                                 {"rgb", "image/x-rgb"},
-                                                                                 {"snd", "audio/basic"},
-                                                                                 {"txt", "text/plain"},
-                                                                                 {"tif", "image/tiff"},
-                                                                                 {"tiff", "image/tiff"},
-                                                                                 {"wav", "audio/x-wav"},
-                                                                                 {"wbmp", "image/vnd.wap.wbmp"},
-
-                                                                             };
-        /// <summary>
-        /// Gets mime type by file extension
-        /// </summary>
-        /// <param name="fileName">file name to extract extension</param>
-        /// <returns>mime type</returns>
-        public static string GetMimeType(string fileName)
-        {
-            string ext = Path.GetExtension(fileName);
-
-            // invalid extension
-            if (string.IsNullOrEmpty(ext) || !ext.StartsWith("."))
-            {
-                return DefaultMimeType;
-            }
-
-            ext = ext.Remove(0, 1);
-
-            if (MIMETypesDictionary.ContainsKey(ext))
-            {
-                return MIMETypesDictionary[ext];
-            }
-
-            return DefaultMimeType;
-        }
-    }
-}

http://git-wip-us.apache.org/repos/asf/incubator-cordova-wp7/blob/62d32605/framework/Cordova/Commands/NetworkStatus.cs
----------------------------------------------------------------------
diff --git a/framework/Cordova/Commands/NetworkStatus.cs b/framework/Cordova/Commands/NetworkStatus.cs
deleted file mode 100644
index ba56724..0000000
--- a/framework/Cordova/Commands/NetworkStatus.cs
+++ /dev/null
@@ -1,124 +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.Diagnostics;
-using System.Net;
-using System.Net.NetworkInformation;
-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.Net.NetworkInformation;
-
-namespace WP7CordovaClassLib.Cordova.Commands
-{
-
-    // http://msdn.microsoft.com/en-us/library/microsoft.phone.net.networkinformation(v=VS.92).aspx
-    // http://msdn.microsoft.com/en-us/library/microsoft.phone.net.networkinformation.devicenetworkinformation(v=VS.92).aspx
-
-    public class NetworkStatus : BaseCommand
-    {
-        const string UNKNOWN = "unknown";
-        const string ETHERNET = "ethernet";
-        const string WIFI = "wifi";
-        const string CELL_2G = "2g";
-        const string CELL_3G = "3g";
-        const string CELL_4G = "4g";
-        const string NONE = "none";
-        const string CELL = "cellular";
-
-        private bool HasCallback = false;
-
-        public NetworkStatus()
-        {
-            DeviceNetworkInformation.NetworkAvailabilityChanged += new EventHandler<NetworkNotificationEventArgs>(ChangeDetected);
-        }
-
-        public void getConnectionInfo(string empty)
-        {
-            HasCallback = true;
-            updateConnectionType(checkConnectionType());
-        }
-
-        private string checkConnectionType()
-        {
-            if (DeviceNetworkInformation.IsNetworkAvailable)
-            {
-                if (DeviceNetworkInformation.IsWiFiEnabled)
-                {
-                    return WIFI;
-                }
-                else
-                {
-                    return DeviceNetworkInformation.IsCellularDataEnabled ? CELL : UNKNOWN;
-                }
-            }
-            return NONE;
-        }
-
-        private string checkConnectionType(NetworkInterfaceSubType type)
-        {
-            switch (type)
-            {
-                case NetworkInterfaceSubType.Cellular_1XRTT: //cell
-                case NetworkInterfaceSubType.Cellular_GPRS: //cell
-                    return CELL;
-                case NetworkInterfaceSubType.Cellular_EDGE: //2
-                    return CELL_2G;
-                case NetworkInterfaceSubType.Cellular_3G:
-                case NetworkInterfaceSubType.Cellular_EVDO: //3
-                case NetworkInterfaceSubType.Cellular_EVDV: //3 
-                case NetworkInterfaceSubType.Cellular_HSPA: //3
-                    return CELL_3G;
-                case NetworkInterfaceSubType.WiFi:
-                    return WIFI;
-                case NetworkInterfaceSubType.Unknown:
-                case NetworkInterfaceSubType.Desktop_PassThru:
-                default:
-                    return UNKNOWN;
-            }
-        }
-
-        void ChangeDetected(object sender, NetworkNotificationEventArgs e)
-        {
-            switch (e.NotificationType)
-            {
-                case NetworkNotificationType.InterfaceConnected:
-                    updateConnectionType(checkConnectionType(e.NetworkInterface.InterfaceSubtype));
-                    break;
-                case NetworkNotificationType.InterfaceDisconnected:
-                    updateConnectionType(NONE);
-                    break;
-                default:
-                    break;
-            }
-        }
-
-        private void updateConnectionType(string type)
-        {
-            // This should also implicitly fire offline/online events as that is handled on the JS side
-            if (this.HasCallback)
-            {
-                PluginResult result = new PluginResult(PluginResult.Status.OK, type);
-                result.KeepCallback = true;
-                DispatchCommandResult(result);
-            }
-        }
-    }
-}

http://git-wip-us.apache.org/repos/asf/incubator-cordova-wp7/blob/62d32605/framework/Cordova/Commands/Notification.cs
----------------------------------------------------------------------
diff --git a/framework/Cordova/Commands/Notification.cs b/framework/Cordova/Commands/Notification.cs
deleted file mode 100644
index 12fd16b..0000000
--- a/framework/Cordova/Commands/Notification.cs
+++ /dev/null
@@ -1,310 +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.Windows;
-using System.Windows.Controls;
-using Microsoft.Devices;
-using System.Runtime.Serialization;
-using System.Threading;
-using System.Windows.Resources;
-using Microsoft.Phone.Controls;
-using Microsoft.Xna.Framework.Audio;
-using WP7CordovaClassLib.Cordova.UI;
-
-namespace WP7CordovaClassLib.Cordova.Commands
-{
-    public class Notification : BaseCommand
-    {
-        static ProgressBar progressBar = null;
-        const int DEFAULT_DURATION = 5;
-
-        private NotificationBox notifBox;
-
-        private PhoneApplicationPage Page
-        {
-            get
-            {
-                PhoneApplicationPage page = null;
-                PhoneApplicationFrame frame = Application.Current.RootVisual as PhoneApplicationFrame;
-                if (frame != null)
-                {
-                    page = frame.Content as PhoneApplicationPage;
-                }
-                return page;
-            }
-        }
-
-        // alert, confirm, blink, vibrate, beep
-        // blink api - doesn't look like there is an equivalent api we can use...
-        // vibrate api - http://msdn.microsoft.com/en-us/library/microsoft.devices.vibratecontroller(v=VS.92).aspx
-        // beep api - can probably use: http://msdn.microsoft.com/en-us/library/microsoft.phone.scheduler.alarm(v=VS.92).aspx
-        //          - examples of alarm class http://mkdot.net/blogs/filip/archive/2011/06/06/windows-phone-multitasking-part-2-2.aspx
-
-        //MessageBoxResult res = MessageBox.Show("Could not call script: " + ex.Message, "caption", MessageBoxButton.OKCancel);
-
-        [DataContract]
-        public class AlertOptions
-        {
-            [OnDeserializing]
-            public void OnDeserializing(StreamingContext context)
-            {
-                // set defaults
-                this.message = "message";
-                this.title = "Alert";
-                this.buttonLabel = "ok";
-            }
-
-            /// <summary>
-            /// message to display in the alert box
-            /// </summary>
-            [DataMember]
-            public string message;
-
-            /// <summary>
-            /// title displayed on the alert window
-            /// </summary>
-            [DataMember]
-            public string title;
-
-            /// <summary>
-            /// text to display on the button
-            /// </summary>
-            [DataMember]
-            public string buttonLabel;
-        }
-
-        public void alert(string options)
-        {
-            Deployment.Current.Dispatcher.BeginInvoke(() =>
-            {
-                AlertOptions alertOpts = JSON.JsonHelper.Deserialize<AlertOptions>(options);
-
-                PhoneApplicationPage page = Page;
-                if (page != null)
-                {
-                    Grid grid = page.FindName("LayoutRoot") as Grid;
-                    if (grid != null)
-                    {
-                        notifBox = new NotificationBox();
-                        notifBox.PageTitle.Text = alertOpts.title;
-                        notifBox.SubTitle.Text = alertOpts.message;
-                        Button btnOK = new Button();
-                        btnOK.Content = alertOpts.buttonLabel;
-                        btnOK.Click += new RoutedEventHandler(btnOK_Click);
-                        btnOK.Tag = 1;
-                        notifBox.ButtonPanel.Children.Add(btnOK);
-                        grid.Children.Add(notifBox);
-                        page.BackKeyPress += page_BackKeyPress;
-                    }
-                }
-                else
-                {
-                    DispatchCommandResult(new PluginResult(PluginResult.Status.INSTANTIATION_EXCEPTION));
-                }
-            });
-        }
-
-        public void confirm(string options)
-        {
-            Deployment.Current.Dispatcher.BeginInvoke(() =>
-            {
-                AlertOptions alertOpts = JSON.JsonHelper.Deserialize<AlertOptions>(options);
-
-                PhoneApplicationPage page = Page;
-                if (page != null)
-                {
-                    Grid grid = page.FindName("LayoutRoot") as Grid;
-                    if (grid != null)
-                    {
-                        notifBox = new NotificationBox();
-                        notifBox.PageTitle.Text = alertOpts.title;
-                        notifBox.SubTitle.Text = alertOpts.message;
-
-                        string[] labels = alertOpts.buttonLabel.Split(',');
-                        for (int n = 0; n < labels.Length; n++)
-                        {
-                            Button btn = new Button();
-                            btn.Content = labels[n];
-                            btn.Tag = n;
-                            btn.Click += new RoutedEventHandler(btnOK_Click);
-                            notifBox.ButtonPanel.Children.Add(btn);
-                        }
-
-                        grid.Children.Add(notifBox);
-                        page.BackKeyPress += page_BackKeyPress;
-                    }
-                }
-                else
-                {
-                    DispatchCommandResult(new PluginResult(PluginResult.Status.INSTANTIATION_EXCEPTION));
-                }
-            });
-        }
-
-        void page_BackKeyPress(object sender, System.ComponentModel.CancelEventArgs e)
-        {
-            PhoneApplicationPage page = sender as PhoneApplicationPage;
-            if (page != null && notifBox != null)
-            {
-                Grid grid = page.FindName("LayoutRoot") as Grid;
-                if (grid != null)
-                {
-                    grid.Children.Remove(notifBox);
-                }
-                notifBox = null;
-                page.BackKeyPress -= page_BackKeyPress;
-                e.Cancel = true;
-            }
-
-            DispatchCommandResult(new PluginResult(PluginResult.Status.OK, 0));
-        }
-
-        void btnOK_Click(object sender, RoutedEventArgs e)
-        {
-            Button btn = sender as Button;
-            int retVal = 0;
-            if (btn != null)
-            {
-                retVal = (int)btn.Tag + 1;
-            }
-            if (notifBox != null)
-            {
-                PhoneApplicationPage page = Page;
-                if (page != null)
-                {
-                    Grid grid = page.FindName("LayoutRoot") as Grid;
-                    if (grid != null)
-                    {
-                        grid.Children.Remove(notifBox);
-                    }
-                }
-                notifBox = null;
-            }
-            DispatchCommandResult(new PluginResult(PluginResult.Status.OK, retVal));
-        }
-
-        
-
-        public void beep(string count)
-        {
-            int times = int.Parse(count);
-
-            StreamResourceInfo sri = Application.GetResourceStream(new Uri("/WP7CordovaClassLib;component/resources/notification-beep.wav", UriKind.Relative));
-            if (sri != null)
-            {
-                SoundEffect effect = SoundEffect.FromStream(sri.Stream);
-                SoundEffectInstance inst = effect.CreateInstance();
-                ThreadPool.QueueUserWorkItem((o) =>
-                {
-                    // cannot interact with UI !!
-                    do
-                    {
-                        inst.Play();
-                        Thread.Sleep(effect.Duration + TimeSpan.FromMilliseconds(100));
-                    }
-                    while (--times > 0);
-
-               });
-
-            }
-         
-            // TODO: may need a listener to trigger DispatchCommandResult after the alarm has finished executing...
-            DispatchCommandResult();
-        }
-
-        // Display an inderminate progress indicator
-        public void activityStart(string unused)
-        {
-           
-            Deployment.Current.Dispatcher.BeginInvoke(() =>
-            {
-                PhoneApplicationFrame frame =  Application.Current.RootVisual as PhoneApplicationFrame;
-
-                if (frame != null)
-                {
-                    PhoneApplicationPage page = frame.Content as PhoneApplicationPage;
-
-                    if (page != null)
-                    {
-                        var temp = page.FindName("LayoutRoot");
-                        Grid grid = temp as Grid;
-                        if (grid != null)
-                        {
-                            if (progressBar != null)
-                            {
-                                grid.Children.Remove(progressBar);
-                            }
-                            progressBar = new ProgressBar();
-                            progressBar.IsIndeterminate = true;
-                            progressBar.IsEnabled = true;
-
-                            grid.Children.Add(progressBar);
-                        }
-                    }
-                }
-            });
-        }
-
-
-        // Remove our inderminate progress indicator
-        public void activityStop(string unused)
-        {
-            Deployment.Current.Dispatcher.BeginInvoke(() =>
-            {
-                if (progressBar != null)
-                {
-                    progressBar.IsEnabled = false;
-                    PhoneApplicationFrame frame = Application.Current.RootVisual as PhoneApplicationFrame;
-                    if (frame != null)
-                    {
-                        PhoneApplicationPage page = frame.Content as PhoneApplicationPage;
-                        if (page != null)
-                        {
-                            Grid grid = page.FindName("LayoutRoot") as Grid;
-                            if (grid != null)
-                            {
-                                grid.Children.Remove(progressBar);
-                            }
-                        }
-                    }
-                    progressBar = null;
-                }
-            });
-        }
-
-        public void vibrate(string vibrateDuration)
-        {
-            int msecs = 200; // set default
-
-            try
-            {
-                msecs = int.Parse(vibrateDuration);
-                if (msecs < 1)
-                {
-                    msecs = 1;
-                }
-            }
-            catch (FormatException)
-            {
-
-            }
-
-            VibrateController.Default.Start(TimeSpan.FromMilliseconds(msecs));
-
-            // TODO: may need to add listener to trigger DispatchCommandResult when the vibration ends...
-            DispatchCommandResult();
-        }
-    }
-}

http://git-wip-us.apache.org/repos/asf/incubator-cordova-wp7/blob/62d32605/framework/Cordova/CordovaCommandCall.cs
----------------------------------------------------------------------
diff --git a/framework/Cordova/CordovaCommandCall.cs b/framework/Cordova/CordovaCommandCall.cs
deleted file mode 100644
index 136308d..0000000
--- a/framework/Cordova/CordovaCommandCall.cs
+++ /dev/null
@@ -1,86 +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 System.Linq;
-
-namespace WP7CordovaClassLib.Cordova
-{
-    /// <summary>
-    /// Represents Cordova native command call: action callback, etc
-    /// </summary>
-    public class CordovaCommandCall
-    {
-        public String Service {get; private set;}
-        public String Action {get; private set;}
-        public String CallbackId {get; private set;}
-        public String Args {get; private set;}
-        
-        /// <summary>
-        /// Retrieves command call parameters and creates wrapper for them
-        /// </summary>
-        /// <param name="commandStr">Command string in the form 'service/action/callback/args'</param>
-        /// <returns>New class instance or null of string does not represent Cordova command</returns>
-        public static CordovaCommandCall Parse(string commandStr)
-        {
-            if (string.IsNullOrEmpty(commandStr))
-            {
-                return null;
-                //throw new ArgumentNullException("commandStr");
-            }
-
-            string[] split = commandStr.Split('/');
-            if (split.Length < 3)
-            {
-                return null;
-            }
-
-            CordovaCommandCall commandCallParameters = new CordovaCommandCall();
-
-            commandCallParameters.Service = split[0];
-            commandCallParameters.Action = split[1];
-            commandCallParameters.CallbackId = split[2];
-            commandCallParameters.Args = split.Length <= 3 ? String.Empty : String.Join("/", split.Skip(3));
-
-            // sanity check for illegal names
-            // was failing with ::
-            // CordovaCommandResult :: 1, Device1, {"status":1,"message":"{\"name\":\"XD.....
-            if (commandCallParameters.Service.IndexOfAny(new char[] { '@', ':', ',', '!', ' ' }) > -1)
-            {
-                return null;
-            }
-
-
-            return commandCallParameters;
-        }
-
-
-        /// <summary>
-        /// Private ctr to disable class creation.
-        /// New class instance must be initialized via CordovaCommandCall.Parse static method.
-        /// </summary>
-        private CordovaCommandCall() { }
-            
-
-    }
-}

http://git-wip-us.apache.org/repos/asf/incubator-cordova-wp7/blob/62d32605/framework/Cordova/DOMStorageHelper.cs
----------------------------------------------------------------------
diff --git a/framework/Cordova/DOMStorageHelper.cs b/framework/Cordova/DOMStorageHelper.cs
deleted file mode 100644
index 52298e5..0000000
--- a/framework/Cordova/DOMStorageHelper.cs
+++ /dev/null
@@ -1,145 +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 System.IO.IsolatedStorage;
-using System.Collections.Generic;
-using Microsoft.Phone.Controls;
-using System.Linq;
-using WP7CordovaClassLib.Cordova.JSON;
-
-/*
- * Translates DOMStorage API between JS and Isolated Storage
- * Missing pieces : QUOTA_EXCEEDED_ERR  + StorageEvent  
- * */
-
-namespace WP7CordovaClassLib
-{
-    public class DOMStorageHelper
-    {
-        protected WebBrowser webBrowser1;
-
-        public DOMStorageHelper(WebBrowser gapBrowser)
-        {
-            this.webBrowser1 = gapBrowser;
-            // always clear session at creation
-            UserSettings["sessionStorage"] = new Dictionary<string, string>();
-
-            if (!UserSettings.Contains("localStorage"))
-            {
-                UserSettings["localStorage"] = new Dictionary<string, string>();
-                UserSettings.Save();
-            }
-            Application.Current.Exit += new EventHandler(OnAppExit);
-        }
-
-        void OnAppExit(object sender, EventArgs e)
-        {
-            UserSettings.Remove("sessionStorage");
-            UserSettings.Save();
-        }
-
-        protected IsolatedStorageSettings UserSettings
-        {
-            get
-            {
-                return IsolatedStorageSettings.ApplicationSettings;
-            }
-        }
-
-        protected Dictionary<string, string> getStorageByType(string type)
-        {
-            if (!UserSettings.Contains(type))
-            {
-                UserSettings[type] = new Dictionary<string, string>();
-                UserSettings.Save();
-            }
-            return UserSettings[type] as Dictionary<string,string>;
-        }
-
-
-        public void HandleStorageCommand(string commandStr)
-        {
-            
-            string[] split = commandStr.Split('/');
-            if (split.Length > 3)
-            {
-                string api = split[0];
-                string type = split[1]; // localStorage || sessionStorage
-                string command = split[2];
-                string param = split[3];
-
-                Dictionary<string, string> currentStorage = getStorageByType(type);
-
-                switch (command)
-                {
-                    case "get":
-                        {
-
-                            if (currentStorage.Keys.Contains(param))
-                            {
-                                string value = currentStorage[param];
-                                webBrowser1.InvokeScript("execScript", "window." + type + ".onResult('" + param + "','" + value + "');");
-                            }
-                            else
-                            {
-                                webBrowser1.InvokeScript("execScript", "window." + type + ".onResult('" + param + "');");
-                            }
-
-                        }
-                        break;
-                    case "load":
-                        {
-                            string[] keys = currentStorage.Keys.ToArray();
-                            string jsonString = JsonHelper.Serialize(keys);
-                            string callbackJS = "window." + type + ".onKeysChanged('" + jsonString + "');";
-                            webBrowser1.InvokeScript("execScript", callbackJS);
-                        }
-                        break;
-                    case "set":
-                        {
-                            // TODO: check that length is not out of bounds
-                            currentStorage[param] = split[4];
-                            UserSettings.Save();
-                            string[] keys = currentStorage.Keys.ToArray();
-                            string jsonString = JsonHelper.Serialize(keys);
-                            string callbackJS = "window." + type + ".onKeysChanged('" + jsonString + "');";
-                            webBrowser1.InvokeScript("execScript", callbackJS);
-                        }
-                        break;
-                    case "remove":
-                        currentStorage.Remove(param);
-                        UserSettings.Save();
-                        break;
-                    case "clear":
-                        currentStorage = new Dictionary<string, string>();
-                        UserSettings[type] = currentStorage;
-                        UserSettings.Save();
-                        break;
-                }
-
-            }
-
-        }
-    }
-}

http://git-wip-us.apache.org/repos/asf/incubator-cordova-wp7/blob/62d32605/framework/Cordova/JSON/JsonHelper.cs
----------------------------------------------------------------------
diff --git a/framework/Cordova/JSON/JsonHelper.cs b/framework/Cordova/JSON/JsonHelper.cs
deleted file mode 100644
index 0eff386..0000000
--- a/framework/Cordova/JSON/JsonHelper.cs
+++ /dev/null
@@ -1,97 +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 System.Runtime.Serialization.Json;
-using System.IO;
-using System.Collections.Generic;
-using System.Text;
-using System.Diagnostics;
-
-namespace WP7CordovaClassLib.Cordova.JSON
-{
-    /// <summary>
-    /// Provides JSON serialization/deserialization functionality.
-    /// </summary>
-    public static class JsonHelper
-    {
-        /// <summary>
-        /// Serializes object to JSON string representation
-        /// </summary>
-        /// <param name="obj">object to serialize</param>
-        /// <returns>JSON representation of the object. Returns 'null' string for null passed as argument</returns>
-        public static string Serialize(object obj)
-        {
-            if (obj == null)
-            {
-                return "null";
-            }
-
-            DataContractJsonSerializer ser = new DataContractJsonSerializer(obj.GetType());
-
-            MemoryStream ms = new MemoryStream();
-            ser.WriteObject(ms, obj);
-
-            ms.Position = 0;
-            
-            string json = String.Empty;
-
-            using(StreamReader sr = new StreamReader(ms))
-            {
-                json = sr.ReadToEnd();
-            }
-
-            ms.Close();
-
-            return json;
-
-        }
-
-        /// <summary>
-        /// Parses json string to object instance
-        /// </summary>
-        /// <typeparam name="T">type of the object</typeparam>
-        /// <param name="json">json string representation of the object</param>
-        /// <returns>Deserialized object instance</returns>
-        public static T Deserialize<T>(string json)
-        {
-           DataContractJsonSerializer deserializer = new DataContractJsonSerializer(typeof(T));
-           object result = null;
-           try
-           {
-               using (MemoryStream mem = new MemoryStream(Encoding.UTF8.GetBytes(json)))
-               {
-                   result = deserializer.ReadObject(mem);
-               }
-           }
-           catch (Exception ex)
-           {
-               Debug.WriteLine(ex.Message);
-               Debug.WriteLine("Failed to deserialize " + typeof(T) + " with JSON value :: " + json);
-           }
-
-           return (T)result;
-
-        }
-    }
-}

http://git-wip-us.apache.org/repos/asf/incubator-cordova-wp7/blob/62d32605/framework/Cordova/NativeExecution.cs
----------------------------------------------------------------------
diff --git a/framework/Cordova/NativeExecution.cs b/framework/Cordova/NativeExecution.cs
deleted file mode 100644
index afc9381..0000000
--- a/framework/Cordova/NativeExecution.cs
+++ /dev/null
@@ -1,207 +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.Diagnostics;
-using System.Threading;
-using Microsoft.Devices;
-using Microsoft.Phone.Controls;
-using WP7CordovaClassLib.Cordova.Commands;
-using System.Windows;
-
-namespace WP7CordovaClassLib.Cordova
-{
-    /// <summary>
-    /// Implements logic to execute native command and return result back.
-    /// All commands are executed asynchronous.
-    /// </summary>
-    public class NativeExecution
-    {
-        /// <summary>
-        /// Reference to web part where application is hosted
-        /// </summary>
-        private readonly WebBrowser webBrowser;
-
-        /// <summary>
-        /// Creates new instance of a NativeExecution class. 
-        /// </summary>
-        /// <param name="browser">Reference to web part where application is hosted</param>
-        public NativeExecution(ref WebBrowser browser)
-        {
-            if (browser == null)
-            {
-                throw new ArgumentNullException("browser");
-            }
-
-            this.webBrowser = browser;
-        }
-
-        /// <summary>
-        /// Returns where application is running on emulator
-        /// </summary>
-        /// <returns>True if running on emulator, otherwise False</returns>
-        public static bool IsRunningOnEmulator()
-        {
-            return Microsoft.Devices.Environment.DeviceType == DeviceType.Emulator;
-        }
-
-        /// <summary>
-        /// Executes command and returns result back.
-        /// </summary>
-        /// <param name="commandCallParams">Command to execute</param>
-        public void ProcessCommand(CordovaCommandCall commandCallParams)
-        {
-
-            if (commandCallParams == null)
-            {
-                throw new ArgumentNullException("commandCallParams");
-            }
-
-            try
-            {
-                BaseCommand bc = CommandFactory.CreateByServiceName(commandCallParams.Service);
-
-                if (bc == null)
-                {
-                    this.OnCommandResult(commandCallParams.CallbackId, new PluginResult(PluginResult.Status.CLASS_NOT_FOUND_EXCEPTION));
-                    return;
-                }
-
-                EventHandler<PluginResult> OnCommandResultHandler = delegate(object o, PluginResult res)
-                {
-                    this.OnCommandResult(commandCallParams.CallbackId, res);
-                };
-
-                bc.OnCommandResult += OnCommandResultHandler;
-
-                EventHandler<ScriptCallback> OnCustomScriptHandler = delegate(object o, ScriptCallback script)
-                {
-                    this.InvokeScriptCallback(script);
-                };
-
-
-                bc.OnCustomScript += OnCustomScriptHandler;
-
-                // TODO: alternative way is using thread pool (ThreadPool.QueueUserWorkItem) instead of 
-                // new thread for every command call; but num threads are not sufficient - 2 threads per CPU core
-
-                Thread thread = new Thread(func =>
-                {
-                    try
-                    {
-                        bc.InvokeMethodNamed(commandCallParams.Action, commandCallParams.Args);
-                    }
-                    catch (Exception ex)
-                    {
-                        Debug.WriteLine("ERROR: Exception in ProcessCommand :: " + ex.Message);
-                        bc.OnCommandResult -= OnCommandResultHandler;
-                        bc.OnCustomScript -= OnCustomScriptHandler;
-
-                        Debug.WriteLine("ERROR: failed to InvokeMethodNamed :: " + commandCallParams.Action + " on Object :: " + commandCallParams.Service);
-
-                        this.OnCommandResult(commandCallParams.CallbackId, new PluginResult(PluginResult.Status.INVALID_ACTION));
-
-                        return;
-                    }
-                });
-
-                thread.Start();
-            }
-            catch (Exception ex)
-            {
-                // ERROR
-                Debug.WriteLine(String.Format("ERROR: Unable to execute command :: {0}:{1}:{3} ", 
-                    commandCallParams.Service, commandCallParams.Action, ex.Message));
-
-                this.OnCommandResult(commandCallParams.CallbackId, new PluginResult(PluginResult.Status.ERROR));
-                return;
-            }
-        }
-
-        /// <summary>
-        /// Handles command execution result.
-        /// </summary>
-        /// <param name="callbackId">Command callback identifier on client side</param>
-        /// <param name="result">Execution result</param>
-        private void OnCommandResult(string callbackId, PluginResult result)
-        {
-            #region  args checking
-            
-            if (result == null)
-            {
-                Debug.WriteLine("ERROR: OnCommandResult missing result argument");
-                return;
-            }
-
-            if (String.IsNullOrEmpty(callbackId))
-            {
-                Debug.WriteLine("ERROR: OnCommandResult missing callbackId argument");
-                return;
-            }
-
-            #endregion
-
-            string status = ((int)result.Result).ToString();
-            string jsonResult = result.ToJSONString();
-
-            ScriptCallback scriptCallback = null;
-
-            if (String.IsNullOrEmpty(result.Cast))
-            {
-                scriptCallback = new ScriptCallback("CordovaCommandResult", new string[] { status, callbackId, jsonResult });
-            }
-            else
-            {
-                scriptCallback = new ScriptCallback("CordovaCommandResult", new string[] { status, callbackId, jsonResult, result.Cast });
-            }
-
-            this.InvokeScriptCallback(scriptCallback);
-
-        }
-
-        /// <summary>
-        /// Executes client java script
-        /// </summary>
-        /// <param name="script">Script to execute on client side</param>
-        private void InvokeScriptCallback(ScriptCallback script)
-        {
-            if (script == null)
-            {
-                throw new ArgumentNullException("script");
-            }
-
-            if (String.IsNullOrEmpty(script.ScriptName))
-            {
-                throw new ArgumentNullException("ScriptName");
-            }
-
-            //Debug.WriteLine("INFO:: About to invoke ::" + script.ScriptName + " with args ::" + script.Args[0]);
-            this.webBrowser.Dispatcher.BeginInvoke((ThreadStart)delegate()
-            {
-
-                try
-                {
-                    //Debug.WriteLine("INFO:: InvokingScript::" + script.ScriptName + " with args ::" + script.Args[0]);
-                    this.webBrowser.InvokeScript(script.ScriptName, script.Args);
-                }
-                catch (Exception ex)
-                {
-                    Debug.WriteLine("ERROR: Exception in InvokeScriptCallback :: " + ex.Message);
-                }
-               
-            });
-        }
-
-    }
-}
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/incubator-cordova-wp7/blob/62d32605/framework/Cordova/OrientationHelper.cs
----------------------------------------------------------------------
diff --git a/framework/Cordova/OrientationHelper.cs b/framework/Cordova/OrientationHelper.cs
deleted file mode 100644
index 696fbad..0000000
--- a/framework/Cordova/OrientationHelper.cs
+++ /dev/null
@@ -1,128 +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.Controls;
-
-namespace WP7CordovaClassLib.Cordova
-{
-    public class OrientationHelper
-    {
-        protected WebBrowser gapBrowser;
-        protected PhoneApplicationPage page;
-       // private PageOrientation CurrentOrientation = PageOrientation.PortraitUp;
-        //private PageOrientation[] SupportedOrientations; // TODO:
-
-        public OrientationHelper(WebBrowser gapBrowser, PhoneApplicationPage gapPage)
-        {
-            this.gapBrowser = gapBrowser;
-            page = gapPage;
-
-            page.OrientationChanged += new EventHandler<OrientationChangedEventArgs>(page_OrientationChanged);
-            gapBrowser.LoadCompleted += new System.Windows.Navigation.LoadCompletedEventHandler(gapBrowser_LoadCompleted);
-
-
-        }
-
-        void gapBrowser_LoadCompleted(object sender, System.Windows.Navigation.NavigationEventArgs e)
-        {
-            int i = 0;
-
-            switch (this.page.Orientation)
-            {
-                case PageOrientation.Portrait: // intentional fall through
-                case PageOrientation.PortraitUp:
-                    i = 0;
-                    break;
-                case PageOrientation.PortraitDown:
-                    i = 180;
-                    break;
-                case PageOrientation.Landscape: // intentional fall through
-                case PageOrientation.LandscapeLeft:
-                    i = -90;
-                    break;
-                case PageOrientation.LandscapeRight:
-                    i = 90;
-                    break;
-            }
-            // Cordova.fireEvent('orientationchange', window);
-            string jsCallback = String.Format("window.orientation = {0};", i);
-
-            try
-            {
-                gapBrowser.InvokeScript("execScript", jsCallback);
-            }
-            catch(Exception)
-            {
-            }
-        }
-
-        void page_OrientationChanged(object sender, OrientationChangedEventArgs e)
-        {
-            int i = 0;
-
-            switch (e.Orientation)
-            {
-                case PageOrientation.Portrait: // intentional fall through
-                case PageOrientation.PortraitUp:
-                    i = 0;
-                    break;
-                case PageOrientation.PortraitDown:
-                    i = 180;
-                    break;
-                case PageOrientation.Landscape: // intentional fall through
-                case PageOrientation.LandscapeLeft:
-                    i = -90;
-                    break;
-                case PageOrientation.LandscapeRight:
-                    i = 90;
-                    break;
-            }
-            // Cordova.fireEvent('orientationchange', window);
-            string jsCallback = String.Format("window.orientation = {0};", i);
-
-            try
-            {
-                
-                gapBrowser.InvokeScript("execScript", jsCallback);
-
-                jsCallback = "var evt = document.createEvent('HTMLEvents');";
-                jsCallback += "evt.initEvent( 'orientationchange', true, false );";
-                jsCallback += "window.dispatchEvent(evt);";
-                jsCallback += "if(window.onorientationchange){window.onorientationchange(evt);}";
-
-                gapBrowser.InvokeScript("execScript", jsCallback);
-            }
-            catch (Exception)
-            {
-            }
-        }
-
-        public void HandleCommand(string commandStr)
-        {
-
-        }
-    }
-
-
-}

http://git-wip-us.apache.org/repos/asf/incubator-cordova-wp7/blob/62d32605/framework/Cordova/PluginResult.cs
----------------------------------------------------------------------
diff --git a/framework/Cordova/PluginResult.cs b/framework/Cordova/PluginResult.cs
deleted file mode 100644
index 85f02e8..0000000
--- a/framework/Cordova/PluginResult.cs
+++ /dev/null
@@ -1,165 +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 System.Text;
-using System.Diagnostics;
-
-namespace WP7CordovaClassLib.Cordova
-{
-	/// <summary>
-	/// Represents command execution result
-	/// </summary>
-	public class PluginResult : EventArgs
-	{
-		/// <summary>
-		/// Predefined resultant messages
-		/// </summary>
-		public static string[] StatusMessages = new string[] 
-		{
-			"No result",
-			"OK",
-			"Class not found",
-			"Illegal access",
-			"Instantiation error",
-			"Malformed url",
-			"IO error",
-			"Invalid action",
-			"JSON error",
-			"Error"
-		};
-
-		/// <summary>
-		/// Possible command results status codes
-		/// </summary>
-		public enum Status :int
-		{
-			NO_RESULT = 0,
-			OK,
-			CLASS_NOT_FOUND_EXCEPTION,
-			ILLEGAL_ACCESS_EXCEPTION,
-			INSTANTIATION_EXCEPTION,
-			MALFORMED_URL_EXCEPTION,
-			IO_EXCEPTION,
-			INVALID_ACTION,
-			JSON_EXCEPTION,
-			ERROR
-		};
-
-		public Status Result {get; private set;}
-		public string Message {get; set;}
-		public String Cast { get; private set; }
-
-		public bool KeepCallback { get; set; }        
-
-		/// <summary>
-		/// Whether command succeded or not
-		/// </summary>
-		public bool IsSuccess
-		{
-			get
-			{
-				return this.Result == Status.OK || this.Result == Status.NO_RESULT;
-			}
-		}
-
-		/// <summary>
-		/// Creates new instance of the PluginResult class.
-		/// </summary>
-		/// <param name="status">Execution result</param>
-		public PluginResult(Status status)
-			: this(status, PluginResult.StatusMessages[(int)status])
-		{
-		}
-
-		/// <summary>
-		/// Creates new instance of the PluginResult class.
-		/// </summary>
-		/// <param name="status">Execution result</param>
-		/// <param name="message">The message</param>
-		public PluginResult(Status status, object message)
-		{
-            this.Result = status;
-            this.Message = JSON.JsonHelper.Serialize(message);
-		}
-
-		/// <summary>
-		/// Creates new instance of the PluginResult class.
-		/// </summary>
-		/// <param name="status">Execution result</param>
-		/// <param name="message">The message</param>
-		/// <param name="cast">The cast parameter</param>
-        /// 
-        [Obsolete("Don't use Cast!!", false)]
-		public PluginResult(Status status, object message, string cast)
-		{
-			this.Result = status;
-			this.Message = JSON.JsonHelper.Serialize(message);
-			this.Cast = cast;
-		}
-
-		public string ToJSONString()
-		{
-            string res = String.Format("\"status\":{0},\"message\":{1},\"keepCallback\":{2}", 
-                (int)this.Result, 
-                this.Message, 
-                this.KeepCallback.ToString().ToLower() );
-
-            res = "{" + res + "}";
-            return res;
-
-		}
-
-		public string ToCallbackString(string callbackId, string successCallback, string errorCallback)
-		{
-			//return String.Format("{0}('{1}',{2});", successCallback, callbackId, this.ToJSONString());
-
-			if (this.IsSuccess)
-			{
-				StringBuilder buf = new StringBuilder("");
-				if (this.Cast != null)
-				{
-                    Debug.WriteLine(callbackId + "this.Cast = " + this.Cast);
-					buf.Append("var temp = " + this.Cast + "(" + this.ToJSONString() + ");\n");
-					buf.Append(String.Format("{0}('{1}',temp);", successCallback, callbackId));
-				}
-				else
-				{
-					buf.Append(String.Format("{0}('{1}',{2});", successCallback, callbackId, this.ToJSONString()));
-				}
-				return buf.ToString();
-			}
-			else
-			{
-				return String.Format("{0}('{1}',{2});", errorCallback, callbackId, this.ToJSONString());
-			}
-		}
-
-		public override String ToString()
-		{
-			return this.ToJSONString();
-		}
-
-	}
-	
-}

http://git-wip-us.apache.org/repos/asf/incubator-cordova-wp7/blob/62d32605/framework/Cordova/ScriptCallback.cs
----------------------------------------------------------------------
diff --git a/framework/Cordova/ScriptCallback.cs b/framework/Cordova/ScriptCallback.cs
deleted file mode 100644
index b42880a..0000000
--- a/framework/Cordova/ScriptCallback.cs
+++ /dev/null
@@ -1,80 +0,0 @@
-/*
- Licensed to the Apache Software Foundation (ASF) under one
- or more contributor license agreements.  See the NOTICE file
- distributed with this work for additional information
- regarding copyright ownership.  The ASF licenses this file
- to you 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 WP7CordovaClassLib.Cordova.JSON;
-using System.Diagnostics;
-
-namespace WP7CordovaClassLib.Cordova
-{
-    /// <summary>
-    /// Represents client script function to execute
-    /// </summary>
-    public class ScriptCallback : EventArgs
-    {
-        /// <summary>
-        /// The scripting function to execute.
-        /// </summary>
-        public string ScriptName { get; private set; }
-
-        /// <summary>
-        /// A variable number of strings to pass to the function as parameters.
-        /// </summary>
-        public string[] Args { get; private set; }
-
-        /// <summary>
-        /// Creates new instance of a ScriptCallback class.
-        /// </summary>
-        /// <param name="function">The scripting function to execute</param>
-        /// <param name="args">A variable number of strings to pass to the function as parameters</param>
-        public ScriptCallback(string function, string[] args)
-        {
-            this.ScriptName = function;
-            this.Args = args;
-        }
-
-        /// <summary>
-        /// Creates new instance of a ScriptCallback class.
-        /// </summary>
-        /// <param name="function">The scripting function to execute</param>
-        /// <param name="id">The id argument</param>
-        /// <param name="msg">The message argument</param>
-        /// <param name="value">The value argument</param>
-        public ScriptCallback(string function, string id, object msg, object value)
-        {
-            this.ScriptName = function;
-
-            String arg = String.Format("{{\"id\": {0}, \"msg\": {1}, \"value\": {2}}}",
-                 JsonHelper.Serialize(id), JsonHelper.Serialize(msg), JsonHelper.Serialize(value));
-
-            this.Args = new string[] { arg };
-        }
-
-        
-    }
-}

http://git-wip-us.apache.org/repos/asf/incubator-cordova-wp7/blob/62d32605/framework/Cordova/UI/AudioCaptureTask.cs
----------------------------------------------------------------------
diff --git a/framework/Cordova/UI/AudioCaptureTask.cs b/framework/Cordova/UI/AudioCaptureTask.cs
deleted file mode 100644
index c65720f..0000000
--- a/framework/Cordova/UI/AudioCaptureTask.cs
+++ /dev/null
@@ -1,105 +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.IO;
-using System.Windows;
-using Microsoft.Phone.Controls;
-using Microsoft.Phone.Tasks;
-
-namespace WP7CordovaClassLib.Cordova.UI
-{
-    /// <summary>
-    /// Allows an application to launch the Audio Recording application. 
-    /// Use this to allow users to record audio from your application.
-    /// </summary>
-    public class AudioCaptureTask
-    {
-        /// <summary>
-        /// Represents recorded audio returned from a call to the Show method of
-        /// a WP7CordovaClassLib.Cordova.Controls.AudioCaptureTask 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/AudioRecorder.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) 
-        {
-            if (!(e.Content is AudioRecorder)) return;
-
-            (Application.Current.RootVisual as PhoneApplicationFrame).Navigated -= NavigationService_Navigated;
-
-            AudioRecorder audioRecorder = (AudioRecorder)e.Content;
-
-            if (audioRecorder != null)
-            {
-                audioRecorder.Completed += this.Completed;
-            }
-            else if (this.Completed != null)
-            {
-                this.Completed(this, new AudioResult(TaskResult.Cancel));
-            }
-        }
-    }
-}

http://git-wip-us.apache.org/repos/asf/incubator-cordova-wp7/blob/62d32605/framework/Cordova/UI/AudioRecorder.xaml
----------------------------------------------------------------------
diff --git a/framework/Cordova/UI/AudioRecorder.xaml b/framework/Cordova/UI/AudioRecorder.xaml
deleted file mode 100644
index 7bbea6b..0000000
--- a/framework/Cordova/UI/AudioRecorder.xaml
+++ /dev/null
@@ -1,66 +0,0 @@
-<!--
- Licensed to the Apache Software Foundation (ASF) under one
- or more contributor license agreements.  See the NOTICE file
- distributed with this work for additional information
- regarding copyright ownership.  The ASF licenses this file
- to you 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. 
--->
-<phone:PhoneApplicationPage 
-    x:Class="WP7CordovaClassLib.Cordova.UI.AudioRecorder"
-    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="Portrait" 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="Transparent">
-        <Grid.RowDefinitions>
-            <RowDefinition Height="Auto"/>
-            <RowDefinition Height="*"/>
-        </Grid.RowDefinitions>
-
-        <!--TitlePanel contains the name of the application and page title-->
-        <StackPanel x:Name="TitlePanel" Grid.Row="0" Margin="0,17,0,28">
-            <TextBlock x:Name="PageTitle" Text="Audio recorder" Margin="9,-7,0,0" Style="{StaticResource PhoneTextTitle1Style}"/>
-        </StackPanel>
-
-        <!--ContentPanel - place additional content here-->
-        <Grid x:Name="ContentPanel" Grid.Row="1" Margin="12,0,12,0">
-            <Button Name="btnStartStop" Content="Start" Height="72" HorizontalAlignment="Left" Margin="156,96,0,0"  VerticalAlignment="Top" Width="160" Click="btnStartStop_Click" />
-            <Button Name="btnTake" Content="Take" IsEnabled="False" Height="72" HorizontalAlignment="Left" Margin="155,182,0,0" VerticalAlignment="Top" Width="160" Click="btnTake_Click" />
-            <TextBlock Height="30" HorizontalAlignment="Left" Margin="168,60,0,0" Name="txtDuration" Text="Duration: 00:00" VerticalAlignment="Top" />
-        </Grid>
-    </Grid>
- 
-    <!--Sample code showing usage of ApplicationBar-->
-    <!--<phone:PhoneApplicationPage.ApplicationBar>
-        <shell:ApplicationBar IsVisible="True" IsMenuEnabled="True">
-            <shell:ApplicationBarIconButton IconUri="/Images/appbar_button1.png" Text="Button 1"/>
-            <shell:ApplicationBarIconButton IconUri="/Images/appbar_button2.png" Text="Button 2"/>
-            <shell:ApplicationBar.MenuItems>
-                <shell:ApplicationBarMenuItem Text="MenuItem 1"/>
-                <shell:ApplicationBarMenuItem Text="MenuItem 2"/>
-            </shell:ApplicationBar.MenuItems>
-        </shell:ApplicationBar>
-    </phone:PhoneApplicationPage.ApplicationBar>-->
-
-</phone:PhoneApplicationPage>


Mime
View raw message