فهرست منبع

Merge branch 'developer' into MapView

jancoow 10 سال پیش
والد
کامیت
bf77e6b4a6

+ 10 - 1
Breda-Tour/Breda-Tour.csproj

@@ -94,11 +94,17 @@
       <CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
     </Content>
     <None Include="project.json" />
+    <Content Include="Storage\Routes\routes.json">
+      <CopyToOutputDirectory>Always</CopyToOutputDirectory>
+    </Content>
   </ItemGroup>
   <ItemGroup>
     <Compile Include="App.xaml.cs">
       <DependentUpon>App.xaml</DependentUpon>
     </Compile>
+    <Compile Include="Data\Route.cs" />
+    <Compile Include="Data\RouteDatabase.cs" />
+    <Compile Include="Data\Waypoint.cs" />
     <Compile Include="CustomControls\DefaultPivotControl.xaml.cs">
       <DependentUpon>DefaultPivotControl.xaml</DependentUpon>
     </Compile>
@@ -195,7 +201,10 @@
       <SubType>Designer</SubType>
     </Page>
   </ItemGroup>
-  <ItemGroup />
+  <ItemGroup>
+    <Folder Include="Controller\" />
+    <Folder Include="View\" />
+  </ItemGroup>
   <PropertyGroup Condition=" '$(VisualStudioVersion)' == '' or '$(VisualStudioVersion)' &lt; '14.0' ">
     <VisualStudioVersion>14.0</VisualStudioVersion>
   </PropertyGroup>

+ 17 - 0
Breda-Tour/Data/Route.cs

@@ -0,0 +1,17 @@
+using System;
+using System.Collections.Generic;
+
+namespace Breda_Tour.Data
+{
+    class Route
+    {
+        public String Title {  get; private set; }
+        public List<Waypoint> Waypoints { get; private set; }
+
+        public Route(String Title, List<Waypoint> Waypoints)
+        {
+            this.Title = Title;
+            this.Waypoints = Waypoints;
+        }
+    }
+}

+ 33 - 0
Breda-Tour/Data/RouteDatabase.cs

@@ -0,0 +1,33 @@
+using Newtonsoft.Json;
+using Newtonsoft.Json.Linq;
+using System.Collections.Generic;
+using System.IO;
+using System.Linq;
+using System.Threading.Tasks;
+
+namespace Breda_Tour.Data
+{
+    class RouteDatabase
+    {
+        private List<Route> Routes;
+        
+        public RouteDatabase()
+        {
+            Routes = new List<Route>();
+            readRoutes();
+        }
+
+        private void readRoutes()
+        {
+            Task.Run(() =>
+            {
+                string json = File.ReadAllText("Storage/Routes/routes.json");
+                JObject JsonObject = JObject.Parse(json);
+                IList<JToken> JsonList = JsonObject["Routes"].ToList();
+                foreach (JToken route in JsonList){
+                   Routes.Add(JsonConvert.DeserializeObject<Route>(route.ToString()));
+                }
+        });
+        }
+    }
+}

+ 39 - 0
Breda-Tour/Data/waypoint.cs

@@ -0,0 +1,39 @@
+using System;
+using System.Collections.Generic;
+using Windows.UI.Xaml.Media.Imaging;
+using Windows.UI.Core;
+using Windows.UI.Xaml.Controls;
+using Windows.Devices.Geolocation;
+
+namespace Breda_Tour.Data
+{
+    class Waypoint
+    {
+        public Geopoint Position { get; private set; }
+        public String Title { get; private set; }
+        public String Description { get; private set; }
+        public List<Image> Photos { get; private set; }
+
+        public Waypoint(float Lat, float Long, String Title, String Description, List<string> pictures)
+        {
+            this.Position = new Geopoint(new BasicGeoposition() { Altitude = 0, Latitude = Lat, Longitude = Long });
+            this.Title = Title;
+            this.Description = Description;
+            this.Photos = new List<Image>();
+            if (pictures != null)
+            {
+                Windows.ApplicationModel.Core.CoreApplication.MainView.CoreWindow.Dispatcher.RunAsync(CoreDispatcherPriority.Normal, () =>
+                {
+                    foreach (string source in pictures)
+                    {
+                        Photos.Add(new Image
+                        {
+                            Source = new BitmapImage(new Uri("file://Storages/images/" + source)),
+                            Name = source
+                        });
+                    }
+                });
+            }
+        }
+    }
+}

+ 2 - 1
Breda-Tour/MainPage.xaml.cs

@@ -1,4 +1,5 @@
-using System;
+using Breda_Tour.Data;
+using System;
 using System.Collections.Generic;
 using System.IO;
 using System.Linq;

BIN
Breda-Tour/Storage/images/1.jpg


BIN
Breda-Tour/Storage/images/10.jpg


BIN
Breda-Tour/Storage/images/11.jpg


BIN
Breda-Tour/Storage/images/12.jpg


