diff --git a/.DS_Store b/.DS_Store new file mode 100644 index 0000000..6cc3e15 Binary files /dev/null and b/.DS_Store differ diff --git a/Ajapaik.sln b/Ajapaik.sln new file mode 100755 index 0000000..e2d3e80 --- /dev/null +++ b/Ajapaik.sln @@ -0,0 +1,22 @@ + +Microsoft Visual Studio Solution File, Format Version 11.00 +# Visual Studio 2010 Express for Windows Phone +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Ajapaik", "Ajapaik\Ajapaik.csproj", "{3CFB20AD-8C75-43E4-A753-9A1BFB8EC103}" +EndProject +Global + GlobalSection(SolutionConfigurationPlatforms) = preSolution + Debug|Any CPU = Debug|Any CPU + Release|Any CPU = Release|Any CPU + EndGlobalSection + GlobalSection(ProjectConfigurationPlatforms) = postSolution + {3CFB20AD-8C75-43E4-A753-9A1BFB8EC103}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {3CFB20AD-8C75-43E4-A753-9A1BFB8EC103}.Debug|Any CPU.Build.0 = Debug|Any CPU + {3CFB20AD-8C75-43E4-A753-9A1BFB8EC103}.Debug|Any CPU.Deploy.0 = Debug|Any CPU + {3CFB20AD-8C75-43E4-A753-9A1BFB8EC103}.Release|Any CPU.ActiveCfg = Release|Any CPU + {3CFB20AD-8C75-43E4-A753-9A1BFB8EC103}.Release|Any CPU.Build.0 = Release|Any CPU + {3CFB20AD-8C75-43E4-A753-9A1BFB8EC103}.Release|Any CPU.Deploy.0 = Release|Any CPU + EndGlobalSection + GlobalSection(SolutionProperties) = preSolution + HideSolutionNode = FALSE + EndGlobalSection +EndGlobal diff --git a/Ajapaik/.DS_Store b/Ajapaik/.DS_Store new file mode 100644 index 0000000..a7be8c7 Binary files /dev/null and b/Ajapaik/.DS_Store differ diff --git a/Ajapaik/Ajapaik.csproj b/Ajapaik/Ajapaik.csproj new file mode 100755 index 0000000..02d1577 --- /dev/null +++ b/Ajapaik/Ajapaik.csproj @@ -0,0 +1,189 @@ + + + + Debug + AnyCPU + 10.0.20506 + 2.0 + {3CFB20AD-8C75-43E4-A753-9A1BFB8EC103} + {C089C8C0-30E0-4E22-80C0-CE093F111A43};{fae04ec0-301f-11d3-bf4b-00c04f79efbc} + Library + Properties + Ajapaik + Ajapaik + v4.0 + $(TargetFrameworkVersion) + WindowsPhone71 + Silverlight + true + + + true + true + Ajapaik.xap + Properties\AppManifest.xml + Ajapaik.App + true + true + + + true + full + false + Bin\Debug + DEBUG;TRACE;SILVERLIGHT;WINDOWS_PHONE + true + true + prompt + 4 + + + pdbonly + true + Bin\Release + TRACE;SILVERLIGHT;WINDOWS_PHONE + true + true + prompt + 4 + + + + .\Coding4Fun.Phone.Controls.dll + + + .\Coding4Fun.Phone.Controls.Toolkit.dll + + + .\ExifLib.dll + + + .\Hammock.WindowsPhone.Mango.dll + + + .\ICSharpCode.SharpZipLib.WindowsPhone.dll + + + + + False + .\Microsoft.Phone.Controls.Toolkit.dll + + + + + + + + + + + + + + + + + App.xaml + + + + + + MainPage.xaml + + + + + + + + AcceptPhotoView.xaml + + + CameraWithOverlay.xaml + + + PhotoInfoView.xaml + + + PhotoListView.xaml + + + + + Designer + MSBuild:Compile + + + Designer + MSBuild:Compile + + + Designer + MSBuild:Compile + + + Designer + MSBuild:Compile + + + Designer + MSBuild:Compile + + + Designer + MSBuild:Compile + + + + + + + + + PreserveNewest + + + PreserveNewest + + + Always + + + Always + + + Always + + + Always + + + Always + + + Always + + + Always + + + Always + + + Always + + + + + + + + \ No newline at end of file diff --git a/Ajapaik/Ajapaik.csproj.user b/Ajapaik/Ajapaik.csproj.user new file mode 100755 index 0000000..394572e --- /dev/null +++ b/Ajapaik/Ajapaik.csproj.user @@ -0,0 +1,15 @@ + + + + ShowAllFiles + + + + + + False + + + + + \ No newline at end of file diff --git a/Ajapaik/App.xaml b/Ajapaik/App.xaml new file mode 100755 index 0000000..003cc0d --- /dev/null +++ b/Ajapaik/App.xaml @@ -0,0 +1,19 @@ + + + + + + + + + + + + \ No newline at end of file diff --git a/Ajapaik/App.xaml.cs b/Ajapaik/App.xaml.cs new file mode 100755 index 0000000..7a232fa --- /dev/null +++ b/Ajapaik/App.xaml.cs @@ -0,0 +1,161 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Net; +using System.Windows; +using System.Windows.Controls; +using System.Windows.Documents; +using System.Windows.Input; +using System.Windows.Media; +using System.Windows.Media.Animation; +using System.Windows.Navigation; +using System.Windows.Shapes; +using Microsoft.Phone.Controls; +using Microsoft.Phone.Shell; + +namespace Ajapaik +{ + public partial class App : Application + { + private static Settings settings = null; + + /// + /// Sptnik config settings. + /// + /// Sptnik settings. + public static Settings Settings + { + get + { + // Delay creation of the view model until necessary + if (settings == null) + { + settings = new Settings(); + } + return settings; + } + } + + /// + /// Provides easy access to the root frame of the Phone Application. + /// + /// The root frame of the Phone Application. + public PhoneApplicationFrame RootFrame { get; private set; } + + /// + /// Constructor for the Application object. + /// + public App() + { + // Global handler for uncaught exceptions. + UnhandledException += Application_UnhandledException; + + // Standard Silverlight initialization + InitializeComponent(); + + // Phone-specific initialization + InitializePhoneApplication(); + + // Show graphics profiling information while debugging. + if (System.Diagnostics.Debugger.IsAttached) + { + // Display the current frame rate counters. + Application.Current.Host.Settings.EnableFrameRateCounter = true; + + // Show the areas of the app that are being redrawn in each frame. + //Application.Current.Host.Settings.EnableRedrawRegions = true; + + // Enable non-production analysis visualization mode, + // which shows areas of a page that are handed off to GPU with a colored overlay. + //Application.Current.Host.Settings.EnableCacheVisualization = true; + + // Disable the application idle detection by setting the UserIdleDetectionMode property of the + // application's PhoneApplicationService object to Disabled. + // Caution:- Use this under debug mode only. Application that disables user idle detection will continue to run + // and consume battery power when the user is not using the phone. + PhoneApplicationService.Current.UserIdleDetectionMode = IdleDetectionMode.Disabled; + } + + } + + // Code to execute when the application is launching (eg, from Start) + // This code will not execute when the application is reactivated + private void Application_Launching(object sender, LaunchingEventArgs e) + { + } + + // Code to execute when the application is activated (brought to foreground) + // This code will not execute when the application is first launched + private void Application_Activated(object sender, ActivatedEventArgs e) + { + } + + // Code to execute when the application is deactivated (sent to background) + // This code will not execute when the application is closing + private void Application_Deactivated(object sender, DeactivatedEventArgs e) + { + } + + // Code to execute when the application is closing (eg, user hit Back) + // This code will not execute when the application is deactivated + private void Application_Closing(object sender, ClosingEventArgs e) + { + } + + // Code to execute if a navigation fails + private void RootFrame_NavigationFailed(object sender, NavigationFailedEventArgs e) + { + if (System.Diagnostics.Debugger.IsAttached) + { + // A navigation has failed; break into the debugger + System.Diagnostics.Debugger.Break(); + } + } + + // Code to execute on Unhandled Exceptions + private void Application_UnhandledException(object sender, ApplicationUnhandledExceptionEventArgs e) + { + if (System.Diagnostics.Debugger.IsAttached) + { + // An unhandled exception has occurred; break into the debugger + System.Diagnostics.Debugger.Break(); + } + } + + #region Phone application initialization + + // Avoid double-initialization + private bool phoneApplicationInitialized = false; + + // Do not add any additional code to this method + private void InitializePhoneApplication() + { + if (phoneApplicationInitialized) + return; + + // Create the frame but don't set it as RootVisual yet; this allows the splash + // screen to remain active until the application is ready to render. + RootFrame = new PhoneApplicationFrame(); + RootFrame.Navigated += CompleteInitializePhoneApplication; + + // Handle navigation failures + RootFrame.NavigationFailed += RootFrame_NavigationFailed; + + // Ensure we don't initialize again + phoneApplicationInitialized = true; + } + + // Do not add any additional code to this method + private void CompleteInitializePhoneApplication(object sender, NavigationEventArgs e) + { + // Set the root visual to allow the application to render + if (RootVisual != RootFrame) + RootVisual = RootFrame; + + // Remove this handler since it is no longer needed + RootFrame.Navigated -= CompleteInitializePhoneApplication; + } + + #endregion + } +} \ No newline at end of file diff --git a/Ajapaik/ApplicationIcon.png b/Ajapaik/ApplicationIcon.png new file mode 100755 index 0000000..ce2989b Binary files /dev/null and b/Ajapaik/ApplicationIcon.png differ diff --git a/Ajapaik/Background.png b/Ajapaik/Background.png new file mode 100755 index 0000000..63d7172 Binary files /dev/null and b/Ajapaik/Background.png differ diff --git a/Ajapaik/Coding4Fun.Phone.Controls.Toolkit.dll b/Ajapaik/Coding4Fun.Phone.Controls.Toolkit.dll new file mode 100755 index 0000000..5d8def0 Binary files /dev/null and b/Ajapaik/Coding4Fun.Phone.Controls.Toolkit.dll differ diff --git a/Ajapaik/Coding4Fun.Phone.Controls.dll b/Ajapaik/Coding4Fun.Phone.Controls.dll new file mode 100755 index 0000000..68b91d8 Binary files /dev/null and b/Ajapaik/Coding4Fun.Phone.Controls.dll differ diff --git a/Ajapaik/ExifLib.dll b/Ajapaik/ExifLib.dll new file mode 100755 index 0000000..bf50f52 Binary files /dev/null and b/Ajapaik/ExifLib.dll differ diff --git a/Ajapaik/Hammock.WindowsPhone.Mango.dll b/Ajapaik/Hammock.WindowsPhone.Mango.dll new file mode 100755 index 0000000..bfe5c70 Binary files /dev/null and b/Ajapaik/Hammock.WindowsPhone.Mango.dll differ diff --git a/Ajapaik/Hammock.WindowsPhone.Mango.pdb b/Ajapaik/Hammock.WindowsPhone.Mango.pdb new file mode 100755 index 0000000..a30e7f1 Binary files /dev/null and b/Ajapaik/Hammock.WindowsPhone.Mango.pdb differ diff --git a/Ajapaik/Helpers/BooleanToVisibilityConverter.cs b/Ajapaik/Helpers/BooleanToVisibilityConverter.cs new file mode 100755 index 0000000..b64edae --- /dev/null +++ b/Ajapaik/Helpers/BooleanToVisibilityConverter.cs @@ -0,0 +1,41 @@ +using System; +using System.Globalization; +using System.Windows; +using System.Windows.Data; + +namespace Ajapaik.Helpers +{ + /// + /// Converts a boolean value to a value, + /// and vice versa. + /// + public class BooleanToVisibilityConverter : IValueConverter + { + public object Convert(object value, Type targetType, + object parameter, CultureInfo culture) + { + string paramValue = (string)parameter; + + if (value == null || (bool)value) + { + return paramValue == "Collapsed" + ? Visibility.Collapsed : Visibility.Visible; + } + + return paramValue == "Collapsed" + ? Visibility.Visible : Visibility.Collapsed; + } + + public object ConvertBack(object value, Type targetType, + object parameter, CultureInfo culture) + { + string paramValue = (string)parameter; + if (value == null || (Visibility)value == Visibility.Visible) + { + return paramValue != "Collapsed"; + } + + return paramValue == "Collapsed"; + } + } +} \ No newline at end of file diff --git a/Ajapaik/Helpers/JsonSerializer.cs b/Ajapaik/Helpers/JsonSerializer.cs new file mode 100755 index 0000000..1702252 --- /dev/null +++ b/Ajapaik/Helpers/JsonSerializer.cs @@ -0,0 +1,42 @@ +using System.IO; +using System.Runtime.Serialization.Json; + +namespace Ajapaik.Helpers +{ + public class JsonSerializer + { + public static string Serialize(T instance) where T : class + { + var serializer = new DataContractJsonSerializer(typeof(T)); + using (var memoryStream = new MemoryStream()) + { + serializer.WriteObject(memoryStream, instance); + + memoryStream.Flush(); + memoryStream.Position = 0; + + using (var reader = new StreamReader(memoryStream)) + { + return reader.ReadToEnd(); + } + } + } + + public static T Deserialize(string serialized) where T : class + { + var serializer = new DataContractJsonSerializer(typeof(T)); + using (var memoryStream = new MemoryStream()) + { + using (var writer = new StreamWriter(memoryStream)) + { + writer.Write(serialized); + writer.Flush(); + + memoryStream.Position = 0; + + return serializer.ReadObject(memoryStream) as T; + } + } + } + } +} \ No newline at end of file diff --git a/Ajapaik/Helpers/Multipart.cs b/Ajapaik/Helpers/Multipart.cs new file mode 100755 index 0000000..bca7b73 --- /dev/null +++ b/Ajapaik/Helpers/Multipart.cs @@ -0,0 +1,107 @@ +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.Collections.Generic; +using System.IO; + +namespace Ajapaik.Helpers +{ + public class PostSubmitter + { + public string url { get; set; } + public Dictionary parameters { get; set; } + string boundary = "----------" + DateTime.Now.Ticks.ToString(); + public event EventHandler theEvent; + + public PostSubmitter() { } + + public void Submit() + { + // Prepare web request... + HttpWebRequest myRequest = (HttpWebRequest)WebRequest.Create(new Uri(url)); + myRequest.Method = "POST"; + myRequest.ContentType = string.Format("multipart/form-data; boundary={0}", boundary); + + myRequest.BeginGetRequestStream(new AsyncCallback(GetRequestStreamCallback), myRequest); + } + + private void GetRequestStreamCallback(IAsyncResult asynchronousResult) + { + HttpWebRequest request = (HttpWebRequest)asynchronousResult.AsyncState; + Stream postStream = request.EndGetRequestStream(asynchronousResult); + + writeMultipartObject(postStream, parameters); + postStream.Close(); + + request.BeginGetResponse(new AsyncCallback(GetResponseCallback), request); + } + + private void GetResponseCallback(IAsyncResult asynchronousResult) + { + HttpWebRequest request = (HttpWebRequest)asynchronousResult.AsyncState; + HttpWebResponse response = (HttpWebResponse)request.EndGetResponse(asynchronousResult); + Stream streamResponse = response.GetResponseStream(); + StreamReader streamRead = new StreamReader(streamResponse); + streamResponse.Close(); + streamRead.Close(); + // Release the HttpWebResponse + response.Close(); + theEvent.Invoke(this, null); + } + + + public void writeMultipartObject(Stream stream, object data) + { + StreamWriter writer = new StreamWriter(stream); + if (data != null) + { + foreach (var entry in data as Dictionary) + { + WriteEntry(writer, entry.Key, entry.Value); + } + } + writer.Write("--"); + writer.Write(boundary); + writer.WriteLine("--"); + writer.Flush(); + } + + private void WriteEntry(StreamWriter writer, string key, object value) + { + if (value != null) + { + writer.Write("--"); + writer.WriteLine(boundary); + if (value is byte[]) + { + byte[] ba = value as byte[]; + + writer.WriteLine(@"Content-Disposition: form-data; name=""{0}""; filename=""{1}""", key, "sentPhoto.jpg"); + writer.WriteLine(@"Content-Type: application/octet-stream"); + //writer.WriteLine(@"Content-Type: image / jpeg"); + writer.WriteLine(@"Content-Length: " + ba.Length); + writer.WriteLine(); + writer.Flush(); + Stream output = writer.BaseStream; + + output.Write(ba, 0, ba.Length); + output.Flush(); + writer.WriteLine(); + } + else + { + writer.WriteLine(@"Content-Disposition: form-data; name=""{0}""", key); + writer.WriteLine(); + writer.WriteLine(value.ToString()); + } + } + } + } +} diff --git a/Ajapaik/ICSharpCode.SharpZipLib.WindowsPhone.dll b/Ajapaik/ICSharpCode.SharpZipLib.WindowsPhone.dll new file mode 100755 index 0000000..5a42b14 Binary files /dev/null and b/Ajapaik/ICSharpCode.SharpZipLib.WindowsPhone.dll differ diff --git a/Ajapaik/ICSharpCode.SharpZipLib.WindowsPhone.pdb b/Ajapaik/ICSharpCode.SharpZipLib.WindowsPhone.pdb new file mode 100755 index 0000000..7c1b6ed Binary files /dev/null and b/Ajapaik/ICSharpCode.SharpZipLib.WindowsPhone.pdb differ diff --git a/Ajapaik/Images/MapPin.png b/Ajapaik/Images/MapPin.png new file mode 100755 index 0000000..cd3be73 Binary files /dev/null and b/Ajapaik/Images/MapPin.png differ diff --git a/Ajapaik/Images/appbarCamera.png b/Ajapaik/Images/appbarCamera.png new file mode 100755 index 0000000..8c61a4e Binary files /dev/null and b/Ajapaik/Images/appbarCamera.png differ diff --git a/Ajapaik/Images/appbarCancel.png b/Ajapaik/Images/appbarCancel.png new file mode 100755 index 0000000..4dd724f Binary files /dev/null and b/Ajapaik/Images/appbarCancel.png differ diff --git a/Ajapaik/Images/appbarCheck.png b/Ajapaik/Images/appbarCheck.png new file mode 100755 index 0000000..7a07466 Binary files /dev/null and b/Ajapaik/Images/appbarCheck.png differ diff --git a/Ajapaik/Images/appbarLocation.png b/Ajapaik/Images/appbarLocation.png new file mode 100755 index 0000000..89e872e Binary files /dev/null and b/Ajapaik/Images/appbarLocation.png differ diff --git a/Ajapaik/Images/appbarNumberlist.png b/Ajapaik/Images/appbarNumberlist.png new file mode 100755 index 0000000..6e0cdd9 Binary files /dev/null and b/Ajapaik/Images/appbarNumberlist.png differ diff --git a/Ajapaik/Images/appbarPin.png b/Ajapaik/Images/appbarPin.png new file mode 100755 index 0000000..47d90e5 Binary files /dev/null and b/Ajapaik/Images/appbarPin.png differ diff --git a/Ajapaik/Images/iconCamera.png b/Ajapaik/Images/iconCamera.png new file mode 100755 index 0000000..e54fe71 Binary files /dev/null and b/Ajapaik/Images/iconCamera.png differ diff --git a/Ajapaik/MainPage.xaml b/Ajapaik/MainPage.xaml new file mode 100755 index 0000000..34c5eb9 --- /dev/null +++ b/Ajapaik/MainPage.xaml @@ -0,0 +1,104 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +