att roomlistpage

This commit is contained in:
stubbfel
2013-09-23 13:09:27 +02:00
parent 94c538a429
commit 4047aacf0f
9 changed files with 203 additions and 11 deletions

View File

@@ -112,12 +112,15 @@
<Compile Include="File\Exams\ExamFile.cs" />
<Compile Include="File\Places\PlacesFile.cs" />
<Compile Include="Model\BinaryModel.cs" />
<Compile Include="Model\Campusmap\CampusMapModel.cs" />
<Compile Include="Model\Campusmap\CBMainMapModel.cs" />
<Compile Include="Model\Campusmap\CurrentPositionPinModel.cs" />
<Compile Include="Model\Campusmap\HiddenPinPlaceModel.cs" />
<Compile Include="Model\Campusmap\SearchPlacePinModel.cs" />
<Compile Include="Model\Exams\ExamListModel.cs" />
<Compile Include="Model\Exams\ExamModel.cs" />
<Compile Include="Model\GeoDb\CampusBuildingLayerModel.cs" />
<Compile Include="Model\GeoDb\CampusBuildingModel.cs" />
<Compile Include="Model\GeoDb\PlaceInformation.cs" />
<Compile Include="Model\GeoDb\PlaceModel.cs" />
<Compile Include="Model\GeoDb\PlaceService.cs" />
@@ -131,6 +134,9 @@
<Compile Include="Model\Utility\CourseModel.cs" />
<Compile Include="Model\Utility\DegreeListPickerItemListModel.cs" />
<Compile Include="Model\Utility\CampusListPickerItemListModel.cs" />
<Compile Include="Pages\Campusmap\RoomListPage.xaml.cs">
<DependentUpon>RoomListPage.xaml</DependentUpon>
</Compile>
<Compile Include="Pages\Exams\Exams.xaml.cs">
<DependentUpon>Exams.xaml</DependentUpon>
</Compile>
@@ -294,6 +300,10 @@
<SubType>Designer</SubType>
<Generator>MSBuild:Compile</Generator>
</Page>
<Page Include="Pages\Campusmap\RoomListPage.xaml">
<SubType>Designer</SubType>
<Generator>MSBuild:Compile</Generator>
</Page>
<Page Include="Pages\Departments\DepartmentFavoritePage.xaml">
<SubType>Designer</SubType>
<Generator>MSBuild:Compile</Generator>

View File

@@ -15,7 +15,7 @@ namespace CampusAppWP8.Model.Campusmap
/// <summary>
/// Class for the MapModel of the mainCampus of cottbus
/// </summary>
public class CBMainMapModel : MapModel
public class CBMainMapModel : CampusMapModel
{
#region Member
@@ -46,6 +46,7 @@ namespace CampusAppWP8.Model.Campusmap
this.ScaleY = 197648.8919266073;
this.GeoOffsetX = 14.327159;
this.GeoOffsetY = 51.766548;
this.CampusId = CBMainMapModel.Campus;
}
#endregion

View File

@@ -0,0 +1,13 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace CampusAppWP8.Model.Campusmap
{
public class CampusMapModel : MapModel
{
public string CampusId { get; protected set; }
}
}

View File

@@ -0,0 +1,30 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace CampusAppWP8.Model.GeoDb
{
public class CampusBuildingLayerModel
{
public CampusBuildingLayerModel(string layerId, List<PlaceModel> places)
{
this.LayerId = layerId;
this.Rooms = new List<PlaceModel>();
foreach (PlaceModel place in places)
{
string placeLayerId = place.GetInformationsValue("Ebene");
if (placeLayerId != null && placeLayerId.Equals(layerId))
{
this.Rooms.Add(place);
}
}
}
public List<PlaceModel> Rooms {get; set;}
public string LayerId { get; set; }
}
}

View File