BIN
Breda-Tour/Storage/images/13.jpg


BIN
Breda-Tour/Storage/images/14.jpg


BIN
Breda-Tour/Storage/images/15.jpg


BIN
Breda-Tour/Storage/images/16.jpg


BIN
Breda-Tour/Storage/images/17.jpg


BIN
Breda-Tour/Storage/images/18.jpg


BIN
Breda-Tour/Storage/images/19.jpg


BIN
Breda-Tour/Storage/images/2.jpg


BIN
Breda-Tour/Storage/images/20.jpg


BIN
Breda-Tour/Storage/images/21.jpg


BIN
Breda-Tour/Storage/images/22.jpg


BIN
Breda-Tour/Storage/images/23.jpg


BIN
Breda-Tour/Storage/images/24.jpg


BIN
Breda-Tour/Storage/images/25.jpg


BIN
Breda-Tour/Storage/images/26.jpg


BIN
Breda-Tour/Storage/images/3.jpg


BIN
Breda-Tour/Storage/images/4.jpg


BIN
Breda-Tour/Storage/images/5.jpg


BIN
Breda-Tour/Storage/images/6.jpg


BIN
Breda-Tour/Storage/images/7.jpg


BIN
Breda-Tour/Storage/images/8.jpg


BIN
Breda-Tour/Storage/images/9.jpg


تفاوت فایلی نمایش داده نمی شود زیرا این فایل بسیار بزرگ است
+ 133 - 0
Breda-Tour/Storage/routes/routes.json


+ 2 - 1
Breda-Tour/project.json

@@ -3,7 +3,8 @@
     "Microsoft.ApplicationInsights": "1.0.0",
     "Microsoft.ApplicationInsights.PersistenceChannel": "1.0.0",
     "Microsoft.ApplicationInsights.WindowsApps": "1.0.0",
-    "Microsoft.NETCore.UniversalWindowsPlatform": "5.0.0"
+    "Microsoft.NETCore.UniversalWindowsPlatform": "5.0.0",
+    "Newtonsoft.Json": "7.0.1"
   },
   "frameworks": {
     "uap10.0": {}

+ 82 - 2
Breda-Tour/project.lock.json

@@ -232,6 +232,14 @@
           "lib/dotnet/Microsoft.Win32.Primitives.dll": {}
         }
       },
+      "Newtonsoft.Json/7.0.1": {
+        "compile": {
+          "lib/portable-net45+wp80+win8+wpa81+dnxcore50/Newtonsoft.Json.dll": {}
+        },
+        "runtime": {
+          "lib/portable-net45+wp80+win8+wpa81+dnxcore50/Newtonsoft.Json.dll": {}
+        }
+      },
       "System.AppContext/4.0.0": {
         "dependencies": {
           "System.Collections": "[4.0.0, )",
@@ -1841,6 +1849,14 @@
           "lib/dotnet/Microsoft.Win32.Primitives.dll": {}
         }
       },
+      "Newtonsoft.Json/7.0.1": {
+        "compile": {
+          "lib/portable-net45+wp80+win8+wpa81+dnxcore50/Newtonsoft.Json.dll": {}
+        },
+        "runtime": {
+          "lib/portable-net45+wp80+win8+wpa81+dnxcore50/Newtonsoft.Json.dll": {}
+        }
+      },
       "System.AppContext/4.0.0": {
         "dependencies": {
           "System.Collections": "[4.0.0, )",
@@ -3483,6 +3499,14 @@
           "lib/dotnet/Microsoft.Win32.Primitives.dll": {}
         }
       },
+      "Newtonsoft.Json/7.0.1": {
+        "compile": {
+          "lib/portable-net45+wp80+win8+wpa81+dnxcore50/Newtonsoft.Json.dll": {}
+        },
+        "runtime": {
+          "lib/portable-net45+wp80+win8+wpa81+dnxcore50/Newtonsoft.Json.dll": {}
+        }
+      },
       "System.AppContext/4.0.0": {
         "dependencies": {
           "System.Collections": "[4.0.0, )",
@@ -5130,6 +5154,14 @@
           "lib/dotnet/Microsoft.Win32.Primitives.dll": {}
         }
       },
+      "Newtonsoft.Json/7.0.1": {
+        "compile": {
+          "lib/portable-net45+wp80+win8+wpa81+dnxcore50/Newtonsoft.Json.dll": {}
+        },
+        "runtime": {
+          "lib/portable-net45+wp80+win8+wpa81+dnxcore50/Newtonsoft.Json.dll": {}
+        }
+      },
       "System.AppContext/4.0.0": {
         "dependencies": {
           "System.Collections": "[4.0.0, )",
@@ -6772,6 +6804,14 @@
           "lib/dotnet/Microsoft.Win32.Primitives.dll": {}
         }
       },
