Merge branch 'release/r#71' into develmaster

This commit is contained in:
stubbfel
2013-07-02 12:25:44 +02:00
18 changed files with 782 additions and 80 deletions

View File

@@ -96,6 +96,8 @@
<Compile Include="App.xaml.cs">
<DependentUpon>App.xaml</DependentUpon>
</Compile>
<Compile Include="Feed\Link\CommonLinkFeed.cs" />
<Compile Include="Feed\Link\ClubLinkFeed.cs" />
<Compile Include="Feed\Openinghours\OpeninghoursFeed.cs" />
<Compile Include="LocalizedStrings.cs" />
<Compile Include="Model\Campusmap\MapModel.cs" />
@@ -113,6 +115,8 @@
<Compile Include="Model\Lecture\LectureList.cs" />
<Compile Include="Model\Lecture\LectureModule.cs" />
<Compile Include="Model\Lecture\LecturePageModel.cs" />
<Compile Include="Model\Link\LinkModel.cs" />
<Compile Include="Model\Link\LinkListModel.cs" />
<Compile Include="Model\Mensa\MenuModel.cs" />
<Compile Include="Model\Mensa\MenuWeekModel.cs" />
<Compile Include="Model\Openinghours\OpeninghoursInstitutionModel.cs" />
@@ -149,6 +153,9 @@
<Compile Include="Pages\Lecture\ResultPage.xaml.cs">
<DependentUpon>ResultPage.xaml</DependentUpon>
</Compile>
<Compile Include="Pages\Links\LinkPage.xaml.cs">
<DependentUpon>LinkPage.xaml</DependentUpon>
</Compile>
<Compile Include="Pages\Mensa\MensaPage.xaml.cs">
<DependentUpon>MensaPage.xaml</DependentUpon>
</Compile>
@@ -238,6 +245,10 @@
<Generator>MSBuild:Compile</Generator>
<SubType>Designer</SubType>
</Page>
<Page Include="Pages\Links\LinkPage.xaml">
<SubType>Designer</SubType>
<Generator>MSBuild:Compile</Generator>
</Page>
<Page Include="Pages\Mensa\MensaPage.xaml">
<Generator>MSBuild:Compile</Generator>
<SubType>Designer</SubType>

View File

@@ -0,0 +1,83 @@
//-----------------------------------------------------------------------
// <copyright file="ClubLinkFeed.cs" company="BTU/IIT">
// Company copyright tag.
// </copyright>
// <author>stubbfel</author>
// <sience>02.07.2013</sience>
//----------------------------------------------------------------------
namespace CampusAppWP8.Feed.Link
{
using System;
using CampusAppWP8.Model.Link;
using CampusAppWP8.Resources;
using CampusAppWP8.Utility;
/// <summary>
/// This Class is for ClubLinkFeeds
/// </summary>
public class ClubLinkFeed : XmlFeed<LinkListModel>
{
#region Constructor
/// <summary>
/// Initializes a new instance of the <see cref="ClubLinkFeed" /> class.
/// </summary>
public ClubLinkFeed()
: base(new Uri(Constants.UrlLink_ClubLinks, UriKind.Absolute), Constants.FileLink_ClubLinks)
{
}
#endregion
#region Method
#region Protected
/// <summary>
/// Method implement CheckIsModelUpToDate()-Method <see cref="Pages"/>.
/// </summary>
/// <returns>true, if model is up-to-date, otherwise false</returns>
protected override bool CheckIsModelUpToDate()
{
DateTime lastModified = this.Model.CreateTime;
return this.CheckIsUpToDate(lastModified);
}
/// <summary>
/// Method implement CheckIsFileUpToDate()-Method <see cref="Pages"/>.
/// </summary>
/// <returns>true, if file is up-to-date, otherwise false</returns>
protected override bool CheckIsFileUpToDate()
{
DateTime lastModified = FileManager.GetFileInfo(FileName).LastWriteTime;
return this.CheckIsUpToDate(lastModified);
}
#endregion
#region Private
/// <summary>
/// Check if the model or file is up-to-date.
/// </summary>
/// <param name="lastModified">Date of the last modification</param>
/// <returns>true, if is up-to-date, otherwise false</returns>
private bool CheckIsUpToDate(DateTime lastModified)
{
DateTime temp = lastModified.AddDays(1);
int diff = temp.CompareTo(DateTime.Now);
if (diff < 0)
{
return false;
}
return true;
}
#endregion
#endregion
}
}

