#269 done
This commit is contained in:
@@ -236,6 +236,7 @@
|
||||
<Compile Include="Utility\BackgroundTasks.cs" />
|
||||
<Compile Include="Utility\BoolToVisibilityConverter.cs" />
|
||||
<Compile Include="Utility\FrameworkAnimator.cs" />
|
||||
<Compile Include="Utility\IdToPlaceConverter.cs" />
|
||||
<Compile Include="Utility\ListFiller.cs" />
|
||||
<Compile Include="Utility\Lui\Button\AddButton.cs" />
|
||||
<Compile Include="Utility\Lui\Button\AddPersonButton.cs" />
|
||||
@@ -281,8 +282,6 @@
|
||||
<Compile Include="Model\Lecture\LectureWp8List.cs" />
|
||||
<Compile Include="Model\Lecture\LecturePageModel.cs" />
|
||||
<Compile Include="Model\MainModel.cs" />
|
||||
<Compile Include="Model\Openinghours\OpeninghoursInstitutionWp8Model.cs" />
|
||||
<Compile Include="Model\Openinghours\OpeninghoursWp8Model.cs" />
|
||||
<Compile Include="Model\XmlModel.cs" />
|
||||
<Compile Include="Pages\Campusmap\CampusMapPage.xaml.cs">
|
||||
<DependentUpon>CampusMapPage.xaml</DependentUpon>
|
||||
|
||||
@@ -11,15 +11,15 @@ namespace CampusAppWP8.Feed.Openinghours
|
||||
using System;
|
||||
using System.IO;
|
||||
using CampusAppWP8.Model;
|
||||
using CampusAppWP8.Model.Openinghours;
|
||||
using CampusAppWP8.Resources;
|
||||
using CampusAppWP8.Utility;
|
||||
using CampusAppWPortalLib8.Model;
|
||||
using CampusAppWPortalLib8.Model.Openinghours;
|
||||
|
||||
/// <summary> This Class is for MesaFeeds. </summary>
|
||||
/// <remarks> fiedlchr, 14.10.2013. </remarks>
|
||||
/// <seealso cref="T:CampusAppWP8.Model.XmlModel{CampusAppWP8.Model.Openinghours.OpeninghoursWp8Model}"/>
|
||||
public class OpeninghoursFeed : XmlModel<OpeninghoursWp8Model>
|
||||
public class OpeninghoursFeed : XmlModel<OpeninghoursModel>
|
||||
{
|
||||
#region Constructor
|
||||
|
||||
@@ -41,7 +41,7 @@ namespace CampusAppWP8.Feed.Openinghours
|
||||
/// <remarks> fiedlchr, 14.10.2013. </remarks>
|
||||
/// <param name="model"> reference of the FeedModel. </param>
|
||||
/// <returns> true, if model is up-to-date, otherwise false. </returns>
|
||||
private bool CheckIsModelUpToDate(OpeninghoursWp8Model model)
|
||||
private bool CheckIsModelUpToDate(OpeninghoursModel model)
|
||||
{
|
||||
bool retValue = true;
|
||||
|
||||
@@ -62,7 +62,7 @@ namespace CampusAppWP8.Feed.Openinghours
|
||||
/// <param name="model"> reference of the FeedModel. </param>
|
||||
/// <param name="info"> info about the file. </param>
|
||||
/// <returns> true, if file is up-to-date, otherwise false. </returns>
|
||||
private bool CheckIsFileUpToDateOnLoad(OpeninghoursWp8Model model, FileInfo info)
|
||||
private bool CheckIsFileUpToDateOnLoad(OpeninghoursModel model, FileInfo info)
|
||||
{
|
||||
bool retValue = true;
|
||||
|
||||
@@ -82,7 +82,7 @@ namespace CampusAppWP8.Feed.Openinghours
|
||||
/// <param name="model"> reference of the FeedModel. </param>
|
||||
/// <param name="info"> info about the file. </param>
|
||||
/// <returns> true, if file is up-to-date, otherwise false. </returns>
|
||||
private bool CheckIsFileUpToDateOnSave(OpeninghoursWp8Model model, FileInfo info)
|
||||
private bool CheckIsFileUpToDateOnSave(OpeninghoursModel model, FileInfo info)
|
||||
{
|
||||
bool retValue = true;
|
||||
|
||||
|
||||
@@ -1,156 +0,0 @@
|
||||
//-----------------------------------------------------------------------------
|
||||
// <copyright file="OpeninghoursInstitutionWp8Model.cs" company="BTU/IIT">
|
||||
// Company copyright tag.
|
||||
// </copyright>
|
||||
// <author>fiedlchr</author>
|
||||
// <sience>24.06.2013</sience>
|
||||
//-----------------------------------------------------------------------------
|
||||
|
||||
namespace CampusAppWP8.Model.Openinghours
|
||||
{
|
||||
using System.Globalization;
|
||||
using System.Windows;
|
||||
using System.Xml.Serialization;
|
||||
|
||||
/// <summary>
|
||||
/// Model for menu
|
||||
/// </summary>
|
||||
public class OpeninghoursInstitutionWp8Model : CampusAppWPortalLib8.Model.Openinghours.OpeninghoursInstitutionModel
|
||||
{
|
||||
#region Property
|
||||
|
||||
/// <summary>
|
||||
/// Gets the visibility state of the monday TextBlock.
|
||||
/// </summary>
|
||||
public Visibility VisibleMonday
|
||||
{
|
||||
get
|
||||
{
|
||||
return ((this.Monday == string.Empty) || (this.Monday.Length == 0)) ? Visibility.Collapsed : Visibility.Visible;
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Gets the visibility state of the tuesday TextBlock.
|
||||
/// </summary>
|
||||
public Visibility VisibleTuesday
|
||||
{
|
||||
get
|
||||
{
|
||||
return ((this.Tuesday == string.Empty) || (this.Tuesday.Length == 0)) ? Visibility.Collapsed : Visibility.Visible;
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Gets the visibility state of the wednesday TextBlock.
|
||||
/// </summary>
|
||||
public Visibility VisibleWednesday
|
||||
{
|
||||
get
|
||||
{
|
||||
return ((this.Wednesday == string.Empty) || (this.Wednesday.Length == 0)) ? Visibility.Collapsed : Visibility.Visible;
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Gets the visibility state of the thursday TextBlock.
|
||||
/// </summary>
|
||||
public Visibility VisibleThursday
|
||||
{
|
||||
get
|
||||
{
|
||||
return ((this.Thursday == string.Empty) || (this.Thursday.Length == 0)) ? Visibility.Collapsed : Visibility.Visible;
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Gets the visibility state of the friday TextBlock.
|
||||
/// </summary>
|
||||
public Visibility VisibleFriday
|
||||
{
|
||||
get
|
||||
{
|
||||
return ((this.Friday == string.Empty) || (this.Friday.Length == 0)) ? Visibility.Collapsed : Visibility.Visible;
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Gets the visibility state of the saturday TextBlock.
|
||||
/// </summary>
|
||||
public Visibility VisibleSaturday
|
||||
{
|
||||
get
|
||||
{
|
||||
return ((this.Saturday == string.Empty) || (this.Saturday.Length == 0)) ? Visibility.Collapsed : Visibility.Visible;
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Gets the visibility state of the sunday TextBlock.
|
||||
/// </summary>
|
||||
public Visibility VisibleSunday
|
||||
{
|
||||
get
|
||||
{
|
||||
return ((this.Sunday == string.Empty) || (this.Sunday.Length == 0)) ? Visibility.Collapsed : Visibility.Visible;
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Gets the visibility state of the comment.
|
||||
/// </summary>
|
||||
public Visibility VisibleComment
|
||||
{
|
||||
get
|
||||
{
|
||||
return ((this.Comment == string.Empty) || (this.Comment.Length == 0)) ? Visibility.Collapsed : Visibility.Visible;
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Gets the visibility state of the email address.
|
||||
/// </summary>
|
||||
public Visibility VisibleEMail
|
||||
{
|
||||
get
|
||||
{
|
||||
return ((this.EMail == string.Empty) || (this.EMail.Length == 0)) ? Visibility.Collapsed : Visibility.Visible;
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Gets the visibility state of the phone number.
|
||||
/// </summary>
|
||||
public Visibility VisiblePhone
|
||||
{
|
||||
get
|
||||
{
|
||||
return ((this.Phone == string.Empty) || (this.Phone.Length == 0)) ? Visibility.Collapsed : Visibility.Visible;
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Gets the visibility state of the room.
|
||||
/// </summary>
|
||||
public Visibility VisibleRoom
|
||||
{
|
||||
get
|
||||
{
|
||||
return ((this.Room == string.Empty) || (this.Room.Length == 0)) ? Visibility.Collapsed : Visibility.Visible;
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Gets the visibility state of the building.
|
||||
/// </summary>
|
||||
public Visibility VisibleBuilding
|
||||
{
|
||||
get
|
||||
{
|
||||
return ((this.Building == string.Empty) || (this.Building.Length == 0)) ? Visibility.Collapsed : Visibility.Visible;
|
||||
}
|
||||
}
|
||||
|
||||
#endregion
|
||||
}
|
||||
}
|
||||
@@ -1,20 +0,0 @@
|
||||
//-----------------------------------------------------------------------------
|
||||
// <copyright file="OpeninghoursWp8Model.cs" company="BTU/IIT">
|
||||
// Company copyright tag.
|
||||
// </copyright>
|
||||
// <author>fiedlchr</author>
|
||||
// <sience>24.06.2013</sience>
|
||||
//-----------------------------------------------------------------------------
|
||||
|
||||
namespace CampusAppWP8.Model.Openinghours
|
||||
{
|
||||
using System.Xml.Serialization;
|
||||
|
||||
/// <summary>
|
||||
/// Model for opening hours.
|
||||
/// </summary>
|
||||
[XmlRoot("root")]
|
||||
public class OpeninghoursWp8Model : CampusAppWPortalLib8.Model.Openinghours.OpeninghoursModel<OpeninghoursInstitutionWp8Model>
|
||||
{
|
||||
}
|
||||
}
|
||||
@@ -9,6 +9,7 @@
|
||||
xmlns:lui="clr-namespace:CampusAppWP8.Utility.Lui.Button"
|
||||
xmlns:header="clr-namespace:CampusAppWP8.Utility.Lui.Header"
|
||||
xmlns:page="clr-namespace:CampusAppWP8.Utility.Lui.Page"
|
||||
xmlns:utility="clr-namespace:CampusAppWP8.Utility"
|
||||
FontFamily="{StaticResource PhoneFontFamilyNormal}"
|
||||
FontSize="{StaticResource PhoneFontSizeNormal}"
|
||||
Foreground="{StaticResource PhoneForegroundBrush}"
|
||||
@@ -16,6 +17,11 @@
|
||||
mc:Ignorable="d"
|
||||
shell:SystemTray.IsVisible="True">
|
||||
|
||||
<page:PortraitLandscapePage.Resources>
|
||||
<utility:BoolToVisibilityConverter x:Key="VisConverter"/>
|
||||
<utility:IdToPlaceConverter x:Key="PlaceConverter"/>
|
||||
</page:PortraitLandscapePage.Resources>
|
||||
|
||||
<!--LayoutRoot ist das Stammraster, in dem alle anderen Seiteninhalte platziert werden-->
|
||||
<Grid x:Name="LayoutRoot" Background="Transparent">
|
||||
<Grid.RowDefinitions>
|
||||
@@ -27,105 +33,116 @@
|
||||
<header:DefaultHeader x:Name="DefHeader" Grid.Row="0" HeaderName="{Binding Path=LocalizedResources.OpenHoursApp_Title, Source={StaticResource LocalizedStrings}}"/>
|
||||
|
||||
<!-- Content -->
|
||||
<ListBox x:Name="InstitutionPanel" Grid.Row="1" SelectionMode="Single" SelectionChanged="InstitutionPanel_SelectionChanged" Margin="24,0,12,0">
|
||||
<ListBox.ItemContainerStyle>
|
||||
<Style TargetType="ListBoxItem">
|
||||
<Setter Property="HorizontalContentAlignment" Value="Stretch"/>
|
||||
<Setter Property="HorizontalAlignment" Value="Stretch"/>
|
||||
</Style>
|
||||
</ListBox.ItemContainerStyle>
|
||||
<ListBox.ItemTemplate>
|
||||
<phone:Pivot x:Name="ThePivot" Grid.Row="1">
|
||||
<phone:Pivot.HeaderTemplate>
|
||||
<DataTemplate>
|
||||
<Border BorderBrush="{StaticResource PhoneContrastBackgroundBrush}" Style="{StaticResource ListButtonBorder}">
|
||||
<StackPanel>
|
||||
<lui:ToggleButton Content="{Binding Title}" ToggleContentTag="{Binding Path=Constants.ToggleContent, Source={StaticResource Const}}" Style="{StaticResource ListButtonNoneBorder}"/>
|
||||
<StackPanel Visibility="Collapsed" Tag="{Binding Path=Constants.ToggleContent, Source={StaticResource Const}}">
|
||||
<Grid>
|
||||
<Grid.ColumnDefinitions>
|
||||
<!--day-->
|
||||
<ColumnDefinition Width="auto"/>
|
||||
<!--time-->
|
||||
<ColumnDefinition Width="*"/>
|
||||
</Grid.ColumnDefinitions>
|
||||
<Grid.RowDefinitions>
|
||||
<!--monday-->
|
||||
<RowDefinition Height="auto"/>
|
||||
<!--tuesday-->
|
||||
<RowDefinition Height="auto"/>
|
||||
<!--wednesday-->
|
||||
<RowDefinition Height="auto"/>
|
||||
<!--thursday-->
|
||||
<RowDefinition Height="auto"/>
|
||||
<!--friday-->
|
||||
<RowDefinition Height="auto"/>
|
||||
<!--saturday-->
|
||||
<RowDefinition Height="auto"/>
|
||||
<!--sunday-->
|
||||
<RowDefinition Height="auto"/>
|
||||
</Grid.RowDefinitions>
|
||||
|
||||
<!--row 0 monday-->
|
||||
<TextBlock Grid.Row="0" Grid.Column="0" Text="{Binding Path=LocalizedResources.Time_Day_Monday, Source={StaticResource LocalizedStrings}}" FontWeight="Bold" Visibility="{Binding VisibleMonday}" Padding="10,3,10,0"/>
|
||||
<TextBlock Grid.Row="0" Grid.Column="1" Text="{Binding Monday}" Visibility="{Binding VisibleMonday}" HorizontalAlignment="Left"/>
|
||||
<!--row 1 tuesday-->
|
||||
<TextBlock Grid.Row="1" Grid.Column="0" Text="{Binding Path=LocalizedResources.Time_Day_Tuesday, Source={StaticResource LocalizedStrings}}" FontWeight="Bold" Visibility="{Binding VisibleTuesday}" Padding="10,3,10,0"/>
|
||||
<TextBlock Grid.Row="1" Grid.Column="1" Text="{Binding Tuesday}" Visibility="{Binding VisibleTuesday}" HorizontalAlignment="Left"/>
|
||||
<!--row 2 wednesday-->
|
||||
<TextBlock Grid.Row="2" Grid.Column="0" Text="{Binding Path=LocalizedResources.Time_Day_Wednesday, Source={StaticResource LocalizedStrings}}" FontWeight="Bold" Visibility="{Binding VisibleWednesday}" Padding="10,3,10,0"/>
|
||||
<TextBlock Grid.Row="2" Grid.Column="1" Text="{Binding Wednesday}" Visibility="{Binding VisibleWednesday}" HorizontalAlignment="Left"/>
|
||||
<!--row 3 thursday-->
|
||||
<TextBlock Grid.Row="3" Grid.Column="0" Text="{Binding Path=LocalizedResources.Time_Day_Thursday, Source={StaticResource LocalizedStrings}}" FontWeight="Bold" Visibility="{Binding VisibleThursday}" Padding="10,3,10,0"/>
|
||||
<TextBlock Grid.Row="3" Grid.Column="1" Text="{Binding Thursday}" Visibility="{Binding VisibleThursday}" HorizontalAlignment="Left"/>
|
||||
<!--row 4 friday-->
|
||||
<TextBlock Grid.Row="4" Grid.Column="0" Text="{Binding Path=LocalizedResources.Time_Day_Friday, Source={StaticResource LocalizedStrings}}" FontWeight="Bold" Visibility="{Binding VisibleFriday}" Padding="10,3,10,0"/>
|
||||
<TextBlock Grid.Row="4" Grid.Column="1" Text="{Binding Friday}" Visibility="{Binding VisibleFriday}" HorizontalAlignment="Left"/>
|
||||
<!--row 5 saturday-->
|
||||
<TextBlock Grid.Row="5" Grid.Column="0" Text="{Binding Path=LocalizedResources.Time_Day_Saturday, Source={StaticResource LocalizedStrings}}" FontWeight="Bold" Visibility="{Binding VisibleSaturday}" Padding="10,3,10,0"/>
|
||||
<TextBlock Grid.Row="5" Grid.Column="1" Text="{Binding Saturday}" Visibility="{Binding VisibleSaturday}" HorizontalAlignment="Left"/>
|
||||
<!--row 6 sunday-->
|
||||
<TextBlock Grid.Row="6" Grid.Column="0" Text="{Binding Path=LocalizedResources.Time_Day_Sunday, Source={StaticResource LocalizedStrings}}" FontWeight="Bold" Visibility="{Binding VisibleSunday}" Padding="10,3,10,0"/>
|
||||
<TextBlock Grid.Row="6" Grid.Column="1" Text="{Binding Sunday}" Visibility="{Binding VisibleSunday}" HorizontalAlignment="Left"/>
|
||||
</Grid>
|
||||
<Grid Margin="0,12,0,0">
|
||||
<Grid.ColumnDefinitions>
|
||||
<ColumnDefinition Width="auto"/>
|
||||
<ColumnDefinition Width="*"/>
|
||||
</Grid.ColumnDefinitions>
|
||||
<Grid.RowDefinitions>
|
||||
<RowDefinition Height="*"/>
|
||||
<RowDefinition Height="auto"/>
|
||||
</Grid.RowDefinitions>
|
||||
|
||||
<!--building-->
|
||||
<TextBlock Grid.Row="0" Grid.Column="0" Text="{Binding Path=LocalizedResources.Building, Source={StaticResource LocalizedStrings}}" Visibility="{Binding VisibleBuilding}" Padding="10,3,10,0"/>
|
||||
<TextBlock Grid.Row="0" Grid.Column="1" Text="{Binding Building}" Visibility="{Binding VisibleBuilding}" HorizontalAlignment="Left" Padding="10,3,10,0"/>
|
||||
<!--room-->
|
||||
<TextBlock Grid.Row="1" Grid.Column="0" Text="{Binding Path=LocalizedResources.Room, Source={StaticResource LocalizedStrings}}" Visibility="{Binding VisibleRoom}" Padding="10,3,10,0"/>
|
||||
<TextBlock Grid.Row="1" Grid.Column="1" Text="{Binding Room}" Visibility="{Binding VisibleRoom}" HorizontalAlignment="Left" Padding="10,3,10,0"/>
|
||||
</Grid>
|
||||
<!--hint text-->
|
||||
<TextBlock Text="{Binding Path=LocalizedResources.Hint, Source={StaticResource LocalizedStrings}}" Visibility="{Binding VisibleComment}" Padding="10,3,10,0" Margin="0,12,0,0" FontStyle="Italic"/>
|
||||
<TextBlock Text="{Binding Comment}" Visibility="{Binding VisibleComment}" TextWrapping="Wrap" Padding="10,3,10,0"/>
|
||||
<Grid Margin="6,6,6,6">
|
||||
<Grid.ColumnDefinitions>
|
||||
<ColumnDefinition Width="auto"/>
|
||||
<ColumnDefinition Width="auto"/>
|
||||
<ColumnDefinition Width="auto"/>
|
||||
</Grid.ColumnDefinitions>
|
||||
|
||||
<!--mail button-->
|
||||
<lui:EmailButton Grid.Column="0" EmailAddress="{Binding EMail}" Height="100" Visibility="{Binding VisibleEMail}" Padding="0" Margin="0"/>
|
||||
<!--phone button-->
|
||||
<lui:PhoneButton Grid.Column="1" Number="{Binding Phone}" DisplayName="{Binding Title}" Height="100" Visibility="{Binding VisiblePhone}" Padding="0" Margin="0"/>
|
||||
<!--location button -->
|
||||
<lui:GoToMapButton Grid.Column="2" SearchTerm="{Binding Building}" Height="100" Visibility="{Binding VisibleBuilding}" Padding="0" Margin="0" />
|
||||
</Grid>
|
||||
</StackPanel>
|
||||
</StackPanel>
|
||||
</Border>
|
||||
<TextBlock Text="{Binding Path=LocationID, Mode=OneTime, Converter={StaticResource PlaceConverter}, ConverterParameter=Name}" Margin="0,-36,0,0"/>
|
||||
</DataTemplate>
|
||||
</ListBox.ItemTemplate>
|
||||
</ListBox>
|
||||
</phone:Pivot.HeaderTemplate>
|
||||
<phone:Pivot.ItemTemplate>
|
||||
<DataTemplate>
|
||||
<ListBox x:Name="InstitutionPanel" Grid.Row="1" SelectionMode="Single" SelectionChanged="InstitutionPanel_SelectionChanged" Margin="24,0,12,0" ItemsSource="{Binding Institutions}">
|
||||
<ListBox.ItemContainerStyle>
|
||||
<Style TargetType="ListBoxItem">
|
||||
<Setter Property="HorizontalContentAlignment" Value="Stretch"/>
|
||||
<Setter Property="HorizontalAlignment" Value="Stretch"/>
|
||||
</Style>
|
||||
</ListBox.ItemContainerStyle>
|
||||
<ListBox.ItemTemplate>
|
||||
<DataTemplate>
|
||||
<Border BorderBrush="{StaticResource PhoneContrastBackgroundBrush}" Style="{StaticResource ListButtonBorder}">
|
||||
<StackPanel>
|
||||
<lui:ToggleButton Content="{Binding Title}" ToggleContentTag="{Binding Path=Constants.ToggleContent, Source={StaticResource Const}}" Style="{StaticResource ListButtonNoneBorder}"/>
|
||||
<StackPanel Visibility="Collapsed" Tag="{Binding Path=Constants.ToggleContent, Source={StaticResource Const}}">
|
||||
<Grid>
|
||||
<Grid.ColumnDefinitions>
|
||||
<!--day-->
|
||||
<ColumnDefinition Width="auto"/>
|
||||
<!--time-->
|
||||
<ColumnDefinition Width="*"/>
|
||||
</Grid.ColumnDefinitions>
|
||||
<Grid.RowDefinitions>
|
||||
<!--monday-->
|
||||
<RowDefinition Height="auto"/>
|
||||
<!--tuesday-->
|
||||
<RowDefinition Height="auto"/>
|
||||
<!--wednesday-->
|
||||
<RowDefinition Height="auto"/>
|
||||
<!--thursday-->
|
||||
<RowDefinition Height="auto"/>
|
||||
<!--friday-->
|
||||
<RowDefinition Height="auto"/>
|
||||
<!--saturday-->
|
||||
<RowDefinition Height="auto"/>
|
||||
<!--sunday-->
|
||||
<RowDefinition Height="auto"/>
|
||||
</Grid.RowDefinitions>
|
||||
|
||||
<!--row 0 monday-->
|
||||
<TextBlock Grid.Row="0" Grid.Column="0" Text="{Binding Path=LocalizedResources.Time_Day_Monday, Source={StaticResource LocalizedStrings}}" FontWeight="Bold" Visibility="{Binding VisibleMonday, Converter={StaticResource VisConverter}}" Padding="10,3,10,0"/>
|
||||
<TextBlock Grid.Row="0" Grid.Column="1" Text="{Binding Monday}" Visibility="{Binding VisibleMonday, Converter={StaticResource VisConverter}}" HorizontalAlignment="Left"/>
|
||||
<!--row 1 tuesday-->
|
||||
<TextBlock Grid.Row="1" Grid.Column="0" Text="{Binding Path=LocalizedResources.Time_Day_Tuesday, Source={StaticResource LocalizedStrings}}" FontWeight="Bold" Visibility="{Binding VisibleTuesday, Converter={StaticResource VisConverter}}" Padding="10,3,10,0"/>
|
||||
<TextBlock Grid.Row="1" Grid.Column="1" Text="{Binding Tuesday}" Visibility="{Binding VisibleTuesday, Converter={StaticResource VisConverter}}" HorizontalAlignment="Left"/>
|
||||
<!--row 2 wednesday-->
|
||||
<TextBlock Grid.Row="2" Grid.Column="0" Text="{Binding Path=LocalizedResources.Time_Day_Wednesday, Source={StaticResource LocalizedStrings}}" FontWeight="Bold" Visibility="{Binding VisibleWednesday, Converter={StaticResource VisConverter}}" Padding="10,3,10,0"/>
|
||||
<TextBlock Grid.Row="2" Grid.Column="1" Text="{Binding Wednesday}" Visibility="{Binding VisibleWednesday, Converter={StaticResource VisConverter}}" HorizontalAlignment="Left"/>
|
||||
<!--row 3 thursday-->
|
||||
<TextBlock Grid.Row="3" Grid.Column="0" Text="{Binding Path=LocalizedResources.Time_Day_Thursday, Source={StaticResource LocalizedStrings}}" FontWeight="Bold" Visibility="{Binding VisibleThursday, Converter={StaticResource VisConverter}}" Padding="10,3,10,0"/>
|
||||
<TextBlock Grid.Row="3" Grid.Column="1" Text="{Binding Thursday}" Visibility="{Binding VisibleThursday, Converter={StaticResource VisConverter}}" HorizontalAlignment="Left"/>
|
||||
<!--row 4 friday-->
|
||||
<TextBlock Grid.Row="4" Grid.Column="0" Text="{Binding Path=LocalizedResources.Time_Day_Friday, Source={StaticResource LocalizedStrings}}" FontWeight="Bold" Visibility="{Binding VisibleFriday, Converter={StaticResource VisConverter}}" Padding="10,3,10,0"/>
|
||||
<TextBlock Grid.Row="4" Grid.Column="1" Text="{Binding Friday}" Visibility="{Binding VisibleFriday, Converter={StaticResource VisConverter}}" HorizontalAlignment="Left"/>
|
||||
<!--row 5 saturday-->
|
||||
<TextBlock Grid.Row="5" Grid.Column="0" Text="{Binding Path=LocalizedResources.Time_Day_Saturday, Source={StaticResource LocalizedStrings}}" FontWeight="Bold" Visibility="{Binding VisibleSaturday, Converter={StaticResource VisConverter}}" Padding="10,3,10,0"/>
|
||||
<TextBlock Grid.Row="5" Grid.Column="1" Text="{Binding Saturday}" Visibility="{Binding VisibleSaturday, Converter={StaticResource VisConverter}}" HorizontalAlignment="Left"/>
|
||||
<!--row 6 sunday-->
|
||||
<TextBlock Grid.Row="6" Grid.Column="0" Text="{Binding Path=LocalizedResources.Time_Day_Sunday, Source={StaticResource LocalizedStrings}}" FontWeight="Bold" Visibility="{Binding VisibleSunday, Converter={StaticResource VisConverter}}" Padding="10,3,10,0"/>
|
||||
<TextBlock Grid.Row="6" Grid.Column="1" Text="{Binding Sunday}" Visibility="{Binding VisibleSunday, Converter={StaticResource VisConverter}}" HorizontalAlignment="Left"/>
|
||||
</Grid>
|
||||
<Grid Margin="0,12,0,0">
|
||||
<Grid.ColumnDefinitions>
|
||||
<ColumnDefinition Width="auto"/>
|
||||
<ColumnDefinition Width="*"/>
|
||||
</Grid.ColumnDefinitions>
|
||||
<Grid.RowDefinitions>
|
||||
<RowDefinition Height="*"/>
|
||||
<RowDefinition Height="auto"/>
|
||||
</Grid.RowDefinitions>
|
||||
|
||||
<!--building-->
|
||||
<TextBlock Grid.Row="0" Grid.Column="0" Text="{Binding Path=LocalizedResources.Building, Source={StaticResource LocalizedStrings}}" Visibility="{Binding VisibleBuilding, Converter={StaticResource VisConverter}}" Padding="10,3,10,0"/>
|
||||
<TextBlock Grid.Row="0" Grid.Column="1" Text="{Binding Building}" Visibility="{Binding VisibleBuilding, Converter={StaticResource VisConverter}}" HorizontalAlignment="Left" Padding="10,3,10,0"/>
|
||||
<!--room-->
|
||||
<TextBlock Grid.Row="1" Grid.Column="0" Text="{Binding Path=LocalizedResources.Room, Source={StaticResource LocalizedStrings}}" Visibility="{Binding VisibleRoom, Converter={StaticResource VisConverter}}" Padding="10,3,10,0"/>
|
||||
<TextBlock Grid.Row="1" Grid.Column="1" Text="{Binding Room}" Visibility="{Binding VisibleRoom, Converter={StaticResource VisConverter}}" HorizontalAlignment="Left" Padding="10,3,10,0"/>
|
||||
</Grid>
|
||||
<!--hint text-->
|
||||
<TextBlock Text="{Binding Path=LocalizedResources.Hint, Source={StaticResource LocalizedStrings}}" Visibility="{Binding VisibleComment, Converter={StaticResource VisConverter}}" Padding="10,3,10,0" Margin="0,12,0,0" FontStyle="Italic"/>
|
||||
<TextBlock Text="{Binding Comment}" Visibility="{Binding VisibleComment, Converter={StaticResource VisConverter}}" TextWrapping="Wrap" Padding="10,3,10,0"/>
|
||||
<Grid Margin="6,6,6,6">
|
||||
<Grid.ColumnDefinitions>
|
||||
<ColumnDefinition Width="auto"/>
|
||||
<ColumnDefinition Width="auto"/>
|
||||
<ColumnDefinition Width="auto"/>
|
||||
</Grid.ColumnDefinitions>
|
||||
|
||||
<!--mail button-->
|
||||
<lui:EmailButton Grid.Column="0" EmailAddress="{Binding EMail}" Height="100" Visibility="{Binding VisibleEMail, Converter={StaticResource VisConverter}}" Padding="0" Margin="0"/>
|
||||
<!--phone button-->
|
||||
<lui:PhoneButton Grid.Column="1" Number="{Binding Phone}" DisplayName="{Binding Title}" Height="100" Visibility="{Binding VisiblePhone, Converter={StaticResource VisConverter}}" Padding="0" Margin="0"/>
|
||||
<!--location button -->
|
||||
<lui:GoToMapButton Grid.Column="2" SearchTerm="{Binding Building}" Height="100" Visibility="{Binding VisibleBuilding, Converter={StaticResource VisConverter}}" Padding="0" Margin="0" />
|
||||
</Grid>
|
||||
</StackPanel>
|
||||
</StackPanel>
|
||||
</Border>
|
||||
</DataTemplate>
|
||||
</ListBox.ItemTemplate>
|
||||
</ListBox>
|
||||
</DataTemplate>
|
||||
</phone:Pivot.ItemTemplate>
|
||||
</phone:Pivot>
|
||||
</Grid>
|
||||
<phone:PhoneApplicationPage.ApplicationBar>
|
||||
<shell:ApplicationBar IsVisible="True" IsMenuEnabled="False" Mode="Minimized" Opacity="1.0" >
|
||||
|
||||
@@ -9,38 +9,34 @@ namespace CampusAppWP8.Pages.Openinghours
|
||||
{
|
||||
using System;
|
||||
using System.Windows;
|
||||
using System.Windows.Controls;
|
||||
using System.Windows.Navigation;
|
||||
using CampusAppWP8.Feed.Openinghours;
|
||||
using CampusAppWP8.Model.Openinghours;
|
||||
using CampusAppWP8.Resources;
|
||||
using CampusAppWP8.Utility;
|
||||
using CampusAppWP8.Utility.Lui.MessageBoxes;
|
||||
using CampusAppWP8.Utility.Lui.Page;
|
||||
using CampusAppWPortalLib8.Model.Openinghours;
|
||||
|
||||
/// <summary>
|
||||
/// Opening hours page.
|
||||
/// </summary>
|
||||
/// <summary> Opening hours page. </summary>
|
||||
/// <remarks> Fiedler, 13.11.2013. </remarks>
|
||||
/// <seealso cref="T:CampusAppWP8.Utility.Lui.Page.PortraitLandscapePage"/>
|
||||
public partial class OpeninghoursPage : PortraitLandscapePage
|
||||
{
|
||||
#region Members
|
||||
|
||||
/// <summary>
|
||||
/// Opening hours feed object.
|
||||
/// </summary>
|
||||
/// <summary> Opening hours feed object. </summary>
|
||||
private OpeninghoursFeed feed = null;
|
||||
|
||||
/// <summary>
|
||||
/// for checking if the instance is new or a tombstone.
|
||||
/// </summary>
|
||||
/// <summary> for checking if the instance is new or a tombstone. </summary>
|
||||
private bool isNewInstance = false;
|
||||
|
||||
#endregion
|
||||
|
||||
#region Constructor
|
||||
|
||||
/// <summary>
|
||||
/// Initializes a new instance of the <see cref="OpeninghoursPage" /> class.
|
||||
/// </summary>
|
||||
/// <summary> Initializes a new instance of the <see cref="OpeninghoursPage" /> class. </summary>
|
||||
/// <remarks> Fiedler, 13.11.2013. </remarks>
|
||||
public OpeninghoursPage()
|
||||
{
|
||||
this.InitializeComponent();
|
||||
@@ -52,7 +48,7 @@ namespace CampusAppWP8.Pages.Openinghours
|
||||
this.feed.OnLoaded += new OpeninghoursFeed.OnIO(this.FeedIsReady);
|
||||
this.feed.OnFailedWeb += new OpeninghoursFeed.OnFailed(this.FeedIsFailedWeb);
|
||||
this.feed.OnFailedFile += new OpeninghoursFeed.OnFailed(this.FeedIsFailedFile);
|
||||
this.feed.LoadData(Utilities.GetLoadModus<Model.Openinghours.OpeninghoursWp8Model>());
|
||||
this.feed.LoadData(Utilities.GetLoadModus<OpeninghoursModel>());
|
||||
}
|
||||
|
||||
this.isNewInstance = true;
|
||||
@@ -64,10 +60,9 @@ namespace CampusAppWP8.Pages.Openinghours
|
||||
|
||||
#region protected
|
||||
|
||||
/// <summary>
|
||||
/// Override the OnNavigatedTo method.
|
||||
/// </summary>
|
||||
/// <param name="e">Arguments of navigation</param>
|
||||
/// <summary> Override the OnNavigatedTo method. </summary>
|
||||
/// <remarks> Fiedler, 13.11.2013. </remarks>
|
||||
/// <seealso cref="M:CampusAppWP8.Utility.Lui.Page.PortraitLandscapePage.OnNavigatedTo(NavigationEventArgs)"/>
|
||||
protected override void OnNavigatedTo(NavigationEventArgs e)
|
||||
{
|
||||
base.OnNavigatedTo(e);
|
||||
@@ -76,9 +71,9 @@ namespace CampusAppWP8.Pages.Openinghours
|
||||
{
|
||||
if ((this.feed == null) || (this.feed.Model == null))
|
||||
{
|
||||
OpeninghoursWp8Model tempModel = null;
|
||||
OpeninghoursModel tempModel = null;
|
||||
|
||||
if ((tempModel = App.LoadFromIsolatedStorage<OpeninghoursWp8Model>(Constants.IsolatedStorage_OpeninghoursModel)) != null)
|
||||
if ((tempModel = App.LoadFromIsolatedStorage<OpeninghoursModel>(Constants.IsolatedStorage_OpeninghoursModel)) != null)
|
||||
{
|
||||
this.feed.Model = tempModel;
|
||||
this.FeedIsReady();
|
||||
@@ -89,20 +84,23 @@ namespace CampusAppWP8.Pages.Openinghours
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Override the OnNavigatedFrom method
|
||||
/// </summary>
|
||||
/// <param name="e">Arguments of navigation</param>
|
||||
/// <summary> Override the OnNavigatedFrom method. </summary>
|
||||
/// <remarks> Fiedler, 13.11.2013. </remarks>
|
||||
/// <seealso cref="M:System.Windows.Controls.Page.OnNavigatedFrom(NavigationEventArgs)"/>
|
||||
protected override void OnNavigatedFrom(NavigationEventArgs e)
|
||||
{
|
||||
this.feed.SaveData();
|
||||
|
||||
if (e.NavigationMode != System.Windows.Navigation.NavigationMode.Back)
|
||||
{
|
||||
App.SaveToIsolatedStorage<OpeninghoursWp8Model>(Constants.IsolatedStorage_OpeninghoursModel, this.feed.Model);
|
||||
App.SaveToIsolatedStorage<OpeninghoursModel>(Constants.IsolatedStorage_OpeninghoursModel, this.feed.Model);
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary> Raises the tap grid event. </summary>
|
||||
/// <remarks> Fiedler, 13.11.2013. </remarks>
|
||||
/// <param name="sender"> button object. </param>
|
||||
/// <param name="e"> Event information to send to registered event handlers. </param>
|
||||
private void OnTapGrid(object sender, EventArgs e)
|
||||
{
|
||||
|
||||
@@ -113,55 +111,51 @@ namespace CampusAppWP8.Pages.Openinghours
|
||||
|
||||
#region private
|
||||
|
||||
/// <summary>
|
||||
/// Will be execute if the feed is ready.
|
||||
/// </summary>
|
||||
/// <summary> Will be execute if the feed is ready. </summary>
|
||||
/// <remarks> Fiedler, 13.11.2013. </remarks>
|
||||
private void FeedIsReady()
|
||||
{
|
||||
this.InstitutionPanel.ItemsSource = this.feed.Model.Institutions;
|
||||
this.ThePivot.ItemsSource = this.feed.Model.Locations;
|
||||
this.DefHeader.ProgressVisibility = Visibility.Collapsed;
|
||||
|
||||
this.feed.SaveData();
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// On clicking the update button in the ApplicationBar.
|
||||
/// Force a data update from the web.
|
||||
/// On clicking the update button in the ApplicationBar. Force a data update from the web.
|
||||
/// </summary>
|
||||
/// <param name="sender">button object</param>
|
||||
/// <param name="e">event args</param>
|
||||
/// <remarks> Fiedler, 13.11.2013. </remarks>
|
||||
/// <param name="sender"> button object. </param>
|
||||
/// <param name="e"> event args. </param>
|
||||
private void OpenHoursForceUpdate_Click(object sender, EventArgs e)
|
||||
{
|
||||
this.DefHeader.ProgressVisibility = Visibility.Visible;
|
||||
this.feed.ForceWebUpdate();
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Method will be execute if the feed is failed
|
||||
/// </summary>
|
||||
/// <summary> Method will be execute if the feed is failed. </summary>
|
||||
/// <remarks> Fiedler, 13.11.2013. </remarks>
|
||||
private void FeedIsFailedWeb()
|
||||
{
|
||||
MessageBoxResult result = MessageBoxes.ShowMainModelErrorMessageBox(AppResources.MsgBox_ErrorMainModelLoadWeb);
|
||||
this.feed.ForceReadFile();
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Method will be execute if the feed is failed
|
||||
/// </summary>
|
||||
/// <summary> Method will be execute if the feed is failed. </summary>
|
||||
/// <remarks> Fiedler, 13.11.2013. </remarks>
|
||||
private void FeedIsFailedFile()
|
||||
{
|
||||
this.DefHeader.ProgressVisibility = Visibility.Collapsed;
|
||||
MessageBoxResult result = MessageBoxes.ShowMainModelErrorMessageBox(AppResources.MsgBox_ErrorMainModelLoadFile);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Method will be execute if the selection is change in the listbox.
|
||||
/// </summary>
|
||||
/// <param name="sender">listbox object.</param>
|
||||
/// <param name="e">event args.</param>
|
||||
/// <summary> Method will be execute if the selection is change in the listbox. </summary>
|
||||
/// <remarks> Fiedler, 13.11.2013. </remarks>
|
||||
/// <param name="sender"> listbox object. </param>
|
||||
/// <param name="e"> event args. </param>
|
||||
private void InstitutionPanel_SelectionChanged(object sender, System.Windows.Controls.SelectionChangedEventArgs e)
|
||||
{
|
||||
this.InstitutionPanel.SelectedIndex = -1;
|
||||
(sender as ListBox).SelectedIndex = -1;
|
||||
}
|
||||
|
||||
// private
|
||||
|
||||
@@ -247,7 +247,7 @@
|
||||
<value>OpeninghoursFeed.xml</value>
|
||||
</data>
|
||||
<data name="UrlOpeningHours_OpeningHours" xml:space="preserve">
|
||||
<value>http://www.tu-cottbus.de/campusapp-data/getdata.php?db=openinghours&app=2&appversion=1</value>
|
||||
<value>http://www.tu-cottbus.de/campusapp-data/openinghours.php?v=2</value>
|
||||
</data>
|
||||
<data name="FileNews_Name" xml:space="preserve">
|
||||
<value>NewsFeed.xml</value>
|
||||
|
||||
@@ -1357,7 +1357,7 @@ namespace CampusAppWP8.Resources {
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Sucht eine lokalisierte Zeichenfolge, die http://www.tu-cottbus.de/campusapp-data/getdata.php?db=openinghours&app=2&appversion=1 ähnelt.
|
||||
/// Sucht eine lokalisierte Zeichenfolge, die http://www.tu-cottbus.de/campusapp-data/openinghours.php?v=2 ähnelt.
|
||||
/// </summary>
|
||||
public static string UrlOpeningHours_OpeningHours {
|
||||
get {
|
||||
|
||||
113
CampusAppWP8/CampusAppWP8/Utility/IdToPlaceConverter.cs
Normal file
113
CampusAppWP8/CampusAppWP8/Utility/IdToPlaceConverter.cs
Normal file
@@ -0,0 +1,113 @@
|
||||
//-----------------------------------------------------------------------
|
||||
// <copyright file="IdToPlaceConverter.cs" company="BTU/IIT">
|
||||
// The MIT License (MIT). Copyright (c) 2013 BTU/IIT.
|
||||
// </copyright>
|
||||
// <author>Fiedler</author>
|
||||
// <date>13.11.2013</date>
|
||||
// <summary>Implements the identifier to place converter class</summary>
|
||||
//-----------------------------------------------------------------------
|
||||
namespace CampusAppWP8.Utility
|
||||
{
|
||||
using System;
|
||||
using System.Windows.Data;
|
||||
using CampusAppWP8.File.Places;
|
||||
using CampusAppWPortalLib8.Model.GeoDb;
|
||||
|
||||
/// <summary> An identifier to place converter. </summary>
|
||||
/// <remarks> Fiedler, 13.11.2013. </remarks>
|
||||
/// <seealso cref="T:System.Windows.Data.IValueConverter"/>
|
||||
public sealed class IdToPlaceConverter : IValueConverter
|
||||
{
|
||||
/// <summary> The place file. </summary>
|
||||
private PlacesFile placeFile = null;
|
||||
|
||||
/// <summary> Initializes a new instance of the IdToPlaceConverter class. </summary>
|
||||
/// <remarks> Fiedler, 13.11.2013. </remarks>
|
||||
public IdToPlaceConverter()
|
||||
{
|
||||
this.placeFile = new PlacesFile();
|
||||
this.placeFile.OnLoaded += new PlacesFile.OnIO(this.PlaceFileIsReady);
|
||||
this.placeFile.OnFailedLoad += new PlacesFile.OnFailed(this.PlaceFileIsFailed);
|
||||
this.placeFile.LoadData();
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Ändert die Quelldaten vor der Übergabe an das Ziel zur Anzeige in der Benutzeroberfläche.
|
||||
/// </summary>
|
||||
/// <remarks> Fiedler, 13.11.2013. </remarks>
|
||||
/// <returns>info string of the place.</returns>
|
||||
/// <seealso cref="M:System.Windows.Data.IValueConverter.Convert(object,Type,object,System.Globalization.CultureInfo)"/>
|
||||
public object Convert(object value, Type targetType, object parameter, System.Globalization.CultureInfo language)
|
||||
{
|
||||
string retValue = string.Empty;
|
||||
string paramStr = "Name";
|
||||
|
||||
if (parameter is string)
|
||||
{
|
||||
paramStr = (string)parameter;
|
||||
}
|
||||
|
||||
if (value is string)
|
||||
{
|
||||
retValue = this.GetInfo((string)value, paramStr);
|
||||
}
|
||||
else if (value is int)
|
||||
{
|
||||
retValue = this.GetInfo(string.Empty + (int)value, paramStr);
|
||||
}
|
||||
|
||||
return retValue;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Ändert die Zieldaten vor der Übergabe an das Quellobjekt. Diese Methode wird nur in
|
||||
/// <see cref="F:System.Windows.Data.BindingMode.TwoWay" />-Bindungen aufgerufen.
|
||||
/// </summary>
|
||||
/// <remarks> Fiedler, 13.11.2013. </remarks>
|
||||
/// <returns>null</returns>
|
||||
/// <seealso cref="M:System.Windows.Data.IValueConverter.ConvertBack(object,Type,object,System.Globalization.CultureInfo)"/>
|
||||
public object ConvertBack(object value, Type targetType, object parameter, System.Globalization.CultureInfo language)
|
||||
{
|
||||
object retValue = null;
|
||||
|
||||
/*
|
||||
if(targetType.Equals(typeof(int)))
|
||||
{
|
||||
retValue = new int();
|
||||
retValue =
|
||||
}
|
||||
*/
|
||||
return retValue;
|
||||
}
|
||||
|
||||
/// <summary> Gets an information. </summary>
|
||||
/// <remarks> Fiedler, 13.11.2013. </remarks>
|
||||
/// <param name="placeID"> Identifier for the place. </param>
|
||||
/// <param name="searchInfo"> Information describing the search. </param>
|
||||
/// <returns> The information. </returns>
|
||||
private string GetInfo(string placeID, string searchInfo)
|
||||
{
|
||||
string retValue = string.Empty;
|
||||
|
||||
if (this.placeFile.Model != null)
|
||||
{
|
||||
PlaceModel model = this.placeFile.Model.GetPlaceById(placeID);
|
||||
retValue = model.GetInformationsValue(searchInfo);
|
||||
}
|
||||
|
||||
return retValue;
|
||||
}
|
||||
|
||||
/// <summary> Place file is failed. </summary>
|
||||
/// <remarks> Fiedler, 13.11.2013. </remarks>
|
||||
private void PlaceFileIsFailed()
|
||||
{
|
||||
}
|
||||
|
||||
/// <summary> Place file is ready. </summary>
|
||||
/// <remarks> Fiedler, 13.11.2013. </remarks>
|
||||
private void PlaceFileIsReady()
|
||||
{
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -63,7 +63,9 @@
|
||||
<Compile Include="Model\Mensa\MenuModel.cs" />
|
||||
<Compile Include="Model\Mensa\MenuWeekModel.cs" />
|
||||
<Compile Include="Model\ModelTypes.cs" />
|
||||
<Compile Include="Model\Openinghours\OpenhoursDayModel.cs" />
|
||||
<Compile Include="Model\Openinghours\OpeninghoursInstitutionModel.cs" />
|
||||
<Compile Include="Model\Openinghours\OpeninghoursLocationModel.cs" />
|
||||
<Compile Include="Model\Openinghours\OpeninghoursModel.cs" />
|
||||
<Compile Include="Model\Person\PersonFunctionModel.cs" />
|
||||
<Compile Include="Model\Person\PersonListModel.cs" />
|
||||
|
||||
@@ -0,0 +1,217 @@
|
||||
//-----------------------------------------------------------------------
|
||||
// <copyright file="OpenhoursDayModel.cs" company="BTU/IIT">
|
||||
// The MIT License (MIT). Copyright (c) 2013 BTU/IIT.
|
||||
// </copyright>
|
||||
// <author>Fiedler</author>
|
||||
// <date>12.11.2013</date>
|
||||
// <summary>Implements the openhours day model class</summary>
|
||||
//-----------------------------------------------------------------------
|
||||
namespace CampusAppWPortalLib8.Model.Openinghours
|
||||
{
|
||||
using System;
|
||||
using System.Xml.Serialization;
|
||||
|
||||
/// <summary> A data Model for the openinghours day. </summary>
|
||||
/// <remarks> Fiedler, 12.11.2013. </remarks>
|
||||
[XmlRoot("Open")]
|
||||
public class OpeninghoursDayModel
|
||||
{
|
||||
/// <summary> The start. </summary>
|
||||
private TimeSpan start;
|
||||
/// <summary> The end. </summary>
|
||||
private TimeSpan end;
|
||||
/// <summary> The day. </summary>
|
||||
private DayOfWeek day;
|
||||
|
||||
/// <summary> Initializes a new instance of the OpeninghoursDayModel class. </summary>
|
||||
/// <remarks> Fiedler, 12.11.2013. </remarks>
|
||||
public OpeninghoursDayModel()
|
||||
{
|
||||
this.start = TimeSpan.Zero;
|
||||
this.end = TimeSpan.Zero;
|
||||
this.day = DayOfWeek.Sunday;
|
||||
}
|
||||
|
||||
/// <summary> Gets or sets the start. </summary>
|
||||
/// <value> The start. </value>
|
||||
[XmlAttribute("start")]
|
||||
public string Start
|
||||
{
|
||||
get
|
||||
{
|
||||
return this.TimeSpanToString(this.start);
|
||||
}
|
||||
|
||||
set
|
||||
{
|
||||
this.start = this.StringToTimeSpan(value);
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary> Gets or sets the start. </summary>
|
||||
/// <value> The start. </value>
|
||||
[XmlIgnore]
|
||||
public TimeSpan StartTS
|
||||
{
|
||||
get
|
||||
{
|
||||
return this.start;
|
||||
}
|
||||
|
||||
set
|
||||
{
|
||||
this.start = value;
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary> Gets or sets the end. </summary>
|
||||
/// <value> The end. </value>
|
||||
[XmlAttribute("end")]
|
||||
public string End
|
||||
{
|
||||
get
|
||||
{
|
||||
return this.TimeSpanToString(this.end);
|
||||
}
|
||||
|
||||
set
|
||||
{
|
||||
this.end = this.StringToTimeSpan(value);
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary> Gets or sets the end. </summary>
|
||||
/// <value> The end. </value>
|
||||
[XmlIgnore]
|
||||
public TimeSpan EndTS
|
||||
{
|
||||
get
|
||||
{
|
||||
return this.end;
|
||||
}
|
||||
|
||||
set
|
||||
{
|
||||
this.end = value;
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary> Gets or sets the day. </summary>
|
||||
/// <value> The day. </value>
|
||||
[XmlAttribute("day")]
|
||||
public int Day
|
||||
{
|
||||
get
|
||||
{
|
||||
return this.DayOfWeekToInt(this.day);
|
||||
}
|
||||
|
||||
set
|
||||
{
|
||||
this.day = this.IntToDayOfWeek(value);
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary> Gets or sets the day. </summary>
|
||||
/// <value> The day. </value>
|
||||
[XmlIgnore]
|
||||
public DayOfWeek DayDOW
|
||||
{
|
||||
get
|
||||
{
|
||||
return this.day;
|
||||
}
|
||||
|
||||
set
|
||||
{
|
||||
this.day = value;
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary> Gets the time string. </summary>
|
||||
/// <value> The time string. </value>
|
||||
[XmlIgnore]
|
||||
public string TimeString
|
||||
{
|
||||
get
|
||||
{
|
||||
return this.TimeSpanToString(this.start) + " - " + this.TimeSpanToString(this.end);
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary> String to time span. </summary>
|
||||
/// <remarks> Fiedler, 12.11.2013. </remarks>
|
||||
/// <param name="str"> The. </param>
|
||||
/// <returns> A TimeSpan. </returns>
|
||||
private TimeSpan StringToTimeSpan(string str)
|
||||
{
|
||||
string[] split = str.Split(':');
|
||||
|
||||
return new TimeSpan(
|
||||
int.Parse(split[0]),
|
||||
(split.Length > 1) ? int.Parse(split[1]) : 0,
|
||||
(split.Length > 2) ? int.Parse(split[2]) : 0);
|
||||
}
|
||||
|
||||
/// <summary> Time span to string. </summary>
|
||||
/// <remarks> Fiedler, 12.11.2013. </remarks>
|
||||
/// <param name="span"> The span. </param>
|
||||
/// <returns> A string. </returns>
|
||||
private string TimeSpanToString(TimeSpan span)
|
||||
{
|
||||
return string.Format("{0:hh\\:mm}", span);
|
||||
}
|
||||
|
||||
/// <summary> Int to day of week. </summary>
|
||||
/// <remarks> Fiedler, 12.11.2013. </remarks>
|
||||
/// <exception cref="NotSupportedException">
|
||||
/// Thrown when the requested operation is not supported.
|
||||
/// </exception>
|
||||
/// <param name="dayNr"> The day nr. </param>
|
||||
/// <returns> A DayOfWeek. </returns>
|
||||
private DayOfWeek IntToDayOfWeek(int dayNr)
|
||||
{
|
||||
DayOfWeek retValue = DayOfWeek.Sunday;
|
||||
|
||||
switch(dayNr)
|
||||
{
|
||||
case 1: retValue = DayOfWeek.Monday; break;
|
||||
case 2: retValue = DayOfWeek.Tuesday; break;
|
||||
case 3: retValue = DayOfWeek.Wednesday; break;
|
||||
case 4: retValue = DayOfWeek.Thursday; break;
|
||||
case 5: retValue = DayOfWeek.Friday; break;
|
||||
case 6: retValue = DayOfWeek.Saturday; break;
|
||||
case 7: retValue = DayOfWeek.Sunday; break;
|
||||
|
||||
default:
|
||||
{
|
||||
throw new NotSupportedException("day number is not supported (" + dayNr + ")");
|
||||
}
|
||||
}
|
||||
|
||||
return retValue;
|
||||
}
|
||||
|
||||
/// <summary> Day of week to int. </summary>
|
||||
/// <remarks> Fiedler, 12.11.2013. </remarks>
|
||||
/// <param name="dow"> The dow. </param>
|
||||
/// <returns> An int. </returns>
|
||||
private int DayOfWeekToInt(DayOfWeek dow)
|
||||
{
|
||||
int retValue = -1;
|
||||
|
||||
switch (dow)
|
||||
{
|
||||
case DayOfWeek.Monday: retValue = 1; break;
|
||||
case DayOfWeek.Tuesday: retValue = 2; break;
|
||||
case DayOfWeek.Wednesday: retValue = 3; break;
|
||||
case DayOfWeek.Thursday: retValue = 4; break;
|
||||
case DayOfWeek.Friday: retValue = 5; break;
|
||||
case DayOfWeek.Saturday: retValue = 6; break;
|
||||
case DayOfWeek.Sunday: retValue = 7; break;
|
||||
}
|
||||
|
||||
return retValue;
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -8,6 +8,8 @@
|
||||
//-----------------------------------------------------------------------
|
||||
namespace CampusAppWPortalLib8.Model.Openinghours
|
||||
{
|
||||
using System;
|
||||
using System.Collections.ObjectModel;
|
||||
using System.Globalization;
|
||||
using System.Windows;
|
||||
using System.Xml.Serialization;
|
||||
@@ -24,27 +26,6 @@ namespace CampusAppWPortalLib8.Model.Openinghours
|
||||
/// <summary> English version of the institution title. </summary>
|
||||
private string titleEN = string.Empty;
|
||||
|
||||
/// <summary> Opening hours on monday. </summary>
|
||||
private string dayMonday = string.Empty;
|
||||
|
||||
/// <summary> Opening hours on tuesday. </summary>
|
||||
private string dayTuesday = string.Empty;
|
||||
|
||||
/// <summary> Opening hours on wednesday. </summary>
|
||||
private string dayWednesday = string.Empty;
|
||||
|
||||
/// <summary> Opening hours on thursday. </summary>
|
||||
private string dayThursday = string.Empty;
|
||||
|
||||
/// <summary> Opening hours on friday. </summary>
|
||||
private string dayFriday = string.Empty;
|
||||
|
||||
/// <summary> Opening hours on saturday. </summary>
|
||||
private string daySaturday = string.Empty;
|
||||
|
||||
/// <summary> Opening hours on sunday. </summary>
|
||||
private string daySunday = string.Empty;
|
||||
|
||||
/// <summary> Email address of the institution. </summary>
|
||||
private string infoEmail = string.Empty;
|
||||
|
||||
@@ -63,6 +44,9 @@ namespace CampusAppWPortalLib8.Model.Openinghours
|
||||
/// <summary> English version of the comment. </summary>
|
||||
private string commentEN = string.Empty;
|
||||
|
||||
/// <summary> List of days. </summary>
|
||||
private ObservableCollection<OpeninghoursDayModel> dayList = null;
|
||||
|
||||
#endregion
|
||||
|
||||
#region Constructor
|
||||
@@ -73,6 +57,7 @@ namespace CampusAppWPortalLib8.Model.Openinghours
|
||||
/// <remarks> Stubbfel, 15.10.2013. </remarks>
|
||||
public OpeninghoursInstitutionModel()
|
||||
{
|
||||
this.dayList = new ObservableCollection<OpeninghoursDayModel>();
|
||||
}
|
||||
|
||||
#endregion
|
||||
@@ -111,115 +96,80 @@ namespace CampusAppWPortalLib8.Model.Openinghours
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary> Gets or sets the open hours on monday. </summary>
|
||||
/// <summary> Gets the open hours on monday. </summary>
|
||||
/// <value> The monday. </value>
|
||||
[XmlAttribute("monday")]
|
||||
[XmlIgnore]
|
||||
public string Monday
|
||||
{
|
||||
get
|
||||
{
|
||||
return this.dayMonday;
|
||||
}
|
||||
|
||||
set
|
||||
{
|
||||
this.dayMonday = this.FixOpeninghoursString(value);
|
||||
return this.DayToString(DayOfWeek.Monday);
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary> Gets or sets the open hours on tuesday. </summary>
|
||||
/// <summary> Gets the open hours on tuesday. </summary>
|
||||
/// <value> The tuesday. </value>
|
||||
[XmlAttribute("tuesday")]
|
||||
[XmlIgnore]
|
||||
public string Tuesday
|
||||
{
|
||||
get
|
||||
{
|
||||
return this.dayTuesday;
|
||||
}
|
||||
|
||||
set
|
||||
{
|
||||
this.dayTuesday = this.FixOpeninghoursString(value);
|
||||
return this.DayToString(DayOfWeek.Tuesday);
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary> Gets or sets the open hours on wednesday. </summary>
|
||||
/// <summary> Gets the open hours on wednesday. </summary>
|
||||
/// <value> The wednesday. </value>
|
||||
[XmlAttribute("wednesday")]
|
||||
[XmlIgnore]
|
||||
public string Wednesday
|
||||
{
|
||||
get
|
||||
{
|
||||
return this.dayWednesday;
|
||||
}
|
||||
|
||||
set
|
||||
{
|
||||
this.dayWednesday = this.FixOpeninghoursString(value);
|
||||
return this.DayToString(DayOfWeek.Wednesday);
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary> Gets or sets the open hours on thursday. </summary>
|
||||
/// <summary> Gets the open hours on thursday. </summary>
|
||||
/// <value> The thursday. </value>
|
||||
[XmlAttribute("thursday")]
|
||||
[XmlIgnore]
|
||||
public string Thursday
|
||||
{
|
||||
get
|
||||
{
|
||||
return this.dayThursday;
|
||||
}
|
||||
|
||||
set
|
||||
{
|
||||
this.dayThursday = this.FixOpeninghoursString(value);
|
||||
return this.DayToString(DayOfWeek.Thursday);
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary> Gets or sets the open hours on friday. </summary>
|
||||
/// <summary> Gets the open hours on friday. </summary>
|
||||
/// <value> The friday. </value>
|
||||
[XmlAttribute("friday")]
|
||||
[XmlIgnore]
|
||||
public string Friday
|
||||
{
|
||||
get
|
||||
{
|
||||
return this.dayFriday;
|
||||
}
|
||||
|
||||
set
|
||||
{
|
||||
this.dayFriday = this.FixOpeninghoursString(value);
|
||||
return this.DayToString(DayOfWeek.Friday);
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary> Gets or sets the open hours on saturday. </summary>
|
||||
/// <summary> Gets the open hours on saturday. </summary>
|
||||
/// <value> The saturday. </value>
|
||||
[XmlAttribute("saturday")]
|
||||
[XmlIgnore]
|
||||
public string Saturday
|
||||
{
|
||||
get
|
||||
{
|
||||
return this.daySaturday;
|
||||
}
|
||||
|
||||
set
|
||||
{
|
||||
this.daySaturday = this.FixOpeninghoursString(value);
|
||||
return this.DayToString(DayOfWeek.Saturday);
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary> Gets or sets the open hours on sunday. </summary>
|
||||
/// <summary> Gets the open hours on sunday. </summary>
|
||||
/// <value> The sunday. </value>
|
||||
[XmlAttribute("sunday")]
|
||||
[XmlIgnore]
|
||||
public string Sunday
|
||||
{
|
||||
get
|
||||
{
|
||||
return this.daySunday;
|
||||
}
|
||||
|
||||
set
|
||||
{
|
||||
this.daySunday = this.FixOpeninghoursString(value);
|
||||
return this.DayToString(DayOfWeek.Sunday);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -319,11 +269,28 @@ namespace CampusAppWPortalLib8.Model.Openinghours
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary> Gets or sets the days. </summary>
|
||||
/// <value> The days. </value>
|
||||
[XmlElement("Open")]
|
||||
public ObservableCollection<OpeninghoursDayModel> Days
|
||||
{
|
||||
get
|
||||
{
|
||||
return this.dayList;
|
||||
}
|
||||
|
||||
set
|
||||
{
|
||||
this.dayList = value;
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Gets the localized title. If the phone is set to german language, the german title will
|
||||
/// be returned otherwise the english title.
|
||||
/// </summary>
|
||||
/// <value> The title. </value>
|
||||
[XmlIgnore]
|
||||
public string Title
|
||||
{
|
||||
get
|
||||
@@ -344,6 +311,7 @@ namespace CampusAppWPortalLib8.Model.Openinghours
|
||||
/// will be returned otherwise the english comment.
|
||||
/// </summary>
|
||||
/// <value> The comment. </value>
|
||||
[XmlIgnore]
|
||||
public string Comment
|
||||
{
|
||||
get
|
||||
@@ -363,6 +331,7 @@ namespace CampusAppWPortalLib8.Model.Openinghours
|
||||
/// Gets a string containing the email address and the institution title separated by ':'.
|
||||
/// </summary>
|
||||
/// <value> The e mail title. </value>
|
||||
[XmlIgnore]
|
||||
public string EMailTitle
|
||||
{
|
||||
get
|
||||
@@ -375,6 +344,7 @@ namespace CampusAppWPortalLib8.Model.Openinghours
|
||||
/// Gets a string containing the phone number and the institution title separated by ':'.
|
||||
/// </summary>
|
||||
/// <value> The phone title. </value>
|
||||
[XmlIgnore]
|
||||
public string PhoneTitle
|
||||
{
|
||||
get
|
||||
@@ -383,19 +353,183 @@ namespace CampusAppWPortalLib8.Model.Openinghours
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary> Gets a value indicating whether the visible monday. </summary>
|
||||
/// <value> true if visible monday, false if not. </value>
|
||||
[XmlIgnore]
|
||||
public bool VisibleMonday
|
||||
{
|
||||
get
|
||||
{
|
||||
return this.HasDay(DayOfWeek.Monday);
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary> Gets a value indicating whether the visible tuesday. </summary>
|
||||
/// <value> true if visible tuesday, false if not. </value>
|
||||
[XmlIgnore]
|
||||
public bool VisibleTuesday
|
||||
{
|
||||
get
|
||||
{
|
||||
return this.HasDay(DayOfWeek.Tuesday);
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary> Gets a value indicating whether the visible wednesday. </summary>
|
||||
/// <value> true if visible wednesday, false if not. </value>
|
||||
[XmlIgnore]
|
||||
public bool VisibleWednesday
|
||||
{
|
||||
get
|
||||
{
|
||||
return this.HasDay(DayOfWeek.Wednesday);
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary> Gets a value indicating whether the visible thursday. </summary>
|
||||
/// <value> true if visible thursday, false if not. </value>
|
||||
[XmlIgnore]
|
||||
public bool VisibleThursday
|
||||
{
|
||||
get
|
||||
{
|
||||
return this.HasDay(DayOfWeek.Thursday);
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary> Gets a value indicating whether the visible friday. </summary>
|
||||
/// <value> true if visible friday, false if not. </value>
|
||||
[XmlIgnore]
|
||||
public bool VisibleFriday
|
||||
{
|
||||
get
|
||||
{
|
||||
return this.HasDay(DayOfWeek.Friday);
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary> Gets a value indicating whether the visible saturday. </summary>
|
||||
/// <value> true if visible saturday, false if not. </value>
|
||||
[XmlIgnore]
|
||||
public bool VisibleSaturday
|
||||
{
|
||||
get
|
||||
{
|
||||
return this.HasDay(DayOfWeek.Saturday);
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary> Gets a value indicating whether the visible sunday. </summary>
|
||||
/// <value> true if visible sunday, false if not. </value>
|
||||
[XmlIgnore]
|
||||
public bool VisibleSunday
|
||||
{
|
||||
get
|
||||
{
|
||||
return this.HasDay(DayOfWeek.Sunday);
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary> Gets a value indicating whether the visible comment. </summary>
|
||||
/// <value> true if visible comment, false if not. </value>
|
||||
[XmlIgnore]
|
||||
public bool VisibleComment
|
||||
{
|
||||
get
|
||||
{
|
||||
return !((this.Comment == string.Empty) || (this.Comment.Length == 0));
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary> Gets a value indicating whether the visible mail. </summary>
|
||||
/// <value> true if visible mail, false if not. </value>
|
||||
[XmlIgnore]
|
||||
public bool VisibleEMail
|
||||
{
|
||||
get
|
||||
{
|
||||
return !((this.EMail == string.Empty) || (this.EMail.Length == 0));
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary> Gets a value indicating whether the visible phone. </summary>
|
||||
/// <value> true if visible phone, false if not. </value>
|
||||
[XmlIgnore]
|
||||
public bool VisiblePhone
|
||||
{
|
||||
get
|
||||
{
|
||||
return !((this.Phone == string.Empty) || (this.Phone.Length == 0));
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary> Gets a value indicating whether the visible room. </summary>
|
||||
/// <value> true if visible room, false if not. </value>
|
||||
[XmlIgnore]
|
||||
public bool VisibleRoom
|
||||
{
|
||||
get
|
||||
{
|
||||
return !((this.Room == string.Empty) || (this.Room.Length == 0));
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary> Gets a value indicating whether the visible building. </summary>
|
||||
/// <value> true if visible building, false if not. </value>
|
||||
[XmlIgnore]
|
||||
public bool VisibleBuilding
|
||||
{
|
||||
get
|
||||
{
|
||||
return !((this.Building == string.Empty) || (this.Building.Length == 0));
|
||||
}
|
||||
}
|
||||
|
||||
#endregion
|
||||
|
||||
#region Method
|
||||
|
||||
/// <summary> Removes unwanted chars in a string. </summary>
|
||||
/// <remarks> Stubbfel, 15.10.2013. </remarks>
|
||||
/// <param name="str"> input string. </param>
|
||||
/// <returns> fixed string. </returns>
|
||||
private string FixOpeninghoursString(string str)
|
||||
/// <summary> Day to string. </summary>
|
||||
/// <remarks> Fiedler, 13.11.2013. </remarks>
|
||||
/// <param name="dow"> The dow. </param>
|
||||
/// <returns> A string. </returns>
|
||||
private string DayToString(DayOfWeek dow)
|
||||
{
|
||||
string retValue = string.Empty;
|
||||
|
||||
retValue = str.Replace(" | ", "\n");
|
||||
foreach (OpeninghoursDayModel dm in this.dayList)
|
||||
{
|
||||
if (dm.DayDOW.Equals(dow))
|
||||
{
|
||||
if (retValue.Equals(string.Empty))
|
||||
{
|
||||
retValue += dm.TimeString;
|
||||
}
|
||||
else
|
||||
{
|
||||
retValue += "\n" + dm.TimeString;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
return retValue;
|
||||
}
|
||||
|
||||
/// <summary> Query if 'dow' has day. </summary>
|
||||
/// <remarks> Fiedler, 13.11.2013. </remarks>
|
||||
/// <param name="dow"> The dow. </param>
|
||||
/// <returns> true if day, false if not. </returns>
|
||||
private bool HasDay(DayOfWeek dow)
|
||||
{
|
||||
bool retValue = false;
|
||||
|
||||
foreach (OpeninghoursDayModel dm in this.dayList)
|
||||
{
|
||||
if (dm.DayDOW.Equals(dow))
|
||||
{
|
||||
retValue = true;
|
||||
}
|
||||
}
|
||||
|
||||
return retValue;
|
||||
}
|
||||
|
||||
@@ -0,0 +1,62 @@
|
||||
//-----------------------------------------------------------------------
|
||||
// <copyright file="OpeninghoursLocationModel.cs" company="BTU/IIT">
|
||||
// The MIT License (MIT). Copyright (c) 2013 BTU/IIT.
|
||||
// </copyright>
|
||||
// <author>Fiedler</author>
|
||||
// <date>13.11.2013</date>
|
||||
// <summary>Implements the openinghours location model class</summary>
|
||||
//-----------------------------------------------------------------------
|
||||
namespace CampusAppWPortalLib8.Model.Openinghours
|
||||
{
|
||||
using System.Collections.ObjectModel;
|
||||
using System.Xml.Serialization;
|
||||
|
||||
/// <summary> Model for menu. </summary>
|
||||
/// <remarks> Stubbfel, 15.10.2013. </remarks>
|
||||
public class OpeninghoursLocationModel
|
||||
{
|
||||
/// <summary> The institutions. </summary>
|
||||
private ObservableCollection<OpeninghoursInstitutionModel> institutions = null;
|
||||
/// <summary> Identifier for the location. </summary>
|
||||
private int locationID = -1;
|
||||
|
||||
/// <summary> Initializes a new instance of the OpeninghoursLocationModel class. </summary>
|
||||
/// <remarks> Fiedler, 13.11.2013. </remarks>
|
||||
public OpeninghoursLocationModel()
|
||||
{
|
||||
this.institutions = new ObservableCollection<OpeninghoursInstitutionModel>();
|
||||
}
|
||||
|
||||
/// <summary> Gets or sets the identifier of the location. </summary>
|
||||
/// <value> The identifier of the location. </value>
|
||||
[XmlAttribute("id")]
|
||||
public int LocationID
|
||||
{
|
||||
get
|
||||
{
|
||||
return this.locationID;
|
||||
}
|
||||
|
||||
set
|
||||
{
|
||||
this.locationID = value;
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary> Gets or sets the institutions. </summary>
|
||||
/// <value> The institutions. </value>
|
||||
[XmlElement("Object")]
|
||||
public ObservableCollection<OpeninghoursInstitutionModel> Institutions
|
||||
{
|
||||
get
|
||||
{
|
||||
return this.institutions;
|
||||
}
|
||||
|
||||
set
|
||||
{
|
||||
this.institutions = value;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -16,7 +16,7 @@ namespace CampusAppWPortalLib8.Model.Openinghours
|
||||
/// <remarks> fiedlchr, 15.10.2013. </remarks>
|
||||
/// <typeparam name="T"> Generic type parameter. </typeparam>
|
||||
[XmlRoot("root")]
|
||||
public class OpeninghoursModel<T> where T : OpeninghoursInstitutionModel
|
||||
public class OpeninghoursModel
|
||||
{
|
||||
#region Member
|
||||
|
||||
@@ -24,7 +24,7 @@ namespace CampusAppWPortalLib8.Model.Openinghours
|
||||
private readonly DateTime createTime;
|
||||
|
||||
/// <summary> Gets or sets feed information item list. </summary>
|
||||
private ObservableCollection<T> institutions;
|
||||
private ObservableCollection<OpeninghoursLocationModel> locations;
|
||||
|
||||
#endregion
|
||||
|
||||
@@ -34,7 +34,7 @@ namespace CampusAppWPortalLib8.Model.Openinghours
|
||||
/// <remarks> fiedlchr, 15.10.2013. </remarks>
|
||||
public OpeninghoursModel()
|
||||
{
|
||||
this.institutions = new ObservableCollection<T>();
|
||||
this.locations = new ObservableCollection<OpeninghoursLocationModel>();
|
||||
this.createTime = DateTime.Now;
|
||||
}
|
||||
|
||||
@@ -55,17 +55,17 @@ namespace CampusAppWPortalLib8.Model.Openinghours
|
||||
/// <summary> Gets or sets the Institutions. </summary>
|
||||
/// <value> The institutions. </value>
|
||||
[XmlArray("data")]
|
||||
[XmlArrayItem("institution")]
|
||||
public ObservableCollection<T> Institutions
|
||||
[XmlArrayItem("Location")]
|
||||
public ObservableCollection<OpeninghoursLocationModel> Locations
|
||||
{
|
||||
get
|
||||
{
|
||||
return this.institutions;
|
||||
return this.locations;
|
||||
}
|
||||
|
||||
set
|
||||
{
|
||||
this.institutions = value;
|
||||
this.locations = value;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user