add docs
This commit is contained in:
@@ -1,26 +1,51 @@
|
||||
using CampusAppWP8.Model.GeoDb;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
//-----------------------------------------------------------------------
|
||||
// <copyright file="CampusMapModel.cs" company="BTU/IIT">
|
||||
// Company copyright tag.
|
||||
// </copyright>
|
||||
// <author>stubbfel</author>
|
||||
// <sience>26.09.2013</sience>
|
||||
//----------------------------------------------------------------------
|
||||
|
||||
namespace CampusAppWP8.Model.Campusmap
|
||||
{
|
||||
using System.Collections.Generic;
|
||||
using CampusAppWP8.Model.GeoDb;
|
||||
|
||||
/// <summary>
|
||||
/// Class for the CampusMapModel
|
||||
/// </summary>
|
||||
public class CampusMapModel : MapModel
|
||||
{
|
||||
#region constructor
|
||||
|
||||
public string CampusId { get; protected set; }
|
||||
|
||||
public CampusMapModel(List<PlaceModel> placeList,string campusId)
|
||||
/// <summary>
|
||||
/// Initializes a new instance of the <see cref="CampusMapModel" /> class.
|
||||
/// </summary>
|
||||
/// <param name="placeList">list of places</param>
|
||||
/// <param name="campusId">id of the campus</param>
|
||||
public CampusMapModel(List<PlaceModel> placeList, string campusId)
|
||||
{
|
||||
this.CampusId = campusId;
|
||||
this.LoadSpatials(placeList);
|
||||
this.IsReady = true;
|
||||
}
|
||||
|
||||
#endregion
|
||||
|
||||
#region property
|
||||
|
||||
/// <summary>
|
||||
/// Gets or sets the campusId
|
||||
/// </summary>
|
||||
public string CampusId { get; protected set; }
|
||||
|
||||
#endregion
|
||||
|
||||
#region method
|
||||
|
||||
/// <summary>Loads the spatial./.</summary>
|
||||
/// <remarks>Stubbfel, 19.08.2013.</remarks>
|
||||
/// <param name="placeList">list of places</param>
|
||||
protected override void LoadSpatials(List<PlaceModel> placeList)
|
||||
{
|
||||
List<PlaceModel> campusPlaces = new List<PlaceModel>();
|
||||
@@ -32,9 +57,11 @@ namespace CampusAppWP8.Model.Campusmap
|
||||
{
|
||||
campusPlaces.Add(place);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
this.Spatial.AddPlaces(campusPlaces);
|
||||
}
|
||||
}
|
||||
|
||||
#endregion
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,12 +1,19 @@
|
||||
using CampusAppWP8.Model.GeoDb;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
//-----------------------------------------------------------------------
|
||||
// <copyright file="ClickAblePlacePinModel.cs" company="BTU/IIT">
|
||||
// Company copyright tag.
|
||||
// </copyright>
|
||||
// <author>stubbfel</author>
|
||||
// <sience>26.09.2013</sience>
|
||||
//----------------------------------------------------------------------
|
||||
|
||||
namespace CampusAppWP8.Model.Campusmap
|
||||
{
|
||||
using System.Collections.Generic;
|
||||
using CampusAppWP8.Model.GeoDb;
|
||||
|
||||
/// <summary>
|
||||
/// abstract class for click abel bins
|
||||
/// </summary>
|
||||
public abstract class ClickAblePlacePinModel : MapPinModel
|
||||
{
|
||||
#region property
|
||||
|
||||
@@ -11,7 +11,9 @@ namespace CampusAppWP8.Model.Campusmap
|
||||
/// <remarks>Stubbfel, 27.08.2013.</remarks>
|
||||
public class HiddenPinPlaceModel : MapPinModel
|
||||
{
|
||||
|
||||
/// <summary>
|
||||
/// Initializes a new instance of the <see cref="HiddenPinPlaceModel" /> class.
|
||||
/// </summary>
|
||||
public HiddenPinPlaceModel()
|
||||
{
|
||||
this.Tag = MapPinModel.HiddenPlacePinString;
|
||||
|
||||
@@ -1,18 +1,23 @@
|
||||
using CampusAppWP8.Resources;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
//-----------------------------------------------------------------------
|
||||
// <copyright file="InfoPlacePinModel.cs" company="BTU/IIT">
|
||||
// Company copyright tag.
|
||||
// </copyright>
|
||||
// <author>stubbfel</author>
|
||||
// <sience>27.08.2013</sience>
|
||||
//----------------------------------------------------------------------
|
||||
|
||||
namespace CampusAppWP8.Model.Campusmap
|
||||
{
|
||||
using CampusAppWP8.Resources;
|
||||
|
||||
/// <summary>Search pin place model.</summary>
|
||||
/// <remarks>Stubbfel, 27.08.2013.</remarks>
|
||||
public class InfoPlacePinModel : ClickAblePlacePinModel
|
||||
{
|
||||
#region Constructor
|
||||
|
||||
/// <summary>
|
||||
/// Initializes a new instance of the <see cref="SearchPlacePinModel" /> class.
|
||||
/// Initializes a new instance of the <see cref="InfoPlacePinModel" /> class.
|
||||
/// </summary>
|
||||
/// <remarks>Stubbfel, 27.08.2013.</remarks>
|
||||
public InfoPlacePinModel()
|
||||
|
||||
@@ -22,7 +22,9 @@ namespace CampusAppWP8.Model.Campusmap
|
||||
{
|
||||
#region Constructors
|
||||
|
||||
|
||||
/// <summary>
|
||||
/// Initializes a new instance of the <see cref="MapModel" /> class.
|
||||
/// </summary>
|
||||
public MapModel()
|
||||
{
|
||||
this.IsReady = false;
|
||||
@@ -31,6 +33,7 @@ namespace CampusAppWP8.Model.Campusmap
|
||||
/// <summary>
|
||||
/// Initializes a new instance of the <see cref="MapModel" /> class.
|
||||
/// </summary>
|
||||
/// <param name="placeList">list of places</param>
|
||||
public MapModel(List<PlaceModel> placeList)
|
||||
{
|
||||
this.IsReady = false;
|
||||
@@ -56,6 +59,9 @@ namespace CampusAppWP8.Model.Campusmap
|
||||
#endregion
|
||||
#region Property
|
||||
|
||||
/// <summary>
|
||||
/// Gets or sets a value indicating whether the map is ready or not
|
||||
/// </summary>
|
||||
public bool IsReady { get; protected set; }
|
||||
|
||||
/// <summary>
|
||||
@@ -257,6 +263,7 @@ namespace CampusAppWP8.Model.Campusmap
|
||||
|
||||
/// <summary>Loads the spatial./</summary>
|
||||
/// <remarks>Stubbfel, 19.08.2013.</remarks>
|
||||
/// <param name="placeList">list of places</param>
|
||||
protected virtual void LoadSpatials(List<PlaceModel> placeList)
|
||||
{
|
||||
this.Spatial = new SpsModel();
|
||||
@@ -299,6 +306,7 @@ namespace CampusAppWP8.Model.Campusmap
|
||||
pin = new HiddenPinPlaceModel();
|
||||
break;
|
||||
}
|
||||
|
||||
pinImg.Tag = pin.Tag;
|
||||
return pin;
|
||||
}
|
||||
|
||||
@@ -17,15 +17,24 @@ namespace CampusAppWP8.Model.Campusmap
|
||||
{
|
||||
#region Member
|
||||
|
||||
/// <summary>
|
||||
/// String for info pins
|
||||
/// </summary>
|
||||
private static string infoPlacePinString = MapPinModel.PinTypeToString(PinType.InfoPlace);
|
||||
|
||||
|
||||
/// <summary>
|
||||
/// String for hidden pins
|
||||
/// </summary>
|
||||
private static string hiddenPlacePinString = MapPinModel.PinTypeToString(PinType.Hidden);
|
||||
|
||||
|
||||
/// <summary>
|
||||
/// String for search pins
|
||||
/// </summary>
|
||||
private static string searchPlacePinString = MapPinModel.PinTypeToString(PinType.SearchPlace);
|
||||
|
||||
|
||||
/// <summary>
|
||||
/// String for current position pins
|
||||
/// </summary>
|
||||
private static string currendPositionPlacePinString = MapPinModel.PinTypeToString(PinType.CurrentPosition);
|
||||
|
||||
/// <summary>
|
||||
@@ -66,6 +75,38 @@ namespace CampusAppWP8.Model.Campusmap
|
||||
|
||||
#region Property
|
||||
|
||||
/// <summary>
|
||||
/// Gets the string of current position pins
|
||||
/// </summary>
|
||||
public static string CurrendPositionPlacePinString
|
||||
{
|
||||
get { return MapPinModel.currendPositionPlacePinString; }
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Gets the string of search pins
|
||||
/// </summary>
|
||||
public static string SearchPlacePinString
|
||||
{
|
||||
get { return MapPinModel.searchPlacePinString; }
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Gets the string of hidden pins
|
||||
/// </summary>
|
||||
public static string HiddenPlacePinString
|
||||
{
|
||||
get { return MapPinModel.hiddenPlacePinString; }
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Gets the string of info pins
|
||||
/// </summary>
|
||||
public static string InfoPlacePinString
|
||||
{
|
||||
get { return MapPinModel.infoPlacePinString; }
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Gets or sets the ImageSource of the pin
|
||||
/// </summary>
|
||||
@@ -81,6 +122,9 @@ namespace CampusAppWP8.Model.Campusmap
|
||||
/// </summary>
|
||||
public double ImageHeight { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// Gets or sets the ZIndex of the pin
|
||||
/// </summary>
|
||||
public int ZIndex { get; set; }
|
||||
|
||||
/// <summary>
|
||||
@@ -131,30 +175,20 @@ namespace CampusAppWP8.Model.Campusmap
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Gets or sets the tag of the pin
|
||||
/// </summary>
|
||||
public object Tag { get; set; }
|
||||
|
||||
public static string CurrendPositionPlacePinString
|
||||
{
|
||||
get { return MapPinModel.currendPositionPlacePinString; }
|
||||
}
|
||||
public static string SearchPlacePinString
|
||||
{
|
||||
get { return MapPinModel.searchPlacePinString; }
|
||||
}
|
||||
|
||||
public static string HiddenPlacePinString
|
||||
{
|
||||
get { return MapPinModel.hiddenPlacePinString; }
|
||||
}
|
||||
|
||||
public static string InfoPlacePinString
|
||||
{
|
||||
get { return MapPinModel.infoPlacePinString; }
|
||||
}
|
||||
#endregion
|
||||
|
||||
#region Method
|
||||
|
||||
/// <summary>
|
||||
/// Method convert PinType to a string
|
||||
/// </summary>
|
||||
/// <param name="type">type of the Pin</param>
|
||||
/// <returns>PinType as string</returns>
|
||||
public static string PinTypeToString(PinType type)
|
||||
{
|
||||
string result = null;
|
||||
@@ -162,21 +196,22 @@ namespace CampusAppWP8.Model.Campusmap
|
||||
switch (type)
|
||||
{
|
||||
case PinType.CurrentPosition:
|
||||
result = "CurrentPositionPin";
|
||||
result = MapPinModel.currendPositionPlacePinString;
|
||||
break;
|
||||
case PinType.Hidden:
|
||||
result = "HiddenPin";
|
||||
result = MapPinModel.hiddenPlacePinString;
|
||||
break;
|
||||
case PinType.InfoPlace:
|
||||
result = "InfoPin";
|
||||
result = MapPinModel.infoPlacePinString;
|
||||
break;
|
||||
case PinType.SearchPlace:
|
||||
result = "SearchPlacePin";
|
||||
result = MapPinModel.searchPlacePinString;
|
||||
break;
|
||||
default:
|
||||
result = string.Empty;
|
||||
break;
|
||||
}
|
||||
|
||||
return result;
|
||||
}
|
||||
#endregion
|
||||
|
||||
@@ -8,8 +8,6 @@
|
||||
|
||||
namespace CampusAppWP8.Model.Campusmap
|
||||
{
|
||||
using System.Collections.Generic;
|
||||
using CampusAppWP8.Model.GeoDb;
|
||||
using CampusAppWP8.Resources;
|
||||
|
||||
/// <summary>Search pin place model.</summary>
|
||||
|
||||
@@ -15,7 +15,9 @@ namespace CampusAppWP8.Pages.Campusmap
|
||||
using System.Runtime.InteropServices.WindowsRuntime;
|
||||
using System.Threading;
|
||||
using System.Windows;
|
||||
using System.Windows.Controls;
|
||||
using System.Windows.Navigation;
|
||||
using CampusAppWP8.File.Places;
|
||||
using CampusAppWP8.Model.Campusmap;
|
||||
using CampusAppWP8.Model.GeoDb;
|
||||
using CampusAppWP8.Resources;
|
||||
@@ -25,9 +27,6 @@ namespace CampusAppWP8.Pages.Campusmap
|
||||
using Microsoft.Phone.Controls;
|
||||
using Microsoft.Phone.Shell;
|
||||
using Windows.Networking.Proximity;
|
||||
using CampusAppWP8.File.Places;
|
||||
using System.Windows.Controls;
|
||||
using System.ComponentModel;
|
||||
|
||||
/// <summary>Class for the campusMap page.</summary>
|
||||
/// <remarks>Stubbfel, 19.08.2013.</remarks>
|
||||
@@ -56,6 +55,16 @@ namespace CampusAppWP8.Pages.Campusmap
|
||||
/// </summary>
|
||||
private bool qrcodeScan = false;
|
||||
|
||||
/// <summary>
|
||||
/// Variable for the last query
|
||||
/// </summary>
|
||||
private string lastQuery;
|
||||
|
||||
/// <summary>
|
||||
/// Flag which indicates the map show information of all buildings
|
||||
/// </summary>
|
||||
private bool buildInfoEnable;
|
||||
|
||||
#endregion
|
||||
|
||||
#region Constructor
|
||||
@@ -66,7 +75,6 @@ namespace CampusAppWP8.Pages.Campusmap
|
||||
{
|
||||
this.InitializeComponent();
|
||||
|
||||
|
||||
ApplicationBarMenuItem menuItem1 = ApplicationBar.MenuItems[0] as ApplicationBarMenuItem;
|
||||
ApplicationBarMenuItem menuItem2 = ApplicationBar.MenuItems[1] as ApplicationBarMenuItem;
|
||||
ApplicationBarMenuItem menuItem3 = ApplicationBar.MenuItems[2] as ApplicationBarMenuItem;
|
||||
@@ -81,7 +89,6 @@ namespace CampusAppWP8.Pages.Campusmap
|
||||
menuItem2.Text = AppResources.CampusMapApp_ScanNfc;
|
||||
}
|
||||
|
||||
|
||||
if (menuItem3 != null)
|
||||
{
|
||||
menuItem3.Text = AppResources.CampusMapApp_EnableBuildInfo;
|
||||
@@ -100,11 +107,16 @@ namespace CampusAppWP8.Pages.Campusmap
|
||||
|
||||
#region Events
|
||||
|
||||
/// <summary>
|
||||
/// Delegate for LoadingPlace events
|
||||
/// </summary>
|
||||
/// <param name="args">the events args</param>
|
||||
public delegate void LoadingPlace(string args);
|
||||
|
||||
/// <summary>
|
||||
/// Event for loading places
|
||||
/// </summary>
|
||||
public event LoadingPlace OnLoadingPlace;
|
||||
private string lastQuery;
|
||||
private bool buildInfoEnable;
|
||||
#endregion
|
||||
|
||||
#region Method
|
||||
@@ -155,12 +167,21 @@ namespace CampusAppWP8.Pages.Campusmap
|
||||
|
||||
#region private
|
||||
|
||||
/// <summary>
|
||||
/// Method set the lastQuery and register to OnLoadingPlace-Event
|
||||
/// </summary>
|
||||
/// <param name="query">the query string</param>
|
||||
/// <param name="action">the event callback</param>
|
||||
private void SetLastQuery(string query, Action<string> action)
|
||||
{
|
||||
this.lastQuery = query;
|
||||
this.OnLoadingPlace = new CampusMapPage.LoadingPlace(action);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Method shows certain places as hidden Pin
|
||||
/// </summary>
|
||||
/// <param name="query">the query string</param>
|
||||
private void ShowPlacesByQueryAsHiddenPin(string query)
|
||||
{
|
||||
if (!this.IsMapReady())
|
||||
@@ -173,9 +194,12 @@ namespace CampusAppWP8.Pages.Campusmap
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Method shows certain places as search Pin
|
||||
/// </summary>
|
||||
/// <param name="query">the query string</param>
|
||||
private void ShowPlacesByQueryAsSearchPin(string query)
|
||||
{
|
||||
|
||||
if (!this.IsMapReady())
|
||||
{
|
||||
this.SetLastQuery(query, this.ShowPlacesByQueryAsSearchPin);
|
||||
@@ -187,21 +211,37 @@ namespace CampusAppWP8.Pages.Campusmap
|
||||
{
|
||||
allPlaces = true;
|
||||
}
|
||||
|
||||
this.ShowPlacesByQuery(query, MapPinModel.PinType.SearchPlace, allPlaces);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Method show all places, which match with the query as a pin
|
||||
/// </summary>
|
||||
/// <param name="query">the query string</param>
|
||||
/// <param name="pintype">the type of the pin</param>
|
||||
/// <param name="allPlaces">if its true then send query to the place file otherwise to the CampusMapModel</param>
|
||||
private void ShowPlacesByQuery(string query, MapPinModel.PinType pintype, bool allPlaces)
|
||||
{
|
||||
this.AddPins(this.SearchPlaces(query, allPlaces), pintype);
|
||||
}
|
||||
|
||||
private void showPlacesByPlaceId(string placeId, MapPinModel.PinType pintype, bool allPlaces)
|
||||
/// <summary>
|
||||
/// Method show all places by placeId
|
||||
/// </summary>
|
||||
/// <param name="placeId">the placeId</param>
|
||||
/// <param name="pintype">the type of the pin</param>
|
||||
/// <param name="allPlaces">if its true then send query to the place file otherwise to the CampusMapModel</param>
|
||||
private void ShowPlacesByPlaceId(string placeId, MapPinModel.PinType pintype, bool allPlaces)
|
||||
{
|
||||
this.AddPinsByPids(new List<string>() { placeId }, pintype, false, allPlaces);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Method shows places by placeId from place file as search Pin
|
||||
/// </summary>
|
||||
/// <param name="placeId">the placeId</param>
|
||||
private void ShowAllPlacesByPlaceIdAsSearchPin(string placeId)
|
||||
{
|
||||
if (!this.IsMapReady())
|
||||
@@ -210,10 +250,14 @@ namespace CampusAppWP8.Pages.Campusmap
|
||||
}
|
||||
else
|
||||
{
|
||||
this.showPlacesByPlaceId(placeId, MapPinModel.PinType.SearchPlace, true);
|
||||
this.ShowPlacesByPlaceId(placeId, MapPinModel.PinType.SearchPlace, true);
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Method shows places by placeId from CampusMapModel as search Pin
|
||||
/// </summary>
|
||||
/// <param name="placeId">the placeId</param>
|
||||
private void ShowPlacesByPlaceIdAsSearchPin(string placeId)
|
||||
{
|
||||
if (!this.IsMapReady())
|
||||
@@ -222,15 +266,19 @@ namespace CampusAppWP8.Pages.Campusmap
|
||||
}
|
||||
else
|
||||
{
|
||||
this.showPlacesByPlaceId(placeId, MapPinModel.PinType.SearchPlace, false);
|
||||
this.ShowPlacesByPlaceId(placeId, MapPinModel.PinType.SearchPlace, false);
|
||||
}
|
||||
}
|
||||
|
||||
private void ShowAllCampusBuilding(string placeId)
|
||||
/// <summary>
|
||||
/// Method show all buildings of a campus
|
||||
/// </summary>
|
||||
/// <param name="campusId">the id of the campus</param>
|
||||
private void ShowAllCampusBuilding(string campusId)
|
||||
{
|
||||
if (!this.IsMapReady())
|
||||
{
|
||||
this.SetLastQuery(placeId, ShowAllCampusBuilding);
|
||||
this.SetLastQuery(campusId, this.ShowAllCampusBuilding);
|
||||
}
|
||||
else
|
||||
{
|
||||
@@ -238,14 +286,23 @@ namespace CampusAppWP8.Pages.Campusmap
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Method check if the map loading is finish
|
||||
/// </summary>
|
||||
/// <returns>true, if the map is ready to use, otherwise false</returns>
|
||||
private bool IsMapReady()
|
||||
{
|
||||
if (this.campusMap == null || !campusMap.IsReady)
|
||||
if (this.campusMap == null || !this.campusMap.IsReady)
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Method will be execute if the place file is ready
|
||||
/// </summary>
|
||||
private void FileIsReady()
|
||||
{
|
||||
this.campusMap = new CBMainMapModel(this.file.Model.Places.ToList());
|
||||
@@ -257,7 +314,7 @@ namespace CampusAppWP8.Pages.Campusmap
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>Button click method.</summary>
|
||||
/// <summary>TextSearch click method.</summary>
|
||||
/// <remarks>Stubbfel, 19.08.2013.</remarks>
|
||||
/// <param name="sender">caller object.</param>
|
||||
/// <param name="e"> some EventArgs.</param>
|
||||
@@ -274,12 +331,17 @@ namespace CampusAppWP8.Pages.Campusmap
|
||||
this.ShowPlacesByQueryAsSearchPin(query);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Method insert or remove the buildings pins
|
||||
/// </summary>
|
||||
/// <param name="sender">caller object.</param>
|
||||
/// <param name="e"> some EventArgs.</param>
|
||||
private void ShowBuildingsInformation(object sender, EventArgs e)
|
||||
{
|
||||
string menuText;
|
||||
if (!this.buildInfoEnable)
|
||||
{
|
||||
this.ShowAllCampusBuilding("");
|
||||
this.ShowAllCampusBuilding(string.Empty);
|
||||
this.buildInfoEnable = true;
|
||||
menuText = AppResources.CampusMapApp_DisableBuildInfo;
|
||||
}
|
||||
@@ -294,9 +356,12 @@ namespace CampusAppWP8.Pages.Campusmap
|
||||
item.Text = menuText;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Method clear the Map
|
||||
/// </summary>
|
||||
/// <param name="removeTags">(optional) tags of the UIElement</param>
|
||||
private void ClearMap(List<string> removeTags = null)
|
||||
{
|
||||
|
||||
if (removeTags == null)
|
||||
{
|
||||
MapCanvas.Children.Clear();
|
||||
@@ -319,14 +384,15 @@ namespace CampusAppWP8.Pages.Campusmap
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Method adds pin to the map by given list of placeId
|
||||
/// </summary>
|
||||
/// <param name="pidList">list of placeId</param>
|
||||
/// <param name="pinType">type of pin</param>
|
||||
/// <param name="clearCanvas">(optional) if its true, clear canvas before adding</param>
|
||||
/// <param name="allPlaces">(optional) if its true, load place from place file, otherwise from CampusMapModel</param>
|
||||
private void AddPinsByPids(List<string> pidList, MapPinModel.PinType pinType, bool clearCanvas = true, bool allPlaces = false)
|
||||
{
|
||||
// clear canvas
|
||||
@@ -453,6 +519,7 @@ namespace CampusAppWP8.Pages.Campusmap
|
||||
/// <summary>Searches for the first places.</summary>
|
||||
/// <remarks>Stubbfel, 19.08.2013.</remarks>
|
||||
/// <param name="query">The query.</param>
|
||||
/// <param name="allPlaces">(optional) if its true, search places in place file, otherwise in CampusMapModel</param>
|
||||
/// <returns>The found places.</returns>
|
||||
private List<PlaceModel> SearchPlaces(string query, bool allPlaces = false)
|
||||
{
|
||||
@@ -480,7 +547,6 @@ namespace CampusAppWP8.Pages.Campusmap
|
||||
this.informationsNames.Add(Constants.PisInformationName_ShortName);
|
||||
}
|
||||
|
||||
|
||||
return spatial.GetPlacesByInformation(query, true, this.informationsNames);
|
||||
}
|
||||
|
||||
@@ -497,6 +563,7 @@ namespace CampusAppWP8.Pages.Campusmap
|
||||
{
|
||||
continue;
|
||||
}
|
||||
|
||||
GeoCoordinate coor = place.GeoRefPoint;
|
||||
if (coor != null)
|
||||
{
|
||||
@@ -661,7 +728,6 @@ namespace CampusAppWP8.Pages.Campusmap
|
||||
|
||||
foreach (PlaceModel place in places)
|
||||
{
|
||||
|
||||
if (place.ParentId.Equals(this.campusMap.CampusId) && this.HasRooms(place.PlaceId))
|
||||
{
|
||||
MessageBoxResult msgResult = MessageBoxes.ShowPlaceInfoOkCancelMessageBox(AppResources.MsgBox_ShowRoomList);
|
||||
@@ -691,6 +757,7 @@ namespace CampusAppWP8.Pages.Campusmap
|
||||
return true;
|
||||
}
|
||||
}
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
|
||||
@@ -19,10 +19,10 @@ namespace CampusAppWP8.Pages.Dev
|
||||
using System.Windows;
|
||||
using System.Windows.Media.Imaging;
|
||||
using CampusAppWP8.Resources;
|
||||
using CampusAppWP8.Utility;
|
||||
using Microsoft.Devices;
|
||||
using Microsoft.Phone.Controls;
|
||||
using ZXing;
|
||||
using CampusAppWP8.Utility;
|
||||
|
||||
/// <summary>
|
||||
/// QR Code scanner.
|
||||
@@ -36,20 +36,23 @@ namespace CampusAppWP8.Pages.Dev
|
||||
|
||||
/// <summary>Thread for transfer the preview image to the reader.</summary>
|
||||
private Thread captureThread = null;
|
||||
|
||||
|
||||
/// <summary>For ending the thread.</summary>
|
||||
private volatile bool captureThreadExit = false;
|
||||
|
||||
|
||||
/// <summary>QR reader object.</summary>
|
||||
private IBarcodeReader barcodeReader = null;
|
||||
|
||||
|
||||
/// <summary>Bitmap for transfer the camera image to the reader.</summary>
|
||||
private WriteableBitmap bit = null;
|
||||
|
||||
/// <summary>true if this object is in autofocus. </summary>
|
||||
private bool isInAutofocus = false;
|
||||
|
||||
private string ResultAppStoreKey;
|
||||
/// <summary>
|
||||
/// Variable for the storage key of the result
|
||||
/// </summary>
|
||||
private string resultAppStoreKey;
|
||||
|
||||
#endregion
|
||||
|
||||
@@ -78,13 +81,14 @@ namespace CampusAppWP8.Pages.Dev
|
||||
{
|
||||
if (NavigationContext.QueryString.ContainsKey(Constants.ParamQRResultKey))
|
||||
{
|
||||
this.ResultAppStoreKey = NavigationContext.QueryString[Constants.ParamQRResultKey];
|
||||
this.resultAppStoreKey = NavigationContext.QueryString[Constants.ParamQRResultKey];
|
||||
}
|
||||
|
||||
this.cam = new PhotoCamera(CameraType.Primary);
|
||||
this.cam.Initialized += new EventHandler<CameraOperationCompletedEventArgs>(this.Cam_Initialized);
|
||||
this.cam.AutoFocusCompleted += new EventHandler<CameraOperationCompletedEventArgs>(this.Cam_AutoFocusCompl);
|
||||
this.bit = new WriteableBitmap((int)this.cam.PreviewResolution.Width, (int)this.cam.PreviewResolution.Height);
|
||||
|
||||
|
||||
this.camViewBrush.SetSource(this.cam);
|
||||
}
|
||||
else
|
||||
@@ -95,7 +99,7 @@ namespace CampusAppWP8.Pages.Dev
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
/// <summary>
|
||||
/// Is called when this page will not be the current page of a frame.
|
||||
/// </summary>
|
||||
@@ -106,7 +110,7 @@ namespace CampusAppWP8.Pages.Dev
|
||||
{
|
||||
this.captureThreadExit = true;
|
||||
this.captureThread.Join();
|
||||
|
||||
|
||||
this.cam.Dispose();
|
||||
|
||||
this.bit = null;
|
||||
@@ -123,23 +127,23 @@ namespace CampusAppWP8.Pages.Dev
|
||||
|
||||
switch (e.Orientation)
|
||||
{
|
||||
case PageOrientation.Landscape:
|
||||
this.camViewBrushTransform.Rotation = 0;
|
||||
case PageOrientation.Landscape:
|
||||
this.camViewBrushTransform.Rotation = 0;
|
||||
break;
|
||||
case PageOrientation.LandscapeLeft:
|
||||
this.camViewBrushTransform.Rotation = 0;
|
||||
case PageOrientation.LandscapeLeft:
|
||||
this.camViewBrushTransform.Rotation = 0;
|
||||
break;
|
||||
case PageOrientation.LandscapeRight:
|
||||
this.camViewBrushTransform.Rotation = 180;
|
||||
case PageOrientation.LandscapeRight:
|
||||
this.camViewBrushTransform.Rotation = 180;
|
||||
break;
|
||||
case PageOrientation.Portrait:
|
||||
this.camViewBrushTransform.Rotation = 90;
|
||||
case PageOrientation.Portrait:
|
||||
this.camViewBrushTransform.Rotation = 90;
|
||||
break;
|
||||
case PageOrientation.PortraitUp:
|
||||
this.camViewBrushTransform.Rotation = 90;
|
||||
case PageOrientation.PortraitUp:
|
||||
this.camViewBrushTransform.Rotation = 90;
|
||||
break;
|
||||
case PageOrientation.PortraitDown:
|
||||
this.camViewBrushTransform.Rotation = 270;
|
||||
case PageOrientation.PortraitDown:
|
||||
this.camViewBrushTransform.Rotation = 270;
|
||||
break;
|
||||
}
|
||||
}
|
||||
@@ -187,11 +191,11 @@ namespace CampusAppWP8.Pages.Dev
|
||||
if (this.cam.IsFocusAtPointSupported == true)
|
||||
{
|
||||
Point pos = e.GetPosition(this.camView);
|
||||
|
||||
|
||||
this.cam.FocusAtPoint(
|
||||
pos.Y / this.camView.ActualHeight,
|
||||
pos.Y / this.camView.ActualHeight,
|
||||
1.0 - (pos.X / this.camView.ActualWidth));
|
||||
|
||||
|
||||
this.isInAutofocus = true;
|
||||
}
|
||||
else if (this.cam.IsFocusSupported == true)
|
||||
@@ -212,17 +216,16 @@ namespace CampusAppWP8.Pages.Dev
|
||||
Array.Copy(img, this.bit.Pixels, img.Length);
|
||||
|
||||
var result = this.barcodeReader.Decode(this.bit);
|
||||
|
||||
|
||||
if (result != null)
|
||||
{
|
||||
Dispatcher.BeginInvoke(delegate
|
||||
{
|
||||
if (this.ResultAppStoreKey != null)
|
||||
if (this.resultAppStoreKey != null)
|
||||
{
|
||||
|
||||
if (NavigationService.CanGoBack)
|
||||
{
|
||||
App.SaveToIsolatedStorage(this.ResultAppStoreKey, result.Text);
|
||||
App.SaveToIsolatedStorage(this.resultAppStoreKey, result.Text);
|
||||
NavigationService.GoBack();
|
||||
}
|
||||
else
|
||||
@@ -258,7 +261,7 @@ namespace CampusAppWP8.Pages.Dev
|
||||
|
||||
this.OnCaptureImage(buffer, (int)resolution.Width, (int)resolution.Height);
|
||||
}
|
||||
|
||||
|
||||
System.Threading.Thread.Sleep(1000);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<Deployment xmlns="http://schemas.microsoft.com/windowsphone/2012/deployment" AppPlatformVersion="8.0">
|
||||
<DefaultLanguage xmlns="" code="de-DE" />
|
||||
<App xmlns="" ProductID="{120b88cc-f3f0-4c5a-a3fd-c26e835338cc}" Title="CampusAppWP8" RuntimeType="Silverlight" Version="1.0.0.0" Genre="apps.normal" Author="CampusAppWP8 author" Description="Die BTU-CampusApp für WP8" Publisher="CampusAppWP8" PublisherID="{3511cc48-91b0-4ffb-9023-b69a81021a46}">
|
||||
<App xmlns="" ProductID="{120b88cc-f3f0-4c5a-a3fd-c26e835338cc}" Title="BTU-CampusApp" RuntimeType="Silverlight" Version="1.0.0.0" Genre="apps.normal" Author="CampusAppWP8 author" Description="Die BTU-CampusApp für WP8" Publisher="CampusAppWP8" PublisherID="{3511cc48-91b0-4ffb-9023-b69a81021a46}">
|
||||
<IconPath IsRelative="true" IsResource="false">Assets\ApplicationIcon.png</IconPath>
|
||||
<Capabilities>
|
||||
<Capability Name="ID_CAP_NETWORKING" />
|
||||
@@ -26,7 +26,7 @@
|
||||
<SmallImageURI IsRelative="true" IsResource="false">Assets\Tiles\kachel_small.png</SmallImageURI>
|
||||
<Count>0</Count>
|
||||
<IconImageURI IsRelative="true" IsResource="false">Assets\Tiles\kachel_medium.png</IconImageURI>
|
||||
<Title>BTU-CampusAp</Title>
|
||||
<Title>BTU-CampusApp</Title>
|
||||
<Message>
|
||||
</Message>
|
||||
<BackgroundColor>
|
||||
|
||||
@@ -1,20 +1,30 @@
|
||||
using CampusAppWP8.Resources;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
using System.Windows.Navigation;
|
||||
//-----------------------------------------------------------------------
|
||||
// <copyright file="AppUriMapper.cs" company="BTU/IIT">
|
||||
// Company copyright tag.
|
||||
// </copyright>
|
||||
// <author>stubbfel</author>
|
||||
// <sience>26.09.2013</sience>
|
||||
//----------------------------------------------------------------------
|
||||
|
||||
namespace CampusAppWP8.Utility
|
||||
{
|
||||
public class AppUriMapper : UriMapperBase
|
||||
{
|
||||
private string tempUri;
|
||||
using System;
|
||||
using System.Windows.Navigation;
|
||||
using CampusAppWP8.Resources;
|
||||
|
||||
public override Uri MapUri(Uri uri)
|
||||
/// <summary>
|
||||
/// Class map Uri to AppPages
|
||||
/// </summary>
|
||||
public class AppUriMapper : UriMapperBase
|
||||
{
|
||||
/// <summary>
|
||||
/// Method overrides MapUri from UriMapperBase
|
||||
/// </summary>
|
||||
/// <param name="uri">the url</param>
|
||||
/// <returns>the mapped url</returns>
|
||||
public override Uri MapUri(Uri uri)
|
||||
{
|
||||
tempUri = uri.ToString();
|
||||
string tempUri = uri.ToString();
|
||||
|
||||
// Look for a URI from the lens picker.
|
||||
if (tempUri.Contains("ViewfinderLaunch"))
|
||||
|
||||
Reference in New Issue
Block a user