View File

@@ -0,0 +1,83 @@
//-----------------------------------------------------------------------
// <copyright file="CommonLinkFeed.cs" company="BTU/IIT">
// Company copyright tag.
// </copyright>
// <author>stubbfel</author>
// <sience>02.07.2013</sience>
//----------------------------------------------------------------------
namespace CampusAppWP8.Feed.Link
{
using System;
using CampusAppWP8.Model.Link;
using CampusAppWP8.Resources;
using CampusAppWP8.Utility;
/// <summary>
/// This Class is for CommonLinkFeeds
/// </summary>
public class CommonLinkFeed : XmlFeed<LinkListModel>
{
#region Constructor
/// <summary>
/// Initializes a new instance of the <see cref="CommonLinkFeed" /> class.
/// </summary>
public CommonLinkFeed()
: base(new Uri(Constants.UrlLink_CommonLinks, UriKind.Absolute), Constants.FileLink_CommonLinks)
{
}
#endregion
#region Method
#region Protected
/// <summary>
/// Method implement CheckIsModelUpToDate()-Method <see cref="Pages"/>.
/// </summary>
/// <returns>true, if model is up-to-date, otherwise false</returns>
protected override bool CheckIsModelUpToDate()
{
DateTime lastModified = this.Model.CreateTime;
return this.CheckIsUpToDate(lastModified);
}
/// <summary>
/// Method implement CheckIsFileUpToDate()-Method <see cref="Pages"/>.
/// </summary>
/// <returns>true, if file is up-to-date, otherwise false</returns>
protected override bool CheckIsFileUpToDate()
{
DateTime lastModified = FileManager.GetFileInfo(FileName).LastWriteTime;
return this.CheckIsUpToDate(lastModified);
}
#endregion
#region Private
/// <summary>
/// Check if the model or file is up-to-date.
/// </summary>
/// <param name="lastModified">Date of the last modification</param>
/// <returns>true, if is up-to-date, otherwise false</returns>
private bool CheckIsUpToDate(DateTime lastModified)
{
DateTime temp = lastModified.AddDays(1);
int diff = temp.CompareTo(DateTime.Now);
if (diff < 0)
{
return false;
}
return true;
}
#endregion
#endregion
}
}

View File

