diff --git a/CampusAppWP8/CampusAppWP8/CampusAppWP8.csproj b/CampusAppWP8/CampusAppWP8/CampusAppWP8.csproj index 1df934e5..b4446480 100644 --- a/CampusAppWP8/CampusAppWP8/CampusAppWP8.csproj +++ b/CampusAppWP8/CampusAppWP8/CampusAppWP8.csproj @@ -428,6 +428,7 @@ + @@ -457,9 +458,7 @@ ..\packages\WPtoolkit.4.2013.08.16\lib\wp8\Microsoft.Phone.Controls.Toolkit.dll - - - + diff --git a/CampusAppWP8/CampusAppWP8/File/Campusmap/Offlinemap.xml b/CampusAppWP8/CampusAppWP8/File/Campusmap/Offlinemap.xml new file mode 100644 index 00000000..8d4a1592 --- /dev/null +++ b/CampusAppWP8/CampusAppWP8/File/Campusmap/Offlinemap.xml @@ -0,0 +1,295 @@ + + + + Campus Cottbus Mitte + campus + + + Campus Cottbus Süd + campus + + + Campus Senftenberg + campus + + + Campus Cottbus Nord + campus + + + Lehrgebäude 4/6 + + + Lehrgebäude 4/3 + + + Lehrgebäude 4/1 + + + Lehrgebäude 4/4 + + + Wohnheim + + + Wohnheim + + + Wohnheim + + + Wohnheim + + + Wohnheim + + + Biotechnologie + + + Lehrgebäude Musikpädagogik + + + Informations, Kommunikations und Medienzentrum + library + + + Internationales Begegnungszentrum + + + Lehrgebäude 8 + + + Laborhalle 3D + + + Gewächshaus Fakultät 4 + + + Reprographie + + + Umformer Station + + + Zentrale Einrichtung Sprachenzentrum + + + Lehrgebäude 9 + + + Baustofflabor + + + Studentenwerk Frankfurt (Oder) + + + Zentralverwaltung Hubertstraße (ZVH) + + + Wohnheim Papitzer Straße 4/5 + guest_house + + + Lehrgebäude 10 + + + Studentenwohnanlage ErichWeinertStraße + + + Studentenwohnanlage Universitätsstraße 1 + + + Studentenwohnanlage Universitätsstraße 2 + + + Studentenwohnanlage Universitätsstraße 3 + + + Zwischenbau 1 + + + Zwischenbau 3 + + + Zwischenbau 4 + + + Zwischenbau 6 + + + Zwischenbau 5 + + + Mehrzweckgebäude + + + Physiotheraphie/Medizintechnik + + + Cafeteria HL + public_building + + + Gebäude 14 + + + Laborgebäude Bauingenieurwesen Verfahrenstechni + + + Lehrgebäude Bauningenieurwesen Architektur + + + Lehrgebäude Bauningenieurwesen Architektur + + + Lehrgebäude Betriebswirtschaftslehre + + + Lehrgebäude Sozialwesen + + + Wohnheim 1 + + + Fakultät 3 / Sport + + + Laborgebäude 1B + + + Lehrgebäude 1A + + + Forschungs und Materialprüfanstalt Cottbus + + + Garagenkomplex + + + Lehrgebäude 1C + + + Lehrgebäude 3 + + + Lehrhalle 3G Verkehrtechnikhalle + + + Sporthalle 1 + + + Hörsaal 3 + + + GrundbauVersuchshalle + + + Laborgebäude 4B + + + Laborhalle 3C + + + Laborhalle 4C + + + Lehrgebäude 3A + + + Lehrgebäude 3B + + + Lehrgebäude 4A + + + Panta Rhei Halle + + + Großer Hörsaal + entrance + + + Hauptgebäude + + + Zentralverwaltung + + + Zwischenbau Lehrgebäude 2A/B + + + Lehrgebäude 2A + + + Lehrgebäude 2B + + + Lehrgebäude 2C + + + Lehrgebäude 2D + + + Zwischenbau Lehrgebäude 2C/D + + + Alte Schwimmhalle (geschlossen) + + + BTU Mensa + restaurant + + + Zentrales Hörsaalgebäude + + + Zwischenbau 2 + + + Elektrotechnik/Chemie/Verfahrenstechnik + school + + + Maschinenbau + school + + + Sporthalle + school + + + Mensa + school + + + Informatik (Labor) + school + + + Informatik + school + + + KonradZuseMedienzentrum + school + + + Hochschulbibliothek + school + + + Hochschulverwaltung/Rechenzentrum + school + + + Wohnanlage 8 + + + Lehrgebäude 4/2 + + + Lehrgebäude 4/5 + + + diff --git a/CampusAppWP8/CampusAppWP8/Model/Campusmap/CBMainMapModel.cs b/CampusAppWP8/CampusAppWP8/Model/Campusmap/CBMainMapModel.cs index f10d1056..0c12cec8 100644 --- a/CampusAppWP8/CampusAppWP8/Model/Campusmap/CBMainMapModel.cs +++ b/CampusAppWP8/CampusAppWP8/Model/Campusmap/CBMainMapModel.cs @@ -7,21 +7,25 @@ //----------------------------------------------------------------------------- namespace CampusAppWP8.Model.Campusmap { - using System.Collections.ObjectModel; using System.Windows; using CampusAppWP8.Model.GeoDb; + using CampusAppWP8.Resources; + using CampusAppWP8.Utility; /// /// Class for the MapModel of the mainCampus of cottbus /// public class CBMainMapModel : MapModel { + /// Variable for the identify of the campus. + private static readonly string Campus = ((int)CampusAppWP8.Model.Setting.UserProfilModel.Campus.CB_MAIN).ToString(); + /// /// Initializes a new instance of the class. /// public CBMainMapModel() { - this.ImageSource = "/Assets/campusmap.png"; + this.ImageSource = Constants.FileMap_CBMainMap; this.ImageWidth = 2000; this.ImageHeight = 1425; this.MapImageOffsetX = -228; @@ -37,29 +41,16 @@ namespace CampusAppWP8.Model.Campusmap /// Stubbfel, 19.08.2013. protected override void LoadSpatials() { - ObservableCollection places = new ObservableCollection(); - ObservableCollection infos = new ObservableCollection(); + SpsModel model = XmlManager.DeserializationFileToModel(Constants.FileMap_OfflineMap); - infos.Add(new PlaceInformation() { InformationName = "name", InformationValue = "Campus Cottbus Mitte" }); - infos.Add(new PlaceInformation() { InformationName = "type", InformationValue = "campus" }); - places.Add(new PlaceModel() { PlaceId = "1", RefPoint = "POINT(14.324056352976152 51.76737987049448)", Informations = infos }); - - infos = new ObservableCollection(); - infos.Add(new PlaceInformation() { InformationName = "name", InformationValue = "MZG" }); - infos.Add(new PlaceInformation() { InformationName = "type", InformationValue = "Mehrzweck" }); - places.Add(new PlaceModel() { PlaceId = "5", ParentId = "1", RefPoint = "POINT(14.321714914733889 51.76608468494122)", Informations = infos }); - - infos = new ObservableCollection(); - infos.Add(new PlaceInformation() { InformationName = "name", InformationValue = "BTU Mensa" }); - infos.Add(new PlaceInformation() { InformationName = "type", InformationValue = "restaurant" }); - places.Add(new PlaceModel() { PlaceId = "145280193", ParentId = "1", RefPoint = "POINT(14.326168833333334 51.76649038666667)", Informations = infos }); - - if (this.Spatial == null) + this.Spatial = new SpsModel(); + foreach (PlaceModel place in model.Places) { - this.Spatial = new SpsModel(); + if (Campus.Equals(place.ParentId) || Campus.Equals(place.PlaceId)) + { + this.Spatial.Places.Add(place); + } } - - this.Spatial.Places = places; } } } diff --git a/CampusAppWP8/CampusAppWP8/Model/GeoDb/SpsModel.cs b/CampusAppWP8/CampusAppWP8/Model/GeoDb/SpsModel.cs index 2970ee95..e9485e84 100644 --- a/CampusAppWP8/CampusAppWP8/Model/GeoDb/SpsModel.cs +++ b/CampusAppWP8/CampusAppWP8/Model/GeoDb/SpsModel.cs @@ -19,6 +19,13 @@ namespace CampusAppWP8.Model.GeoDb [XmlRoot("root")] public class SpsModel { + /// Initializes a new instance of the SpsModel class. + /// Stubbfel, 20.08.2013. + public SpsModel() + { + this.Places = new ObservableCollection(); + } + /// /// Gets or sets a list of places /// diff --git a/CampusAppWP8/CampusAppWP8/Model/Setting/UserProfilModel.cs b/CampusAppWP8/CampusAppWP8/Model/Setting/UserProfilModel.cs index d92a582a..a753efca 100644 --- a/CampusAppWP8/CampusAppWP8/Model/Setting/UserProfilModel.cs +++ b/CampusAppWP8/CampusAppWP8/Model/Setting/UserProfilModel.cs @@ -122,7 +122,6 @@ namespace CampusAppWP8.Model.Setting } } - /// /// Gets or sets the defaultCampus of the user /// diff --git a/CampusAppWP8/CampusAppWP8/Resources/Constants.Designer.cs b/CampusAppWP8/CampusAppWP8/Resources/Constants.Designer.cs index b0d84d4e..ad0aba17 100644 --- a/CampusAppWP8/CampusAppWP8/Resources/Constants.Designer.cs +++ b/CampusAppWP8/CampusAppWP8/Resources/Constants.Designer.cs @@ -123,6 +123,24 @@ namespace CampusAppWP8.Resources { } } + /// + /// Sucht eine lokalisierte Zeichenfolge, die /Assets/campusmap.png ähnelt. + /// + public static string FileMap_CBMainMap { + get { + return ResourceManager.GetString("FileMap_CBMainMap", resourceCulture); + } + } + + /// + /// Sucht eine lokalisierte Zeichenfolge, die File/Campusmap/Offlinemap.xml ähnelt. + /// + public static string FileMap_OfflineMap { + get { + return ResourceManager.GetString("FileMap_OfflineMap", resourceCulture); + } + } + /// /// Sucht eine lokalisierte Zeichenfolge, die MensaFeed.xml ähnelt. /// diff --git a/CampusAppWP8/CampusAppWP8/Resources/Constants.resx b/CampusAppWP8/CampusAppWP8/Resources/Constants.resx index 4366a89a..d6ba8703 100644 --- a/CampusAppWP8/CampusAppWP8/Resources/Constants.resx +++ b/CampusAppWP8/CampusAppWP8/Resources/Constants.resx @@ -411,4 +411,10 @@ [+-]{0,1}[0-9]+[.,]{0,1}[0-9]+[\s][+-]{0,1}[0-9]+[.,]{0,1}[0-9]+ + + File/Campusmap/Offlinemap.xml + + + /Assets/campusmap.png + \ No newline at end of file diff --git a/CampusAppWP8/CampusAppWP8/Utility/XmlManager.cs b/CampusAppWP8/CampusAppWP8/Utility/XmlManager.cs index e5b5d4f3..75d1467e 100644 --- a/CampusAppWP8/CampusAppWP8/Utility/XmlManager.cs +++ b/CampusAppWP8/CampusAppWP8/Utility/XmlManager.cs @@ -38,6 +38,19 @@ namespace CampusAppWP8.Utility return model; } + /// Deserialization a xml file to a model. + /// Stubbfel, 20.08.2013. + /// Generic type parameter. + /// Path to the a XmlFile. + /// model of the XmlFile. + public static T DeserializationFileToModel(string xmlFilePath) + { + XmlSerializer serializer = new XmlSerializer(typeof(T)); + XDocument document = XDocument.Load(xmlFilePath); + T model = (T)serializer.Deserialize(document.CreateReader()); + return model; + } + /// /// Method serializes a model to a string. ///