@@ -0,0 +1,46 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace CampusAppWP8.Model.GeoDb
{
public class CampusBuildingModel
{
public CampusBuildingModel(string buildingId, List<PlaceModel> places)
{
this.Layers = new Dictionary<string, CampusBuildingLayerModel>();
foreach (PlaceModel place in places)
{
if (place.ParentId.Equals(buildingId))
{
string placeLayerId = place.GetInformationsValue("Ebene");
if (placeLayerId == null)
{
continue;
}
if (this.Layers.ContainsKey(placeLayerId))
{
this.Layers[placeLayerId].Rooms.Add(place);
}
else
{
this.Layers.Add(placeLayerId, new CampusBuildingLayerModel(placeLayerId, new List<PlaceModel>() { place }));
}
}
else if (place.PlaceId.Equals(buildingId))
{
this.Building = place;
}
}
}
public Dictionary<string, CampusBuildingLayerModel> Layers { get; private set; }
public PlaceModel Building { get; set; }
}
}

View File

@@ -11,6 +11,7 @@ namespace CampusAppWP8.Pages.Campusmap
using System.Collections.Generic;
using System.Device.Location;
using System.Globalization;
using System.Linq;
using System.Runtime.InteropServices.WindowsRuntime;
using System.Threading;
using System.Windows;
@@ -35,7 +36,7 @@ namespace CampusAppWP8.Pages.Campusmap
private readonly ProximityDevice device = ProximityDevice.GetDefault();
/// <summary>Variable for the map model.</summary>
private MapModel map;
private CampusMapModel campusMap;
/// <summary>
/// List of information names
@@ -56,9 +57,9 @@ namespace CampusAppWP8.Pages.Campusmap
public CampusMapPage()
{
this.InitializeComponent();
this.map = new CBMainMapModel();
this.MapCanvas.DataContext = this.map;
this.map.ShowMapInfos += new CBMainMapModel.MapInfos(this.ShowMapInfo);
this.campusMap = new CBMainMapModel();
this.MapCanvas.DataContext = this.campusMap;
this.campusMap.ShowMapInfos += new CBMainMapModel.MapInfos(this.ShowMapInfo);
ApplicationBarMenuItem menuItem1 = ApplicationBar.MenuItems[0] as ApplicationBarMenuItem;
ApplicationBarMenuItem menuItem2 = ApplicationBar.MenuItems[1] as ApplicationBarMenuItem;
@@ -86,7 +87,7 @@ namespace CampusAppWP8.Pages.Campusmap
protected override void OnNavigatedTo(NavigationEventArgs e)
{
base.OnNavigatedTo(e);
if (this.map.Spatial == null)
if (this.campusMap.Spatial == null)
{
return;
}
@@ -153,7 +154,7 @@ namespace CampusAppWP8.Pages.Campusmap
foreach (string pid in pidList)
{
tmpPlace = this.map.Spatial.GetPlaceById(pid);
tmpPlace = this.campusMap.Spatial.GetPlaceById(pid);
if (tmpPlace != null)
{
placeList.Add(tmpPlace);
@@ -284,7 +285,7 @@ namespace CampusAppWP8.Pages.Campusmap
this.informationsNames.Add(Constants.PisInformationName_ShortName);
}
return this.map.Spatial.GetPlacesByInformation(query, true, this.informationsNames);
return this.campusMap.Spatial.GetPlacesByInformation(query, true, this.informationsNames);
}
/// <summary>Adds the pins.</summary>
@@ -315,8 +316,8 @@ namespace CampusAppWP8.Pages.Campusmap
/// <param name="assocPlaces">(Optional) List of places, whose are associative with the pin</param>
private void AddPin(double x, double y, MapPinModel.PinType type, bool scroll = true, List<PlaceModel> assocPlaces = null)
{
Point scrollPoint = this.map.GetScrollPoint(this.map.ConverToPixelPoint(this.map.ConverToMapPoint(x, y)));
MapCanvas.Children.Add(this.map.AddPinFromRefPoint(this.map.ConverToPixelPoint(this.map.ConverToMapPoint(x, y)), type, assocPlaces));
Point scrollPoint = this.campusMap.GetScrollPoint(this.campusMap.ConverToPixelPoint(this.campusMap.ConverToMapPoint(x, y)));
MapCanvas.Children.Add(this.campusMap.AddPinFromRefPoint(this.campusMap.ConverToPixelPoint(this.campusMap.ConverToMapPoint(x, y)), type, assocPlaces));
MapScroller.UpdateLayout();
if (scroll)
@@ -435,6 +436,11 @@ namespace CampusAppWP8.Pages.Campusmap
msgText += AppResources.PlaceLabel_ShortDesc + ": ";
msgText += place.GetInformationsValue(Constants.PisInformationName_ShortDesc);
msgText = Wp8StringManager.AddNewLine(msgText);
if (place.ParentId.Equals(this.campusMap.CampusId))
{
CampusBuildingModel biulding = new CampusBuildingModel(place.PlaceId, campusMap.Spatial.Places.ToList());
}
}
MessageBoxes.ShowMainModelInfoMessageBox(msgText);

View File

@@ -0,0 +1,32 @@
<phone:PhoneApplicationPage
x:Class="CampusAppWP8.Pages.Campusmap.RoomListPage"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:phone="clr-namespace:Microsoft.Phone.Controls;assembly=Microsoft.Phone"
xmlns:shell="clr-namespace:Microsoft.Phone.Shell;assembly=Microsoft.Phone"
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
mc:Ignorable="d"
FontFamily="{StaticResource PhoneFontFamilyNormal}"
FontSize="{StaticResource PhoneFontSizeNormal}"
Foreground="{StaticResource PhoneForegroundBrush}"
SupportedOrientations="Portrait" Orientation="Portrait"
shell:SystemTray.IsVisible="True">
<!--LayoutRoot ist das Stammraster, in dem alle anderen Seiteninhalte platziert werden-->
<Grid x:Name="LayoutRoot" Background="Transparent">
<!--Pivotsteuerelement-->
<phone:Pivot Title="{Binding LocalizedResources.CampusMapApp_Title, Source={StaticResource LocalizedStrings}}" Style="{StaticResource PhoneTextNormalStyle}">
<!--Pivotelement eins-->
<phone:PivotItem Header="item1">
<Grid/>
</phone:PivotItem>
<!--Pivotelement zwei-->
<phone:PivotItem Header="item2">
<Grid/>
</phone:PivotItem>
</phone:Pivot>
</Grid>
</phone:PhoneApplicationPage>

View File

@@ -0,0 +1,54 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Net;
using System.Windows;
using System.Windows.Controls;
using System.Windows.Navigation;
using Microsoft.Phone.Controls;
using Microsoft.Phone.Shell;
using CampusAppWP8.File.Places;
namespace CampusAppWP8.Pages.Campusmap
{
public partial class RoomListPage : PhoneApplicationPage
{
private PlacesFile placeFile;
public RoomListPage()
{
InitializeComponent();
}
protected override void OnNavigatedTo(NavigationEventArgs e)
{
base.OnNavigatedTo(e);
if (NavigationMode.Back == e.NavigationMode)
{
if (this.placeFile == null)
{
this.placeFile = new PlacesFile();
this.placeFile.OnLoaded += new PlacesFile.OnIO(this.PlacesFileIsReady);
this.placeFile.OnFailedLoad += new PlacesFile.OnFailed(this.PlacesFileIsFail);
this.placeFile.LoadData();
}
}
}
private void PlacesFileIsFail()
{
throw new NotImplementedException();
}
private void PlacesFileIsReady()
{
throw new NotImplementedException();
}
private void setupPivot()
{
}
}
}

View File

@@ -127,7 +127,7 @@ namespace CampusAppWP8.Utility
}
else
{
retValue.AddRange(GetChild(child as DependencyObject, elemName));
retValue.AddRange(Utilities.GetChild(child as DependencyObject, elemName));
}
}