From 85c196df786a2e771cf65bd27b9f66ab9a28288a Mon Sep 17 00:00:00 2001 From: stubbfel Date: Mon, 14 Oct 2013 18:38:41 +0200 Subject: [PATCH] refactory campusmapmodel --- CampusAppWP8/CampusAppWP8/CampusAppWP8.csproj | 4 +- .../Model/Campusmap/BuildingMapModel.cs | 40 ++-- .../Model/Campusmap/CBMainMapModel.cs | 35 +-- .../Model/Campusmap/CBMainMapRoomModel.cs | 30 +-- .../Model/Campusmap/CampusMapModel.cs | 38 +-- .../Model/Campusmap/ClickAblePlacePinModel.cs | 35 ++- .../Campusmap/CurrentPositionPinModel.cs | 21 +- .../Model/Campusmap/HiddenPinPlaceModel.cs | 17 +- .../Model/Campusmap/InfoLabPlacePinModel.cs | 21 +- .../Campusmap/InfoPlaceAccessPinModel.cs | 23 +- .../Model/Campusmap/InfoPlacePinModel.cs | 21 +- .../Model/Campusmap/InfoPlaceWCPinModel.cs | 23 +- .../CampusAppWP8/Model/Campusmap/MapModel.cs | 222 ++++++++---------- .../Model/Campusmap/MapPinModel.cs | 145 ++++++------ .../Model/Campusmap/SearchPlacePinModel.cs | 17 +- .../Pages/Campusmap/CampusMapPage.xaml.cs | 2 +- CampusAppWP8/CampusAppWP8/Settings.StyleCop | 1 + Doc/atominnerSettings/PrefSets.xml | 4 +- 18 files changed, 338 insertions(+), 361 deletions(-) diff --git a/CampusAppWP8/CampusAppWP8/CampusAppWP8.csproj b/CampusAppWP8/CampusAppWP8/CampusAppWP8.csproj index fa91da9a..b87004b2 100644 --- a/CampusAppWP8/CampusAppWP8/CampusAppWP8.csproj +++ b/CampusAppWP8/CampusAppWP8/CampusAppWP8.csproj @@ -200,7 +200,9 @@ - + + False + diff --git a/CampusAppWP8/CampusAppWP8/Model/Campusmap/BuildingMapModel.cs b/CampusAppWP8/CampusAppWP8/Model/Campusmap/BuildingMapModel.cs index 6f222579..9c9dc708 100644 --- a/CampusAppWP8/CampusAppWP8/Model/Campusmap/BuildingMapModel.cs +++ b/CampusAppWP8/CampusAppWP8/Model/Campusmap/BuildingMapModel.cs @@ -1,25 +1,35 @@ -using CampusAppWP8.Model.GeoDb; -using CampusAppWP8.Resources; -using CampusAppWPortalLib8.Utility; -using System; -using System.Collections.Generic; -using System.Globalization; -using System.Linq; -using System.Text; -using System.Threading.Tasks; -using System.Windows; - +//----------------------------------------------------------------------- +// +// The MIT License (MIT). Copyright (c) 2013 BTU/IIT. +// +// Stubbfel +// 14.10.2013 +// Implements the building map model class +//----------------------------------------------------------------------- namespace CampusAppWP8.Model.Campusmap { + using System.Globalization; + using System.Linq; + using System.Windows; + using CampusAppWP8.Model.GeoDb; + using CampusAppWP8.Resources; + using CampusAppWPortalLib8.Utility; + + /// A data Model for the building map. + /// Stubbfel, 14.10.2013. + /// public class BuildingMapModel : MapModel { + /// Initializes a new instance of the BuildingMapModel class. + /// Stubbfel, 14.10.2013. + /// The identifier. public BuildingMapModel(string id) { SpsModel buildings = XmlManager.DeserializationFileToModel(Constants.FileMap_BuildingsMap); PlaceModel building = buildings.GetPlaceById(id); if (buildings == null) { - return; + return; } this.ImageSource = building.GetInformationsValue("ImageSource"); @@ -29,7 +39,7 @@ namespace CampusAppWP8.Model.Campusmap this.ImageWidth = tmpVal; } - if (double.TryParse(building.GetInformationsValue("ImageHeight"), NumberStyles.Number, CultureInfo.InvariantCulture, out tmpVal)) + if (double.TryParse(building.GetInformationsValue("ImageHeight"), NumberStyles.Number, CultureInfo.InvariantCulture, out tmpVal)) { this.ImageHeight = tmpVal; } @@ -52,6 +62,7 @@ namespace CampusAppWP8.Model.Campusmap { return; } + double x; double y; @@ -60,7 +71,7 @@ namespace CampusAppWP8.Model.Campusmap return; } - this.RefPoint = new Point(x,y); + this.RefPoint = new Point(x, y); if (double.TryParse(building.GetInformationsValue("ScaleX"), NumberStyles.Number, CultureInfo.InvariantCulture, out tmpVal)) { @@ -74,7 +85,6 @@ namespace CampusAppWP8.Model.Campusmap this.GeoOffsetX = building.GeoRefPoint.Longitude; this.GeoOffsetY = building.GeoRefPoint.Latitude; - } } } diff --git a/CampusAppWP8/CampusAppWP8/Model/Campusmap/CBMainMapModel.cs b/CampusAppWP8/CampusAppWP8/Model/Campusmap/CBMainMapModel.cs index 3363f686..2e2757c5 100644 --- a/CampusAppWP8/CampusAppWP8/Model/Campusmap/CBMainMapModel.cs +++ b/CampusAppWP8/CampusAppWP8/Model/Campusmap/CBMainMapModel.cs @@ -1,36 +1,37 @@ -//----------------------------------------------------------------------------- +//----------------------------------------------------------------------- // -// Company copyright tag. +// The MIT License (MIT). Copyright (c) 2013 BTU/IIT. // -// stubbfel -// 13.08.2013 -//----------------------------------------------------------------------------- +// Stubbfel +// 14.10.2013 +// Implements the main map model class +//----------------------------------------------------------------------- namespace CampusAppWP8.Model.Campusmap { - using System.Windows; - using CampusAppWP8.File.Places; + using System.Collections.Generic; + using System.Windows; using CampusAppWP8.Model.GeoDb; - using CampusAppWP8.Resources; - using System.Collections.Generic; + using CampusAppWP8.Resources; - /// - /// Class for the MapModel of the mainCampus of cottbus - /// + /// Class for the MapModel of the mainCampus of cottbus. + /// Stubbfel, 14.10.2013. + /// public class CBMainMapModel : CampusMapModel { #region Member - /// Variable for the identify of the campus. + /// Variable for the identify of the campus. private static readonly string Campus = ((int)CampusAppWPortalLib8.Model.Settings.Campus.CB_MAIN).ToString(); #endregion #region Constructor - /// - /// Initializes a new instance of the class. - /// - public CBMainMapModel(List placeList) : base (placeList,CBMainMapModel.Campus) + /// Initializes a new instance of the class. + /// Stubbfel, 14.10.2013. + /// List of places. + public CBMainMapModel(List placeList) + : base(placeList, CBMainMapModel.Campus) { this.ImageSource = Constants.FileMap_CBMainMap; this.ImageWidth = 2000; diff --git a/CampusAppWP8/CampusAppWP8/Model/Campusmap/CBMainMapRoomModel.cs b/CampusAppWP8/CampusAppWP8/Model/Campusmap/CBMainMapRoomModel.cs index 3c3740b7..a98fb364 100644 --- a/CampusAppWP8/CampusAppWP8/Model/Campusmap/CBMainMapRoomModel.cs +++ b/CampusAppWP8/CampusAppWP8/Model/Campusmap/CBMainMapRoomModel.cs @@ -1,31 +1,25 @@ -//----------------------------------------------------------------------------- -// -// Company copyright tag. +//----------------------------------------------------------------------- +// +// The MIT License (MIT). Copyright (c) 2013 BTU/IIT. // -// stubbfel -// 13.08.2013 -//----------------------------------------------------------------------------- +// Stubbfel +// 14.10.2013 +// Implements the main map room model class +//----------------------------------------------------------------------- namespace CampusAppWP8.Model.Campusmap { - using System.Windows; - using CampusAppWP8.File.Places; - using CampusAppWP8.Model.GeoDb; - using CampusAppWP8.Resources; - using System.Collections.Generic; - - /// - /// Class for the MapModel of the mainCampus of cottbus - /// + /// Class for the MapModel of the mainCampus of cottbus. + /// Stubbfel, 14.10.2013. public class CBMainMapRoomModel { #region Constructor + + /// Initializes a new instance of the CBMainMapRoomModel class. + /// Stubbfel, 14.10.2013. public CBMainMapRoomModel() { - } #endregion - - } } diff --git a/CampusAppWP8/CampusAppWP8/Model/Campusmap/CampusMapModel.cs b/CampusAppWP8/CampusAppWP8/Model/Campusmap/CampusMapModel.cs index 579a80f3..45a71407 100644 --- a/CampusAppWP8/CampusAppWP8/Model/Campusmap/CampusMapModel.cs +++ b/CampusAppWP8/CampusAppWP8/Model/Campusmap/CampusMapModel.cs @@ -1,28 +1,27 @@ //----------------------------------------------------------------------- // -// Company copyright tag. +// The MIT License (MIT). Copyright (c) 2013 BTU/IIT. // -// stubbfel -// 26.09.2013 -//---------------------------------------------------------------------- - +// Stubbfel +// 14.10.2013 +// Implements the campus map model class +//----------------------------------------------------------------------- namespace CampusAppWP8.Model.Campusmap { using System.Collections.Generic; using CampusAppWP8.Model.GeoDb; - /// - /// Class for the CampusMapModel - /// + /// Class for the CampusMapModel. + /// Stubbfel, 14.10.2013. + /// public class CampusMapModel : MapModel { #region constructor - /// - /// Initializes a new instance of the class. - /// - /// list of places - /// id of the campus + /// Initializes a new instance of the class. + /// Stubbfel, 14.10.2013. + /// list of places. + /// id of the campus. public CampusMapModel(List placeList, string campusId) { this.CampusId = campusId; @@ -30,6 +29,8 @@ namespace CampusAppWP8.Model.Campusmap this.IsReady = true; } + /// Initializes a new instance of the CampusMapModel class. + /// Stubbfel, 14.10.2013. public CampusMapModel() { } @@ -38,18 +39,17 @@ namespace CampusAppWP8.Model.Campusmap #region property - /// - /// Gets or sets the campusId - /// + /// Gets or sets the campusId. + /// The identifier of the campus. public string CampusId { get; protected set; } #endregion #region method - /// Loads the spatial./. - /// Stubbfel, 19.08.2013. - /// list of places + /// Loads the spatial./. + /// Stubbfel, 14.10.2013. + /// protected override void LoadSpatials(List placeList) { List campusPlaces = new List(); diff --git a/CampusAppWP8/CampusAppWP8/Model/Campusmap/ClickAblePlacePinModel.cs b/CampusAppWP8/CampusAppWP8/Model/Campusmap/ClickAblePlacePinModel.cs index 8267acd1..9fc74d80 100644 --- a/CampusAppWP8/CampusAppWP8/Model/Campusmap/ClickAblePlacePinModel.cs +++ b/CampusAppWP8/CampusAppWP8/Model/Campusmap/ClickAblePlacePinModel.cs @@ -1,42 +1,39 @@ //----------------------------------------------------------------------- // -// Company copyright tag. +// The MIT License (MIT). Copyright (c) 2013 BTU/IIT. // -// stubbfel -// 26.09.2013 -//---------------------------------------------------------------------- - +// Stubbfel +// 14.10.2013 +// Implements the click able place pin model class +//----------------------------------------------------------------------- namespace CampusAppWP8.Model.Campusmap { using System.Collections.Generic; using CampusAppWP8.Model.GeoDb; - /// - /// abstract class for click abel bins - /// + /// abstract class for click abel bins. + /// Stubbfel, 14.10.2013. + /// public abstract class ClickAblePlacePinModel : MapPinModel { #region property - /// - /// Gets or sets Callback Function, to show place information of the Pin - /// + /// Gets or sets Callback Function, to show place information of the Pin. + /// The call back. public MapModel.MapInfos CallBack { get; set; } - /// - /// Gets or sets place which are associative with this pin - /// + /// Gets or sets place which are associative with this pin. + /// The associated places. public List AssocPlaces { get; set; } #endregion #region Method - /// - /// Show Information of this pin places - /// - /// sender of the Event - /// MouseButtonEvent Arguments + /// Show Information of this pin places. + /// Stubbfel, 14.10.2013. + /// sender of the Event. + /// MouseButtonEvent Arguments. public void ShowInfo(object sender, System.Windows.Input.MouseButtonEventArgs e) { this.CallBack(this.AssocPlaces); diff --git a/CampusAppWP8/CampusAppWP8/Model/Campusmap/CurrentPositionPinModel.cs b/CampusAppWP8/CampusAppWP8/Model/Campusmap/CurrentPositionPinModel.cs index ab11ad7d..78d17ad9 100644 --- a/CampusAppWP8/CampusAppWP8/Model/Campusmap/CurrentPositionPinModel.cs +++ b/CampusAppWP8/CampusAppWP8/Model/Campusmap/CurrentPositionPinModel.cs @@ -1,24 +1,25 @@ //----------------------------------------------------------------------- // -// Company copyright tag. +// The MIT License (MIT). Copyright (c) 2013 BTU/IIT. // -// stubbfel -// 27.08.2013 -//---------------------------------------------------------------------- - +// Stubbfel +// 14.10.2013 +// Implements the current position pin model class +//----------------------------------------------------------------------- namespace CampusAppWP8.Model.Campusmap { using System.Windows; using CampusAppWP8.Resources; - /// Current position pin model. - /// Stubbfel, 27.08.2013. + /// Current position pin model. + /// Stubbfel, 27.08.2013. + /// public class CurrentPositionPinModel : MapPinModel { #region Constructor - /// Initializes a new instance of the CurrentPositionPinModel class. - /// Stubbfel, 27.08.2013. + /// Initializes a new instance of the CurrentPositionPinModel class. + /// Stubbfel, 27.08.2013. public CurrentPositionPinModel() { this.ImageSource = Icons.CurrentPosition; @@ -26,7 +27,7 @@ namespace CampusAppWP8.Model.Campusmap this.ImageHeight = 60; this.PinImageOffsetX = -25; this.PinImageOffsetY = -34; - this.Tag = MapPinModel.CurrendPositionPlacePinString; + this.Tag = MapPinModel.CurrentPositionPlacePinString; this.ZIndex = 3; } diff --git a/CampusAppWP8/CampusAppWP8/Model/Campusmap/HiddenPinPlaceModel.cs b/CampusAppWP8/CampusAppWP8/Model/Campusmap/HiddenPinPlaceModel.cs index e8343a76..57290f3a 100644 --- a/CampusAppWP8/CampusAppWP8/Model/Campusmap/HiddenPinPlaceModel.cs +++ b/CampusAppWP8/CampusAppWP8/Model/Campusmap/HiddenPinPlaceModel.cs @@ -1,19 +1,22 @@ -//----------------------------------------------------------------------------- +//----------------------------------------------------------------------- // -// Company copyright tag. +// The MIT License (MIT). Copyright (c) 2013 BTU/IIT. // -// fiedlchr -// 13.08.2013 -//----------------------------------------------------------------------------- +// Stubbfel +// 14.10.2013 +// Implements the hidden pin place model class +//----------------------------------------------------------------------- namespace CampusAppWP8.Model.Campusmap { - /// Hidden pin place model. - /// Stubbfel, 27.08.2013. + /// Hidden pin place model. + /// Stubbfel, 27.08.2013. + /// public class HiddenPinPlaceModel : MapPinModel { /// /// Initializes a new instance of the class. /// + /// Stubbfel, 14.10.2013. public HiddenPinPlaceModel() { this.Tag = MapPinModel.HiddenPlacePinString; diff --git a/CampusAppWP8/CampusAppWP8/Model/Campusmap/InfoLabPlacePinModel.cs b/CampusAppWP8/CampusAppWP8/Model/Campusmap/InfoLabPlacePinModel.cs index da79014f..2d63a436 100644 --- a/CampusAppWP8/CampusAppWP8/Model/Campusmap/InfoLabPlacePinModel.cs +++ b/CampusAppWP8/CampusAppWP8/Model/Campusmap/InfoLabPlacePinModel.cs @@ -1,25 +1,24 @@ //----------------------------------------------------------------------- // -// Company copyright tag. +// The MIT License (MIT). Copyright (c) 2013 BTU/IIT. // -// stubbfel -// 27.08.2013 -//---------------------------------------------------------------------- - +// Stubbfel +// 14.10.2013 +// Implements the information lab place pin model class +//----------------------------------------------------------------------- namespace CampusAppWP8.Model.Campusmap { using CampusAppWP8.Resources; - /// Search pin place model. - /// Stubbfel, 27.08.2013. + /// Search pin place model. + /// Stubbfel, 27.08.2013. + /// public class InfoLabPlacePinModel : InfoPlacePinModel { #region Constructor - /// - /// Initializes a new instance of the class. - /// - /// Stubbfel, 27.08.2013. + /// Initializes a new instance of the class. + /// Stubbfel, 27.08.2013. public InfoLabPlacePinModel() { this.ImageSource = Icons.PlaceLab; diff --git a/CampusAppWP8/CampusAppWP8/Model/Campusmap/InfoPlaceAccessPinModel.cs b/CampusAppWP8/CampusAppWP8/Model/Campusmap/InfoPlaceAccessPinModel.cs index 2b89ddbd..0c5e5d2e 100644 --- a/CampusAppWP8/CampusAppWP8/Model/Campusmap/InfoPlaceAccessPinModel.cs +++ b/CampusAppWP8/CampusAppWP8/Model/Campusmap/InfoPlaceAccessPinModel.cs @@ -1,25 +1,24 @@ //----------------------------------------------------------------------- -// -// Company copyright tag. +// +// The MIT License (MIT). Copyright (c) 2013 BTU/IIT. // -// stubbfel -// 27.08.2013 -//---------------------------------------------------------------------- - +// Stubbfel +// 14.10.2013 +// Implements the information place access pin model class +//----------------------------------------------------------------------- namespace CampusAppWP8.Model.Campusmap { using CampusAppWP8.Resources; - /// Search pin place model. - /// Stubbfel, 27.08.2013. + /// Search pin place model. + /// Stubbfel, 27.08.2013. + /// public class InfoPlaceAccessPinModel : InfoPlacePinModel { #region Constructor - /// - /// Initializes a new instance of the class. - /// - /// Stubbfel, 27.08.2013. + /// Initializes a new instance of the class. + /// Stubbfel, 27.08.2013. public InfoPlaceAccessPinModel() { this.ImageSource = Icons.PlaceInfoAccess; diff --git a/CampusAppWP8/CampusAppWP8/Model/Campusmap/InfoPlacePinModel.cs b/CampusAppWP8/CampusAppWP8/Model/Campusmap/InfoPlacePinModel.cs index 70ca24f4..1111da33 100644 --- a/CampusAppWP8/CampusAppWP8/Model/Campusmap/InfoPlacePinModel.cs +++ b/CampusAppWP8/CampusAppWP8/Model/Campusmap/InfoPlacePinModel.cs @@ -1,25 +1,24 @@ //----------------------------------------------------------------------- // -// BTU/IIT +// The MIT License (MIT). Copyright (c) 2013 BTU/IIT. // -// stubbfel -// 27.08.2013 -//---------------------------------------------------------------------- - +// Stubbfel +// 14.10.2013 +// Implements the information place pin model class +//----------------------------------------------------------------------- namespace CampusAppWP8.Model.Campusmap { using CampusAppWP8.Resources; - /// Search pin place model. - /// Stubbfel, 27.08.2013. + /// Search pin place model. + /// Stubbfel, 27.08.2013. + /// public class InfoPlacePinModel : ClickAblePlacePinModel { #region Constructor - /// - /// Initializes a new instance of the class. - /// - /// Stubbfel, 27.08.2013. + /// Initializes a new instance of the class. + /// Stubbfel, 27.08.2013. public InfoPlacePinModel() { this.ImageSource = Icons.PlaceInfo; diff --git a/CampusAppWP8/CampusAppWP8/Model/Campusmap/InfoPlaceWCPinModel.cs b/CampusAppWP8/CampusAppWP8/Model/Campusmap/InfoPlaceWCPinModel.cs index 223f429f..e070250f 100644 --- a/CampusAppWP8/CampusAppWP8/Model/Campusmap/InfoPlaceWCPinModel.cs +++ b/CampusAppWP8/CampusAppWP8/Model/Campusmap/InfoPlaceWCPinModel.cs @@ -1,25 +1,24 @@ //----------------------------------------------------------------------- -// -// Company copyright tag. +// +// The MIT License (MIT). Copyright (c) 2013 BTU/IIT. // -// stubbfel -// 27.08.2013 -//---------------------------------------------------------------------- - +// Stubbfel +// 14.10.2013 +// Implements the information place wc pin model class +//----------------------------------------------------------------------- namespace CampusAppWP8.Model.Campusmap { using CampusAppWP8.Resources; - /// Search pin place model. - /// Stubbfel, 27.08.2013. + /// Search pin place model. + /// Stubbfel, 27.08.2013. + /// public class InfoPlaceWCPinModel : InfoPlacePinModel { #region Constructor - /// - /// Initializes a new instance of the class. - /// - /// Stubbfel, 27.08.2013. + /// Initializes a new instance of the InfoPlaceWCPinModel class. + /// Stubbfel, 14.10.2013. public InfoPlaceWCPinModel() { this.ImageSource = Icons.PlaceInfoWc; diff --git a/CampusAppWP8/CampusAppWP8/Model/Campusmap/MapModel.cs b/CampusAppWP8/CampusAppWP8/Model/Campusmap/MapModel.cs index f97360ae..5e105c5d 100644 --- a/CampusAppWP8/CampusAppWP8/Model/Campusmap/MapModel.cs +++ b/CampusAppWP8/CampusAppWP8/Model/Campusmap/MapModel.cs @@ -1,10 +1,11 @@ //----------------------------------------------------------------------- // -// Company copyright tag. +// The MIT License (MIT). Copyright (c) 2013 BTU/IIT. // -// stubbfel -// 24.06.2013 -//---------------------------------------------------------------------- +// Stubbfel +// 14.10.2013 +// Implements the map model class +//----------------------------------------------------------------------- namespace CampusAppWP8.Model.Campusmap { using System; @@ -15,25 +16,22 @@ namespace CampusAppWP8.Model.Campusmap using System.Windows.Media.Imaging; using CampusAppWP8.Model.GeoDb; - /// - /// This Class manage the properties of a Map - /// + /// This Class manage the properties of a Map. + /// Stubbfel, 14.10.2013. public class MapModel { #region Constructors - /// - /// Initializes a new instance of the class. - /// + /// Initializes a new instance of the class. + /// Stubbfel, 14.10.2013. public MapModel() { this.IsReady = false; } - /// - /// Initializes a new instance of the class. - /// - /// list of places + /// Initializes a new instance of the class. + /// Stubbfel, 14.10.2013. + /// list of places. public MapModel(List placeList) { this.IsReady = false; @@ -45,77 +43,63 @@ namespace CampusAppWP8.Model.Campusmap #region Events - /// - /// Delegate for MapInfo - /// - /// list of places + /// Delegate for MapInfo. + /// Stubbfel, 14.10.2013. + /// list of places. public delegate void MapInfos(List places); - /// - /// Event ShowMapInfo - /// + /// Event ShowMapInfo. public event MapInfos ShowMapInfos = null; #endregion #region Property - /// - /// Gets or sets a value indicating whether the map is ready or not - /// + /// Gets or sets a value indicating whether the map is ready or not. + /// true if this object is ready, false if not. public bool IsReady { get; protected set; } - /// - /// Gets or sets the ImageSource of the map - /// + /// Gets or sets the ImageSource of the map. + /// The image source. public string ImageSource { get; set; } - /// - /// Gets or sets the ImageWidth of the map - /// + /// Gets or sets the ImageWidth of the map. + /// The width of the image. public double ImageWidth { get; set; } - /// - /// Gets or sets the ImageHeight of the map - /// + /// Gets or sets the ImageHeight of the map. + /// The height of the image. public double ImageHeight { get; set; } - /// - /// Gets or sets the ImageOffsetX of the map - /// + /// Gets or sets the ImageOffsetX of the map. + /// The map image offset x coordinate. public double MapImageOffsetX { get; set; } - /// - /// Gets or sets the ImageOffsetY of the map - /// + /// Gets or sets the ImageOffsetY of the map. + /// The map image offset y coordinate. public double MapImageOffsetY { get; set; } - /// - /// Gets or sets the GeoOffsetX of the map - /// + /// Gets or sets the GeoOffsetX of the map. + /// The geo offset x coordinate. public double GeoOffsetX { get; set; } - /// - /// Gets or sets the GeoOffsetY of the map - /// + /// Gets or sets the GeoOffsetY of the map. + /// The geo offset y coordinate. public double GeoOffsetY { get; set; } - /// - /// Gets or sets the Scale (to pixel) of the map - /// + /// Gets or sets the Scale (to pixel) of the map. + /// The scale x coordinate. public double ScaleX { get; set; } - /// - /// Gets or sets the Scale (to pixel) of the map - /// + /// Gets or sets the Scale (to pixel) of the map. + /// The scale y coordinate. public double ScaleY { get; set; } - /// - /// Gets or sets the reference point - /// + /// Gets or sets the reference point. + /// The reference point. public Point RefPoint { get; set; } - /// Gets or sets the spatial of the map. - /// The spatial. + /// Gets or sets the spatial of the map. + /// The spatial. public SpsModel Spatial { get; set; } #endregion @@ -124,23 +108,20 @@ namespace CampusAppWP8.Model.Campusmap #region public - /// - /// Method calculate the coordinates of ScrollToOffsets point - /// - /// input point - /// point (in pixel) + /// Method calculate the coordinates of ScrollToOffsets point. + /// Stubbfel, 14.10.2013. + /// input point. + /// point (in pixel) public Point GetScrollPoint(Point point) { return this.GetScrollPoint(point.X, point.Y); } - /// - /// Method calculate the coordinates of ScrollToOffsets point - /// - /// the input-point will be shown in the center - /// x - coordinate - /// y - coordinate - /// point (in pixel) + /// Method calculate the coordinates of ScrollToOffsets point. + /// the input-point will be shown in the center. + /// x - coordinate. + /// y - coordinate. + /// point (in pixel) public Point GetScrollPoint(double x, double y) { x = this.RefPoint.X + this.MapImageOffsetX + x; @@ -149,13 +130,13 @@ namespace CampusAppWP8.Model.Campusmap return new Point(x, y); } - /// Method create in image, which can show at a certain position. - /// Stubbfel, 27.08.2013. - /// the x- coordinate. - /// the y-coordinate. - /// The type. - /// list of places - /// image of the pin. + /// Method create in image, which can show at a certain position. + /// Stubbfel, 27.08.2013. + /// the x- coordinate. + /// the y-coordinate. + /// The type. + /// (Optional) list of places. + /// image of the pin. public Image AddPin(double x, double y, MapPinModel.PinType type, List places = null) { Point position = new Point(x, y); @@ -166,12 +147,12 @@ namespace CampusAppWP8.Model.Campusmap /// Method create in image, which can show at a certain position depend of the /// /// - /// Stubbfel, 27.08.2013. - /// the x-coordinate. - /// the y-coordinate. - /// The type. - /// list of places - /// image of the pin. + /// Stubbfel, 27.08.2013. + /// the x-coordinate. + /// the y-coordinate. + /// The type. + /// (Optional) list of places. + /// image of the pin. public Image AddPinFromRefPoint(double x, double y, MapPinModel.PinType type, List places = null) { Point position = new Point(this.RefPoint.X + x, this.RefPoint.Y - y); @@ -182,22 +163,22 @@ namespace CampusAppWP8.Model.Campusmap /// Method create in image, which can show at a certain position depend of the /// /// - /// Stubbfel, 27.08.2013. - /// input point. - /// The type. - /// list of places - /// image of the pin. + /// Stubbfel, 27.08.2013. + /// input point. + /// The type. + /// (Optional) list of places. + /// image of the pin. public Image AddPinFromRefPoint(Point position, MapPinModel.PinType type, List places = null) { return this.AddPinFromRefPoint(position.X, position.Y, type, places); } - /// Method create in image, which can show at a certain position. - /// Stubbfel, 27.08.2013. - /// input point. - /// The type. - /// list of places - /// image of the pin. + /// Method create in image, which can show at a certain position. + /// Stubbfel, 27.08.2013. + /// input point. + /// The type. + /// (Optional) list of places. + /// image of the pin. public Image AddPin(Point position, MapPinModel.PinType type, List places = null) { Image pinImg = new Image(); @@ -216,43 +197,40 @@ namespace CampusAppWP8.Model.Campusmap return pinImg; } - /// Convert a coordinates to coordinates which address pixels. - /// Stubbfel, 27.08.2013. - /// the x-coordinate. - /// the y-coordinate. - /// Point in pixel-size. + /// Convert a coordinates to coordinates which address pixels. + /// Stubbfel, 27.08.2013. + /// the x-coordinate. + /// the y-coordinate. + /// Point in pixel-size. public Point ConverToPixelPoint(double x, double y) { Point p = new Point { X = this.ScaleX * x, Y = this.ScaleY * y }; return p; } - /// - /// Convert a coordinates to coordinates which address pixels - /// - /// not scaled pointd - /// Point in pixel-size + /// Convert a coordinates to coordinates which address pixels. + /// Stubbfel, 14.10.2013. + /// not scaled point. + /// Point in pixel-size. public Point ConverToPixelPoint(Point point) { return this.ConverToPixelPoint(point.X, point.Y); } - /// - /// Convert a coordinates to coordinates which address mapPoint - /// - /// the x-coordinate - /// the y-coordinate - /// Point in pixel-size + /// Convert a coordinates to coordinates which address mapPoint. + /// Stubbfel, 14.10.2013. + /// the x-coordinate. + /// the y-coordinate. + /// Point in pixel-size. public Point ConverToMapPoint(double x, double y) { return new Point { X = x - this.GeoOffsetX, Y = y - this.GeoOffsetY }; } - /// - /// Convert a coordinates to coordinates which address mapPoint - /// - /// not scaled point - /// Point in pixel-size + /// Convert a coordinates to coordinates which address mapPoint. + /// Stubbfel, 14.10.2013. + /// not scaled point. + /// Point in pixel-size. public Point ConverToMapPoint(Point point) { return this.ConverToMapPoint(point.X, point.Y); @@ -262,9 +240,9 @@ namespace CampusAppWP8.Model.Campusmap #region protected - /// Loads the spatial./ - /// Stubbfel, 19.08.2013. - /// list of places + /// Loads the spatial object + /// Stubbfel, 19.08.2013. + /// list of places. protected virtual void LoadSpatials(List placeList) { this.Spatial = new SpsModel(); @@ -275,12 +253,12 @@ namespace CampusAppWP8.Model.Campusmap #region private - /// Creates a pin. - /// Stubbfel, 27.08.2013. - /// The type. - /// list of places - /// image of the pin - /// The new pin. + /// Creates a pin. + /// Stubbfel, 27.08.2013. + /// The type. + /// list of places. + /// image of the pin. + /// The new pin. private MapPinModel CreatePin(MapPinModel.PinType type, List places, Image pinImg) { MapPinModel pin; diff --git a/CampusAppWP8/CampusAppWP8/Model/Campusmap/MapPinModel.cs b/CampusAppWP8/CampusAppWP8/Model/Campusmap/MapPinModel.cs index 79a8cb43..7067bd7d 100644 --- a/CampusAppWP8/CampusAppWP8/Model/Campusmap/MapPinModel.cs +++ b/CampusAppWP8/CampusAppWP8/Model/Campusmap/MapPinModel.cs @@ -1,67 +1,56 @@ //----------------------------------------------------------------------- // -// Company copyright tag. +// The MIT License (MIT). Copyright (c) 2013 BTU/IIT. // -// stubbfel -// 24.06.2013 -//---------------------------------------------------------------------- +// Stubbfel +// 14.10.2013 +// Implements the map pin model class +//----------------------------------------------------------------------- namespace CampusAppWP8.Model.Campusmap { using System.Windows; using System.Windows.Input; using CampusAppWP8.Resources; - /// - /// This Class manage the properties of a MapPin - /// + /// This Class manage the properties of a MapPin. + /// Stubbfel, 14.10.2013. public abstract class MapPinModel { #region Member - /// - /// String for info pins - /// + /// String for info pins. private static string infoPlacePinString = MapPinModel.PinTypeToString(PinType.InfoPlace); - /// - /// String for info pins - /// + /// String for info pins. private static string infoLabPlacePinString = MapPinModel.PinTypeToString(PinType.InfoLabPlace); - /// - /// String for hidden pins - /// + /// String for hidden pins. private static string hiddenPlacePinString = MapPinModel.PinTypeToString(PinType.Hidden); - /// - /// String for search pins - /// + /// String for search pins. private static string searchPlacePinString = MapPinModel.PinTypeToString(PinType.SearchPlace); - /// - /// String for current position pins - /// - private static string currendPositionPlacePinString = MapPinModel.PinTypeToString(PinType.CurrentPosition); + /// String for current position pins. + private static string currentPositionPlacePinString = MapPinModel.PinTypeToString(PinType.CurrentPosition); + /// The information wc place pin string. private static string infoWcPlacePinString = MapPinModel.PinTypeToString(PinType.InfoWcPlace); + /// The information access place pin string. private static string infoAccesPlacePinString = MapPinModel.PinTypeToString(PinType.InfoAccesPlace); + /// The information red place pin string. private static string infoRedPlacePinString = MapPinModel.PinTypeToString(PinType.InfoRedPlace); - - - /// - /// Variable of the actual position of the pin - /// + /// Variable of the actual position of the pin. private Point position; #endregion #region Constructor - /// - /// Initializes a new instance of the class. - /// + + /// Initializes a new instance of the class. + /// Stubbfel, 14.10.2013. public MapPinModel() { } @@ -69,8 +58,9 @@ namespace CampusAppWP8.Model.Campusmap #endregion #region enums - /// Values that represent PinType. - /// Stubbfel, 27.08.2013. + + /// Values that represent PinType. + /// Stubbfel, 27.08.2013. public enum PinType { /// An enum constant representing the hidden option. @@ -84,100 +74,105 @@ namespace CampusAppWP8.Model.Campusmap /// An enum constant representing the info place option. InfoPlace = 3, + + /// An enum constant representing the information lab place option. InfoLabPlace = 4, + + /// An enum constant representing the information wc place option. InfoWcPlace = 5, + + /// An enum constant representing the information red place option. InfoRedPlace = 6, + + /// An enum constant representing the information access place option. InfoAccesPlace = 7 } #endregion #region Property + /// Gets the information red place pin string. + /// The information red place pin string. public static string InfoRedPlacePinString { get { return MapPinModel.infoRedPlacePinString; } } + /// Gets the information access place pin string. + /// The information access place pin string. public static string InfoAccesPlacePinString { get { return MapPinModel.infoAccesPlacePinString; } } + /// Gets the information wc place pin string. + /// The information wc place pin string. public static string InfoWcPlacePinString { get { return MapPinModel.infoWcPlacePinString; } } - /// - /// Gets the string of current position pins - /// - public static string CurrendPositionPlacePinString + /// Gets the string of current position pins. + /// The current position place pin string. + public static string CurrentPositionPlacePinString { - get { return MapPinModel.currendPositionPlacePinString; } + get { return MapPinModel.currentPositionPlacePinString; } } - /// - /// Gets the string of search pins - /// + /// Gets the string of search pins. + /// The search place pin string. public static string SearchPlacePinString { get { return MapPinModel.searchPlacePinString; } } - /// - /// Gets the string of hidden pins - /// + /// Gets the string of hidden pins. + /// The hidden place pin string. public static string HiddenPlacePinString { get { return MapPinModel.hiddenPlacePinString; } } - /// - /// Gets the string of info pins - /// + /// Gets the string of info pins. + /// The information place pin string. public static string InfoPlacePinString { get { return MapPinModel.infoPlacePinString; } } + /// Gets the information lab place pin string. + /// The information lab place pin string. public static string InfoLabPlacePinString { get { return MapPinModel.infoLabPlacePinString; } } - /// - /// Gets or sets the ImageSource of the pin - /// + /// Gets or sets the ImageSource of the pin. + /// The image source. public string ImageSource { get; set; } - /// - /// Gets or sets the ImageWidth of the pin - /// + /// Gets or sets the ImageWidth of the pin. + /// The width of the image. public double ImageWidth { get; set; } - /// - /// Gets or sets the ImageHeight of the pin - /// + /// Gets or sets the ImageHeight of the pin. + /// The height of the image. public double ImageHeight { get; set; } - /// - /// Gets or sets the ZIndex of the pin - /// + /// Gets or sets the ZIndex of the pin. + /// The z coordinate index. public int ZIndex { get; set; } - /// - /// Gets or sets the ImageOffsetX of the pin - /// + /// Gets or sets the ImageOffsetX of the pin. + /// The pin image offset x coordinate. public double PinImageOffsetX { get; set; } - /// - /// Gets or sets the ImageOffsetY of the pin - /// + /// Gets or sets the ImageOffsetY of the pin. + /// The pin image offset y coordinate. public double PinImageOffsetY { get; set; } - /// - /// Gets or sets position of the pin - /// + /// Gets or sets position of the pin. + /// The position. public Point Position { get @@ -213,20 +208,18 @@ namespace CampusAppWP8.Model.Campusmap } } - /// - /// Gets or sets the tag of the pin - /// + /// Gets or sets the tag of the pin. + /// The tag. public object Tag { get; set; } #endregion #region Method - /// - /// Method convert PinType to a string - /// - /// type of the Pin - /// PinType as string + /// Method convert PinType to a string. + /// Stubbfel, 14.10.2013. + /// type of the Pin. + /// PinType as string. public static string PinTypeToString(PinType type) { string result = null; diff --git a/CampusAppWP8/CampusAppWP8/Model/Campusmap/SearchPlacePinModel.cs b/CampusAppWP8/CampusAppWP8/Model/Campusmap/SearchPlacePinModel.cs index aec1cd5b..252be325 100644 --- a/CampusAppWP8/CampusAppWP8/Model/Campusmap/SearchPlacePinModel.cs +++ b/CampusAppWP8/CampusAppWP8/Model/Campusmap/SearchPlacePinModel.cs @@ -1,17 +1,18 @@ //----------------------------------------------------------------------- // -// Company copyright tag. +// The MIT License (MIT). Copyright (c) 2013 BTU/IIT. // -// stubbfel -// 27.08.2013 -//---------------------------------------------------------------------- - +// Stubbfel +// 14.10.2013 +// Implements the search place pin model class +//----------------------------------------------------------------------- namespace CampusAppWP8.Model.Campusmap { using CampusAppWP8.Resources; - /// Search pin place model. - /// Stubbfel, 27.08.2013. + /// Search pin place model. + /// Stubbfel, 27.08.2013. + /// public class SearchPlacePinModel : ClickAblePlacePinModel { #region Constructor @@ -19,7 +20,7 @@ namespace CampusAppWP8.Model.Campusmap /// /// Initializes a new instance of the class. /// - /// Stubbfel, 27.08.2013. + /// Stubbfel, 27.08.2013. public SearchPlacePinModel() { this.ImageSource = Icons.SearchPlace; diff --git a/CampusAppWP8/CampusAppWP8/Pages/Campusmap/CampusMapPage.xaml.cs b/CampusAppWP8/CampusAppWP8/Pages/Campusmap/CampusMapPage.xaml.cs index 8a9b7ab1..2777809c 100644 --- a/CampusAppWP8/CampusAppWP8/Pages/Campusmap/CampusMapPage.xaml.cs +++ b/CampusAppWP8/CampusAppWP8/Pages/Campusmap/CampusMapPage.xaml.cs @@ -738,7 +738,7 @@ namespace CampusAppWP8.Pages.Campusmap } else { - this.ClearMap(new List() { MapPinModel.CurrendPositionPlacePinString }); + this.ClearMap(new List() { MapPinModel.CurrentPositionPlacePinString }); this.SetPinToPosition(lat, log, MapPinModel.PinType.CurrentPosition, scroll); } } diff --git a/CampusAppWP8/CampusAppWP8/Settings.StyleCop b/CampusAppWP8/CampusAppWP8/Settings.StyleCop index bf58560e..acb474fe 100644 --- a/CampusAppWP8/CampusAppWP8/Settings.StyleCop +++ b/CampusAppWP8/CampusAppWP8/Settings.StyleCop @@ -22,6 +22,7 @@ sps Stubbfel uni + wc wifi diff --git a/Doc/atominnerSettings/PrefSets.xml b/Doc/atominnerSettings/PrefSets.xml index 3fd3a41c..e40fd996 100644 --- a/Doc/atominnerSettings/PrefSets.xml +++ b/Doc/atominnerSettings/PrefSets.xml @@ -19,7 +19,7 @@ - + @@ -95,7 +95,7 @@ - +