+      "Newtonsoft.Json/7.0.1": {
+        "compile": {
+          "lib/portable-net45+wp80+win8+wpa81+dnxcore50/Newtonsoft.Json.dll": {}
+        },
+        "runtime": {
+          "lib/portable-net45+wp80+win8+wpa81+dnxcore50/Newtonsoft.Json.dll": {}
+        }
+      },
       "System.AppContext/4.0.0": {
         "dependencies": {
           "System.Collections": "[4.0.0, )",
@@ -8419,6 +8459,14 @@
           "lib/dotnet/Microsoft.Win32.Primitives.dll": {}
         }
       },
+      "Newtonsoft.Json/7.0.1": {
+        "compile": {
+          "lib/portable-net45+wp80+win8+wpa81+dnxcore50/Newtonsoft.Json.dll": {}
+        },
+        "runtime": {
+          "lib/portable-net45+wp80+win8+wpa81+dnxcore50/Newtonsoft.Json.dll": {}
+        }
+      },
       "System.AppContext/4.0.0": {
         "dependencies": {
           "System.Collections": "[4.0.0, )",
@@ -10061,6 +10109,14 @@
           "lib/dotnet/Microsoft.Win32.Primitives.dll": {}
         }
       },
+      "Newtonsoft.Json/7.0.1": {
+        "compile": {
+          "lib/portable-net45+wp80+win8+wpa81+dnxcore50/Newtonsoft.Json.dll": {}
+        },
+        "runtime": {
+          "lib/portable-net45+wp80+win8+wpa81+dnxcore50/Newtonsoft.Json.dll": {}
+        }
+      },
       "System.AppContext/4.0.0": {
         "dependencies": {
           "System.Collections": "[4.0.0, )",
@@ -11467,7 +11523,7 @@
       ]
     },
     "Microsoft.ApplicationInsights.WindowsApps/1.0.0": {
-      "sha512": "fNCAjIwvbTV+G0dT14bgM5tptsqeSaKQaCrlq7QknOq1Xdm8ZmgsDYddMgXkvykyKLjWyU6fKuOpj6fsQJy+wQ==",
+      "sha512": "NvBQnFeiFd0O1QdBz06UGApD7zn7ztVi7qO18IsM3EjiXRNgfrEBXB+azNm8XqLY8xGFAqh3HAuSd/wHZMe0XA==",
       "type": "Package",
       "files": [
         "[Content_Types].xml",
@@ -12135,6 +12191,29 @@
         "ref/xamarinmac20/_._"
       ]
     },
+    "Newtonsoft.Json/7.0.1": {
+      "sha512": "q3V4KLetMLnt1gpAVWgtXnHjKs0UG/RalBc29u2ZKxd5t5Ze4JBL5WiiYIklJyK/5CRiIiNwigVQUo0FgbsuWA==",
+      "type": "Package",
+      "files": [
+        "[Content_Types].xml",
+        "_rels/.rels",
+        "lib/net20/Newtonsoft.Json.dll",
+        "lib/net20/Newtonsoft.Json.xml",
+        "lib/net35/Newtonsoft.Json.dll",
+        "lib/net35/Newtonsoft.Json.xml",
+        "lib/net40/Newtonsoft.Json.dll",
+        "lib/net40/Newtonsoft.Json.xml",
+        "lib/net45/Newtonsoft.Json.dll",
+        "lib/net45/Newtonsoft.Json.xml",
+        "lib/portable-net40+sl5+wp80+win8+wpa81/Newtonsoft.Json.dll",
+        "lib/portable-net40+sl5+wp80+win8+wpa81/Newtonsoft.Json.xml",
+        "lib/portable-net45+wp80+win8+wpa81+dnxcore50/Newtonsoft.Json.dll",
+        "lib/portable-net45+wp80+win8+wpa81+dnxcore50/Newtonsoft.Json.xml",
+        "Newtonsoft.Json.nuspec",
+        "package/services/metadata/core-properties/49e907fc018c4c7ab632e6d4ad4766f8.psmdcp",
+        "tools/install.ps1"
+      ]
+    },
     "System.AppContext/4.0.0": {
       "sha512": "gUoYgAWDC3+xhKeU5KSLbYDhTdBYk9GssrMSCcWUADzOglW+s0AmwVhOUGt2tL5xUl7ZXoYTPdA88zCgKrlG0A==",
       "type": "Package",
@@ -14836,7 +14915,8 @@
       "Microsoft.ApplicationInsights >= 1.0.0",
       "Microsoft.ApplicationInsights.PersistenceChannel >= 1.0.0",
       "Microsoft.ApplicationInsights.WindowsApps >= 1.0.0",
-      "Microsoft.NETCore.UniversalWindowsPlatform >= 5.0.0"
+      "Microsoft.NETCore.UniversalWindowsPlatform >= 5.0.0",
+      "Newtonsoft.Json >= 7.0.1"
     ],
     "UAP,Version=v10.0": []
   }

برخی فایل ها در این مقایسه diff نمایش داده نمی شوند زیرا تعداد فایل ها بسیار زیاد است