@@ -13,7 +13,7 @@ namespace CampusAppWP8.Api.Mensa
using CampusAppWP8.Utility;
/// <summary>
/// This Class is for MesaFeeds
/// This Class is for MensaFeeds
/// </summary>
public class MensaFeed : XmlFeed<MenuWeekModel>
{

View File

@@ -0,0 +1,64 @@
//-----------------------------------------------------------------------------
// <copyright file="LinkListModel.cs" company="BTU/IIT">
// Company copyright tag.
// </copyright>
// <author>stubbfel</author>
// <sience>02.07.2013</sience>
//-----------------------------------------------------------------------------
namespace CampusAppWP8.Model.Link
{
using System;
using System.Collections.ObjectModel;
using System.Xml.Serialization;
/// <summary>
/// Model for a list of links.
/// </summary>
[XmlRoot("root")]
public class LinkListModel
{
#region Member
/// <summary>
/// Time when the model was created.
/// </summary>
private readonly DateTime createTime;
#endregion
#region Constructor
/// <summary>
/// Initializes a new instance of the <see cref="LinkListModel" /> class.
/// </summary>
public LinkListModel()
{
this.createTime = DateTime.Now;
}
#endregion
#region Property
/// <summary>
/// Gets or sets feed information item list.
/// </summary>
[XmlArray("data")]
[XmlArrayItem("link")]
public ObservableCollection<LinkModel> Links { get; set; }
/// <summary>
/// Gets the creation time of the model.
/// </summary>
public DateTime CreateTime
{
get
{
return this.createTime;
}
}
#endregion
}
}

View File

@@ -0,0 +1,173 @@
//-----------------------------------------------------------------------------
// <copyright file="LinkModel.cs" company="BTU/IIT">
// Company copyright tag.
// </copyright>
// <author>stubbfel</author>
// <sience>02.07.2013</sience>
//-----------------------------------------------------------------------------
namespace CampusAppWP8.Model.Link
{
using System.Globalization;
using System.Xml.Serialization;
/// <summary>
/// Model for menu
/// </summary>
public class LinkModel
{
#region Member
/// <summary>
/// German version of the link title.
/// </summary>
private string titleDE = string.Empty;
/// <summary>
/// English version of the link title.
/// </summary>
private string titleEN = string.Empty;
/// <summary>
/// German version of the link.
/// </summary>
private string linkDE = string.Empty;
/// <summary>
/// English version of the link.
/// </summary>
private string linkEN = string.Empty;
#endregion
#region Constructor
/// <summary>
/// Initializes a new instance of the <see cref="LinkModel" /> class.
/// </summary>
public LinkModel()
{
}
#endregion
#region Property
/// <summary>
/// Gets or sets the german title of the link.
/// </summary>
[XmlAttribute("title_de")]
public string Title_DE
{
get
{
return this.titleDE;
}
set
{
if (value != this.titleDE)
{
this.titleDE = value;
}
}
}
/// <summary>
/// Gets or sets the english title of the link.
/// </summary>
[XmlAttribute("title_en")]
public string Title_EN
{
get
{
return this.titleEN;
}
set
{
this.titleEN = value;
}
}
/// <summary>
/// Gets or sets the german link.
/// </summary>
[XmlAttribute("link_de")]
public string Link_DE
{
get
{
return this.linkDE;
}
set
{
if (value != this.linkDE)
{
this.linkDE = value;
}
}
}
/// <summary>
/// Gets or sets the english link.
/// </summary>
[XmlAttribute("link_en")]
public string Link_EN
{
get
{
return this.linkEN;
}
set
{
if (value != this.linkEN)
{
this.linkEN = 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>
public string Title
{
get
{
if (CultureInfo.CurrentUICulture.Name.StartsWith("de"))
{
return this.titleDE;
}
else
{
return this.titleEN;
}
}
}
/// <summary>
/// Gets the localized link. if the phone is set to german language,
/// the german comment will be returned otherwise the english link.
/// </summary>
public string Link
{
get
{
if (CultureInfo.CurrentUICulture.Name.StartsWith("de"))
{
return this.Link_DE;
}
else
{
return this.Link_EN;
}
}
}
#endregion
}
}

View File

@@ -22,13 +22,15 @@
</Grid.RowDefinitions>
<!--TitlePanel enthält den Namen der Anwendung und den Seitentitel-->
<ProgressBar Name="ProgressBar" Visibility="Collapsed" IsIndeterminate="True"/>
<StackPanel Grid.Row="0" Margin="12,17,0,28">
<Border BorderBrush="{StaticResource PhoneBorderBrush}" BorderThickness="0,0,0,2" >
<TextBlock Text="{Binding Path=LocalizedResources.LectureApp_Title, Source={StaticResource LocalizedStrings}}"/>
</Border>
</StackPanel>
<ProgressBar Name="ProgressBar" Grid.Row="1" Visibility="Collapsed" IsIndeterminate="True"/>
<StackPanel Grid.Row="0" Margin="12,17,0,28">
<TextBlock Text="{Binding Path=LocalizedResources.ApplicationTitle, Source={StaticResource LocalizedStrings}}" Style="{StaticResource PhoneTextNormalStyle}"/>
<TextBlock Text="{Binding Path=LocalizedResources.LectureApp_Title, Source={StaticResource LocalizedStrings}}" Style="{StaticResource PhoneTextTitle2Style}"/>
</StackPanel>
<!--ContentPanel - zusätzliche Inhalte hier platzieren-->
<ScrollViewer Grid.Row="1" Margin="12,0,12,0">
@@ -159,7 +161,7 @@
</Border>
<Border BorderBrush="{StaticResource PhoneBorderBrush}" BorderThickness="0,2,0,0" Grid.Row="5">
<Button Name="SearchButton" Click="SendRequest">
<Image Name="SearchButtonImg" Source="{Binding Path=ThemelizedIcon.Search, Source={StaticResource ThemelizedIcons}}" Width="100" />
<Image Name="SearchButtonImg" Source="{Binding Path=ThemelizedIcon.Search, Source={StaticResource ThemelizedIcons}}" Width="60" />
</Button>
</Border>
</Grid>

View File

@@ -22,7 +22,8 @@
<!--TitlePanel enthält den Namen der Anwendung und den Seitentitel-->
<StackPanel Grid.Row="0" Margin="12,17,0,28">
<TextBlock Text="{Binding Path=LocalizedResources.LectureApp_DetailsHeader, Source={StaticResource LocalizedStrings}}"/>
<TextBlock Text="{Binding Path=LocalizedResources.ApplicationTitle, Source={StaticResource LocalizedStrings}}" Style="{StaticResource PhoneTextNormalStyle}"/>
<TextBlock Text="{Binding Path=LocalizedResources.LectureApp_DetailsHeader, Source={StaticResource LocalizedStrings}}" Style="{StaticResource PhoneTextTitle2Style}"/>
</StackPanel>
<!--ContentPanel - zusätzliche Inhalte hier platzieren-->

View File

@@ -13,39 +13,6 @@
mc:Ignorable="d"
shell:SystemTray.IsVisible="True">
<phone:PhoneApplicationPage.Resources>
<DataTemplate x:Key="LectureItemTemplate">
<Border Background="{x:Null}" BorderBrush="{StaticResource PhoneInverseInactiveBrush}" BorderThickness="0,1,0,0" Padding="0,0,0,0">
<StackPanel>
<Button Click="ToggleOptions" Background="Gray" BorderBrush="Gray" Foreground="Black" Margin="-10,-10,-10,-10" >
<Grid>
<Grid.RowDefinitions>
<RowDefinition Height="auto"/>
</Grid.RowDefinitions>
<Grid.ColumnDefinitions>
<ColumnDefinition Width="auto"/>
<ColumnDefinition Width="auto"/>
<ColumnDefinition Width="*"/>
</Grid.ColumnDefinitions>
<TextBlock Text="{Binding Type}" Grid.Column="0" Grid.Row="0"/>
<TextBlock Text=" : " Grid.Column="1" Grid.Row="0"/>
<TextBlock Text="{Binding Title}" TextWrapping="Wrap" Grid.Column="2" Grid.Row="0"/>
</Grid>
</Button>
<StackPanel Orientation="Horizontal" HorizontalAlignment="Center">
<Button Name="Link" Visibility="Collapsed" Content="Link" Tag="{Binding Modul.Number}" Click="ShowModulWebPage"/>
<Button Name="Details" Visibility="Collapsed" Content="Details" Tag="{Binding Id}" Click="ShowDetailPage"/>
</StackPanel>
</StackPanel>
</Border>
</DataTemplate>
</phone:PhoneApplicationPage.Resources>
<!--LayoutRoot ist das Stammraster, in dem alle anderen Seiteninhalte platziert werden-->
<Grid x:Name="LayoutRoot" Background="Transparent">
<Grid.RowDefinitions>
@@ -55,13 +22,9 @@
<!--TitlePanel enthält den Namen der Anwendung und den Seitentitel-->
<StackPanel Grid.Row="0" Margin="12,17,0,28">
<TextBlock Text="{Binding Path=LocalizedResources.LectureApp_Title, Source={StaticResource LocalizedStrings}}"/>
<TextBlock Text="{Binding Path=LocalizedResources.ApplicationTitle, Source={StaticResource LocalizedStrings}}" Style="{StaticResource PhoneTextNormalStyle}"/>
<TextBlock Text="{Binding Path=LocalizedResources.LectureApp_Title, Source={StaticResource LocalizedStrings}}" Style="{StaticResource PhoneTextTitle2Style}" />
</StackPanel>
<!--ContentPanel - zusätzliche Inhalte hier platzieren-->
<Grid x:Name="ContentPanel" Grid.Row="1" Margin="12,0,12,0">
<!--<phone:LongListSelector Name="ResultList" ItemTemplate="{StaticResource LectureItemTemplate}" HorizontalContentAlignment="Left" /> -->
<ListBox x:Name="ResultList" Grid.Row="1">
<ListBox.ItemContainerStyle>
<Style TargetType="ListBoxItem">
@@ -71,40 +34,30 @@
</ListBox.ItemContainerStyle>
<ListBox.ItemTemplate>
<DataTemplate>
<StackPanel>
<Button Click="ToggleOptions" Background="Gray" BorderBrush="Gray" Foreground="Black" Margin="-10,-10,-10,-10" >
<Grid>
<Grid.RowDefinitions>
<RowDefinition Height="auto"/>
</Grid.RowDefinitions>
<Grid.ColumnDefinitions>
<ColumnDefinition Width="auto"/>
<ColumnDefinition Width="auto"/>
<ColumnDefinition Width="*"/>
</Grid.ColumnDefinitions>
<TextBlock Text="{Binding Type}" Grid.Column="0" Grid.Row="0"/>
<TextBlock Text=" : " Grid.Column="1" Grid.Row="0"/>
<TextBlock Text="{Binding Title}" TextWrapping="Wrap" Grid.Column="2" Grid.Row="0"/>
</Grid>
</Button>
<StackPanel>
<Button Click="ToggleOptions" Background="Gray" BorderBrush="Gray" Foreground="Black" Margin="-10,-10,-10,-10" >
<Grid>
<Grid.RowDefinitions>
<RowDefinition Height="auto"/>
</Grid.RowDefinitions>
<Grid.ColumnDefinitions>
<ColumnDefinition Width="auto"/>
<ColumnDefinition Width="auto"/>
<ColumnDefinition Width="*"/>
</Grid.ColumnDefinitions>
<TextBlock Text="{Binding Type}" Grid.Column="0" Grid.Row="0"/>
<TextBlock Text=" : " Grid.Column="1" Grid.Row="0"/>
<TextBlock Text="{Binding Title}" TextWrapping="Wrap" Grid.Column="2" Grid.Row="0"/>
</Grid>
</Button>
<StackPanel Orientation="Horizontal" HorizontalAlignment="Center" Visibility="Collapsed">
<Button Name="Link" Content="Link" Tag="{Binding Modul.Number}" Click="ShowModulWebPage"/>
<Button Name="Details" Content="Details" Tag="{Binding Id}" Click="ShowDetailPage"/>
</StackPanel>
<Button Name="Link" Content="Link" Tag="{Binding Modul.Number}" Click="ShowModulWebPage"/>
<Button Name="Details" Content="Details" Tag="{Binding Id}" Click="ShowDetailPage"/>
</StackPanel>
</StackPanel>
</DataTemplate>
</ListBox.ItemTemplate>
</ListBox>
</Grid>
</Grid>
</phone:PhoneApplicationPage>

View File

@@ -0,0 +1,61 @@
<phone:PhoneApplicationPage
x:Class="CampusAppWP8.Pages.Links.LinkPage"
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">
<ProgressBar Name="ProgressBar" Visibility="Collapsed" IsIndeterminate="True"/>
<!--Pivotsteuerelement-->
<phone:Pivot Title="{Binding Path=LocalizedResources.ApplicationTitle, Source={StaticResource LocalizedStrings}}">
<!--Pivotelement eins-->
<phone:PivotItem Header="{Binding Path=LocalizedResources.LinkApp_CommonLinks, Source={StaticResource LocalizedStrings}}">
<ListBox x:Name="CommonLinkPanel">
<ListBox.ItemContainerStyle>
<Style TargetType="ListBoxItem">
<Setter Property="HorizontalContentAlignment" Value="Stretch"/>
<Setter Property="HorizontalAlignment" Value="Stretch"/>
</Style>
</ListBox.ItemContainerStyle>
<ListBox.ItemTemplate>
<DataTemplate>
<StackPanel>
<Button Content="{Binding Title}" Background="Gray" BorderBrush="Gray" Foreground="Black" Margin="-10,-10,-10,-10" Click="LinkBtn_Click" Tag="{Binding Link}"/>
</StackPanel>
</DataTemplate>
</ListBox.ItemTemplate>
</ListBox>
</phone:PivotItem>
<!--Pivotelement zwei-->
<phone:PivotItem Header="{Binding Path=LocalizedResources.LinkApp_ClubLinks, Source={StaticResource LocalizedStrings}}">
<ListBox x:Name="ClubLinkPanel">
<ListBox.ItemContainerStyle>
<Style TargetType="ListBoxItem">
<Setter Property="HorizontalContentAlignment" Value="Stretch"/>
<Setter Property="HorizontalAlignment" Value="Stretch"/>
</Style>
</ListBox.ItemContainerStyle>
<ListBox.ItemTemplate>
<DataTemplate>
<StackPanel>
<Button Content="{Binding Title}" Background="Gray" BorderBrush="Gray" Foreground="Black" Margin="-10,-10,-10,-10" Click="LinkBtn_Click" Tag="{Binding Link}"/>
</StackPanel>
</DataTemplate>
</ListBox.ItemTemplate>
</ListBox>
</phone:PivotItem>
</phone:Pivot>
</Grid>
</phone:PhoneApplicationPage>

View File

@@ -0,0 +1,177 @@
//-----------------------------------------------------------------------
// <copyright file="LinkPage.xaml.cs" company="BTU/IIT">
// Company copyright tag.
// </copyright>
// <author>stubbfel</author>
// <sience>02.07.2013</sience>
//----------------------------------------------------------------------
namespace CampusAppWP8.Pages.Links
{
using System;
using System.Windows;
using System.Windows.Navigation;
using CampusAppWP8.Feed.Link;
using CampusAppWP8.Utility;
using Microsoft.Phone.Controls;
using Microsoft.Phone.Tasks;
/// <summary>
/// Class for the LinkPage
/// </summary>
public partial class LinkPage : PhoneApplicationPage
{
#region Members
/// <summary>
/// the feed of the CommonLinks
/// </summary>
private CommonLinkFeed commonLinkFeed;
/// <summary>
/// the feed of the ClubLinks
/// </summary>
private ClubLinkFeed clubLinkFeed;
/// <summary>
/// how many feeds are currently loading
/// </summary>
private int loadingFeeds;
#endregion
#region Constructor
/// <summary>
/// Initializes a new instance of the <see cref="LinkPage" /> class.
/// </summary>
public LinkPage()
{
this.InitializeComponent();
}
#endregion
#region Method
#region protected
/// <summary>
/// Override the OnNavigatedTo method
/// </summary>
/// <param name="e">Arguments of navigation</param>
protected override void OnNavigatedTo(NavigationEventArgs e)
{
base.OnNavigatedTo(e);
this.InitializeFeeds();
this.ProgressBar.Visibility = System.Windows.Visibility.Visible;
this.loadingFeeds = 2;
this.commonLinkFeed.LoadFeed();
this.clubLinkFeed.LoadFeed();
}
#endregion
#region private
/// <summary>
/// Method initialize the Feeds
/// </summary>
private void InitializeFeeds()
{
if (this.commonLinkFeed == null)
{
this.InitializeCommonLinkFeed();
}
if (this.clubLinkFeed == null)
{
this.InitializeClubLinkFeed();
}
}
/// <summary>
/// Method initialize the CommonLinkFeed
/// </summary>
private void InitializeCommonLinkFeed()
{
this.commonLinkFeed = new CommonLinkFeed();
this.commonLinkFeed.EventHandler.FeedIsReadyEvent += new FeedEventHandler.FeedReadyHandler(this.CommonLinkFeedIsReady);
}
/// <summary>
/// Method initialize the ClubLinkFeed
/// </summary>
private void InitializeClubLinkFeed()
{
this.clubLinkFeed = new ClubLinkFeed();
this.clubLinkFeed.EventHandler.FeedIsReadyEvent += new FeedEventHandler.FeedReadyHandler(this.ClubLinkFeedIsReady);
}
/// <summary>
/// Method will be execute if the CommonLinkFeed is ready
/// </summary>
private void CommonLinkFeedIsReady()
{
this.SetupCommonPivot();
this.loadingFeeds--;
if (this.loadingFeeds < 1)
{
this.ProgressBar.Visibility = System.Windows.Visibility.Collapsed;
}
}
/// <summary>
/// Method will be execute if the ClubLinkFeed is ready
/// </summary>
private void ClubLinkFeedIsReady()
{
this.SetupClubPivot();
this.loadingFeeds--;
if (this.loadingFeeds < 1)
{
this.ProgressBar.Visibility = System.Windows.Visibility.Collapsed;
}
}
/// <summary>
/// Method set ItemSource for the CommonLinkPanel
/// </summary>
private void SetupCommonPivot()
{
this.CommonLinkPanel.ItemsSource = this.commonLinkFeed.Model.Links;
}
/// <summary>
/// Method set ItemSource for the ClubLinkPanel
/// </summary>
private void SetupClubPivot()
{
this.ClubLinkPanel.ItemsSource = this.clubLinkFeed.Model.Links;
}
/// <summary>
/// Method open the Link in IE
/// </summary>
/// <param name="sender">clicked bottom</param>
/// <param name="e">some RoutedEventArgs</param>
private void LinkBtn_Click(object sender, RoutedEventArgs e)
{
FrameworkElement linkBtn = sender as FrameworkElement;
if (linkBtn.Tag == null)
{
return;
}
Uri linkUrl = new Uri(linkBtn.Tag as string, UriKind.Absolute);
WebBrowserTask webBrowserTask = new WebBrowserTask();
webBrowserTask.Uri = linkUrl;
webBrowserTask.Show();
}
#endregion
#endregion
}
}

View File

@@ -294,6 +294,24 @@ namespace CampusAppWP8.Resources {
}
}
/// <summary>
/// Sucht eine lokalisierte Zeichenfolge, die stud. Vereine ähnelt.
/// </summary>
public static string LinkApp_ClubLinks {
get {
return ResourceManager.GetString("LinkApp_ClubLinks", resourceCulture);
}
}
/// <summary>
/// Sucht eine lokalisierte Zeichenfolge, die allg. Links ähnelt.
/// </summary>
public static string LinkApp_CommonLinks {
get {
return ResourceManager.GetString("LinkApp_CommonLinks", resourceCulture);
}
}
/// <summary>
/// Sucht eine lokalisierte Zeichenfolge, die Links ähnelt.
/// </summary>

View File

@@ -287,4 +287,10 @@
<data name="Time_Day_Sunday" xml:space="preserve">
<value>Sonntag</value>
</data>
<data name="LinkApp_ClubLinks" xml:space="preserve">
<value>stud. Vereine</value>
</data>
<data name="LinkApp_CommonLinks" xml:space="preserve">
<value>allg. Links</value>
</data>
</root>

View File

@@ -60,6 +60,24 @@ namespace CampusAppWP8.Resources {
}
}
/// <summary>
/// Sucht eine lokalisierte Zeichenfolge, die ClubLinks.xml ähnelt.
/// </summary>
internal static string FileLink_ClubLinks {
get {
return ResourceManager.GetString("FileLink_ClubLinks", resourceCulture);
}
}
/// <summary>
/// Sucht eine lokalisierte Zeichenfolge, die CommonLinks.xml ähnelt.
/// </summary>
internal static string FileLink_CommonLinks {
get {
return ResourceManager.GetString("FileLink_CommonLinks", resourceCulture);
}
}
/// <summary>
/// Sucht eine lokalisierte Zeichenfolge, die LectureModel ähnelt.
/// </summary>
@@ -204,6 +222,15 @@ namespace CampusAppWP8.Resources {
}
}
/// <summary>
/// Sucht eine lokalisierte Zeichenfolge, die /Pages/Links/LinkPage.xaml ähnelt.
/// </summary>
internal static string PathLinks_LinkPage {
get {
return ResourceManager.GetString("PathLinks_LinkPage", resourceCulture);
}
}
/// <summary>
/// Sucht eine lokalisierte Zeichenfolge, die /Pages/Webmail/WebmailPage.xaml ähnelt.
/// </summary>
@@ -258,6 +285,24 @@ namespace CampusAppWP8.Resources {
}
}
/// <summary>
/// Sucht eine lokalisierte Zeichenfolge, die http://www.tu-cottbus.de/campusapp-data/getdata.php?db=clubs&amp;app=2&amp;appversion=1 ähnelt.
/// </summary>
internal static string UrlLink_ClubLinks {
get {
return ResourceManager.GetString("UrlLink_ClubLinks", resourceCulture);
}
}
/// <summary>
/// Sucht eine lokalisierte Zeichenfolge, die http://www.tu-cottbus.de/campusapp-data/getdata.php?db=links&amp;app=2&amp;appversion=1 ähnelt.
/// </summary>
internal static string UrlLink_CommonLinks {
get {
return ResourceManager.GetString("UrlLink_CommonLinks", resourceCulture);
}
}
/// <summary>
/// Sucht eine lokalisierte Zeichenfolge, die https://webmail.tu-cottbus.de ähnelt.
/// </summary>

View File

@@ -189,4 +189,19 @@
<data name="PathOpeninghours_OpeninghoursPage" xml:space="preserve">
<value>/Pages/Openinghours/OpeninghoursPage.xaml</value>
</data>
<data name="FileLink_ClubLinks" xml:space="preserve">
<value>ClubLinks.xml</value>
</data>
<data name="FileLink_CommonLinks" xml:space="preserve">
<value>CommonLinks.xml</value>
</data>
<data name="UrlLink_ClubLinks" xml:space="preserve">
<value>http://www.tu-cottbus.de/campusapp-data/getdata.php?db=clubs&amp;app=2&amp;appversion=1</value>
</data>
<data name="UrlLink_CommonLinks" xml:space="preserve">
<value>http://www.tu-cottbus.de/campusapp-data/getdata.php?db=links&amp;app=2&amp;appversion=1</value>
</data>
<data name="PathLinks_LinkPage" xml:space="preserve">
<value>/Pages/Links/LinkPage.xaml</value>
</data>
</root>

View File

@@ -122,7 +122,7 @@
</StackPanel>
</Button>
<Button Name="LinkAppButton" Grid.Row="3" Grid.Column="2" BorderBrush="{x:Null}" Background="{x:Null}" VerticalContentAlignment="Stretch" HorizontalContentAlignment="Stretch" BorderThickness="0" Padding="0" IsEnabled="False">
<Button Name="LinkAppButton" Grid.Row="3" Grid.Column="2" BorderBrush="{x:Null}" Background="{x:Null}" VerticalContentAlignment="Stretch" HorizontalContentAlignment="Stretch" BorderThickness="0" Padding="0" Click="OpenLinkApp">
<StackPanel Height="auto" Margin="-12,-12,-12,-12">
<Image Source="{Binding Path=ThemelizedIcon.Link, Source={StaticResource ThemelizedIcons}}" Height="100" Visibility="Visible"/>
<TextBlock Text="{Binding Path=LocalizedResources.LinkApp_Title, Source={StaticResource LocalizedStrings}}" Height="Auto" VerticalAlignment="Center" HorizontalAlignment="Center" />

View File

@@ -130,5 +130,16 @@ namespace CampusAppWP8.Pages
Uri url = new Uri(Constants.PathOpeninghours_OpeninghoursPage, UriKind.Relative);
NavigationService.Navigate(url);
}
/// <summary>
/// Opens the Linkpage.
/// </summary>
/// <param name="sender">link button</param>
/// <param name="e">event args</param>
private void OpenLinkApp(object sender, RoutedEventArgs e)
{
Uri url = new Uri(Constants.PathLinks_LinkPage, UriKind.Relative);
NavigationService.Navigate(url);
}
}
}

View File

@@ -21,8 +21,7 @@
<DataTemplate>
<StackPanel>
<TextBlock Text="{Binding Day}" />
<TextBlock Text="{Binding Day}" />
</StackPanel>
</DataTemplate>