Compare commits
29 Commits
pagesdraft
...
initgitflo
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
590cf43751 | ||
|
|
5b66041f81 | ||
|
|
9a81b166cd | ||
|
|
70a8f7a266 | ||
|
|
4bde4a8ba2 | ||
|
|
66e5bd95b8 | ||
|
|
8c8d5bc2ce | ||
|
|
a71a67cd06 | ||
|
|
d935b7c2d9 | ||
|
|
61c0a9c736 | ||
|
|
4b41d8b764 | ||
|
|
1bf0531e34 | ||
|
|
6f92d8f268 | ||
|
|
13c2e96867 | ||
|
|
faa5dc7440 | ||
|
|
29bc862035 | ||
|
|
c2bfc2b1d3 | ||
|
|
78ff7bf24f | ||
|
|
c3a9109a7e | ||
|
|
1265e916c7 | ||
|
|
586718d983 | ||
|
|
ffa0d8a009 | ||
|
|
04695ee32f | ||
|
|
159dab18f3 | ||
|
|
4ef5e7995b | ||
|
|
fa9f3c0fe2 | ||
|
|
a5c37eef1e | ||
|
|
c60fb42122 | ||
|
|
56d7145878 |
@@ -7,6 +7,7 @@ using System.Windows.Navigation;
|
|||||||
using Microsoft.Phone.Controls;
|
using Microsoft.Phone.Controls;
|
||||||
using Microsoft.Phone.Shell;
|
using Microsoft.Phone.Shell;
|
||||||
using CampusAppWP8.Resources;
|
using CampusAppWP8.Resources;
|
||||||
|
using System.IO.IsolatedStorage;
|
||||||
|
|
||||||
|
|
||||||
namespace CampusAppWP8
|
namespace CampusAppWP8
|
||||||
@@ -59,6 +60,37 @@ namespace CampusAppWP8
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Method save any object to the IsolatedStorage
|
||||||
|
/// </summary>
|
||||||
|
/// <param name="key"> key of the object</param>
|
||||||
|
/// <param name="value">value of the object, if value == null => remove key</param>
|
||||||
|
public static void SaveToIsolatedStorage<T>(string key, T value)
|
||||||
|
{
|
||||||
|
IsolatedStorageSettings isolatedStore = IsolatedStorageSettings.ApplicationSettings;
|
||||||
|
isolatedStore.Remove(key);
|
||||||
|
if (value != null)
|
||||||
|
{
|
||||||
|
isolatedStore.Add(key, value);
|
||||||
|
}
|
||||||
|
|
||||||
|
isolatedStore.Save();
|
||||||
|
}
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Method load any object to the IsolatedStorage
|
||||||
|
/// </summary>
|
||||||
|
/// <param name="key"> key of the object</param>
|
||||||
|
public static T LoadFromIsolatedStorage<T>(string key)
|
||||||
|
{
|
||||||
|
IsolatedStorageSettings isolatedStore = IsolatedStorageSettings.ApplicationSettings;
|
||||||
|
|
||||||
|
if(isolatedStore.Contains(key)) {
|
||||||
|
object value = isolatedStore[key];
|
||||||
|
return (T)value;
|
||||||
|
}
|
||||||
|
return default(T);
|
||||||
|
}
|
||||||
// Code, der beim Starten der Anwendung ausgeführt werden soll (z. B. über "Start")
|
// Code, der beim Starten der Anwendung ausgeführt werden soll (z. B. über "Start")
|
||||||
// Dieser Code wird beim Reaktivieren der Anwendung nicht ausgeführt
|
// Dieser Code wird beim Reaktivieren der Anwendung nicht ausgeführt
|
||||||
private void Application_Launching(object sender, LaunchingEventArgs e)
|
private void Application_Launching(object sender, LaunchingEventArgs e)
|
||||||
|
|||||||
BIN
CampusAppWP8/CampusAppWP8/Assets/icons/campus_159_dark.png
Normal file
|
After Width: | Height: | Size: 5.4 KiB |
BIN
CampusAppWP8/CampusAppWP8/Assets/icons/campus_159_light.png
Normal file
|
After Width: | Height: | Size: 5.1 KiB |
BIN
CampusAppWP8/CampusAppWP8/Assets/icons/departments_159_dark.png
Normal file
|
After Width: | Height: | Size: 5.5 KiB |
BIN
CampusAppWP8/CampusAppWP8/Assets/icons/departments_159_light.png
Normal file
|
After Width: | Height: | Size: 5.1 KiB |
BIN
CampusAppWP8/CampusAppWP8/Assets/icons/homework_159_dark.png
Normal file
|
After Width: | Height: | Size: 9.2 KiB |
BIN
CampusAppWP8/CampusAppWP8/Assets/icons/homework_159_light.png
Normal file
|
After Width: | Height: | Size: 9.0 KiB |
BIN
CampusAppWP8/CampusAppWP8/Assets/icons/lectures_159_dark.png
Normal file
|
After Width: | Height: | Size: 7.6 KiB |
BIN
CampusAppWP8/CampusAppWP8/Assets/icons/lectures_159_light.png
Normal file
|
After Width: | Height: | Size: 7.3 KiB |
BIN
CampusAppWP8/CampusAppWP8/Assets/icons/link_159_dark.png
Normal file
|
After Width: | Height: | Size: 8.5 KiB |
BIN
CampusAppWP8/CampusAppWP8/Assets/icons/link_159_light.png
Normal file
|
After Width: | Height: | Size: 7.9 KiB |
BIN
CampusAppWP8/CampusAppWP8/Assets/icons/mensa_159_dark.png
Normal file
|
After Width: | Height: | Size: 9.2 KiB |
BIN
CampusAppWP8/CampusAppWP8/Assets/icons/mensa_159_light.png
Normal file
|
After Width: | Height: | Size: 8.8 KiB |
BIN
CampusAppWP8/CampusAppWP8/Assets/icons/news_159_dark.png
Normal file
|
After Width: | Height: | Size: 7.1 KiB |
BIN
CampusAppWP8/CampusAppWP8/Assets/icons/news_159_light.png
Normal file
|
After Width: | Height: | Size: 6.7 KiB |
BIN
CampusAppWP8/CampusAppWP8/Assets/icons/openhours_159_dark.png
Normal file
|
After Width: | Height: | Size: 9.5 KiB |
BIN
CampusAppWP8/CampusAppWP8/Assets/icons/openhours_159_light.png
Normal file
|
After Width: | Height: | Size: 9.1 KiB |
BIN
CampusAppWP8/CampusAppWP8/Assets/icons/schedule_159_dark.png
Normal file
|
After Width: | Height: | Size: 6.9 KiB |
BIN
CampusAppWP8/CampusAppWP8/Assets/icons/schedule_159_light.png
Normal file
|
After Width: | Height: | Size: 6.0 KiB |
|
After Width: | Height: | Size: 7.5 KiB |
|
After Width: | Height: | Size: 7.0 KiB |
BIN
CampusAppWP8/CampusAppWP8/Assets/icons/webmail_159_dark.png
Normal file
|
After Width: | Height: | Size: 6.5 KiB |
BIN
CampusAppWP8/CampusAppWP8/Assets/icons/webmail_159_light.png
Normal file
|
After Width: | Height: | Size: 6.2 KiB |
@@ -97,38 +97,65 @@
|
|||||||
<DependentUpon>App.xaml</DependentUpon>
|
<DependentUpon>App.xaml</DependentUpon>
|
||||||
</Compile>
|
</Compile>
|
||||||
<Compile Include="LocalizedStrings.cs" />
|
<Compile Include="LocalizedStrings.cs" />
|
||||||
<Compile Include="Model\departments\ChairModel.cs" />
|
<Compile Include="Model\Departments\ChairModel.cs" />
|
||||||
<Compile Include="Model\departments\DepartmentModel.cs" />
|
<Compile Include="Model\Departments\DepartmentModel.cs" />
|
||||||
<Compile Include="Model\departments\DepartmentViewModel.cs" />
|
<Compile Include="Model\Departments\DepartmentViewModel.cs" />
|
||||||
<Compile Include="Model\departments\FacultyModel.cs" />
|
<Compile Include="Model\Departments\FacultyModel.cs" />
|
||||||
|
<Compile Include="Model\Events\RSSChannelModel.cs" />
|
||||||
|
<Compile Include="Model\Events\RSSViewModel.cs" />
|
||||||
|
<Compile Include="Model\Lecture\LectureActivity.cs" />
|
||||||
|
<Compile Include="Model\Lecture\LectureCourse.cs" />
|
||||||
|
<Compile Include="Model\Lecture\LectureDate.cs" />
|
||||||
|
<Compile Include="Model\Lecture\LectureLecturer.cs" />
|
||||||
|
<Compile Include="Model\Lecture\LectureList.cs" />
|
||||||
|
<Compile Include="Model\Lecture\LectureModul.cs" />
|
||||||
<Compile Include="Model\Mensa\MenuModel.cs" />
|
<Compile Include="Model\Mensa\MenuModel.cs" />
|
||||||
<Compile Include="Model\Mensa\MenuWeekModel.cs" />
|
<Compile Include="Model\Mensa\MenuWeekModel.cs" />
|
||||||
<Compile Include="Pages\campusmap\CampusMapPage.xaml.cs">
|
<Compile Include="Pages\Campusmap\CampusMapPage.xaml.cs">
|
||||||
<DependentUpon>CampusMapPage.xaml</DependentUpon>
|
<DependentUpon>CampusMapPage.xaml</DependentUpon>
|
||||||
</Compile>
|
</Compile>
|
||||||
<Compile Include="Pages\departments\DepartmentPage.xaml.cs">
|
<Compile Include="Pages\Lecture\LectureFeed.cs" />
|
||||||
|
<Compile Include="Feed\Departments\DepartmentFeed.cs" />
|
||||||
|
<Compile Include="Pages\Departments\DepartmentPage.xaml.cs">
|
||||||
<DependentUpon>DepartmentPage.xaml</DependentUpon>
|
<DependentUpon>DepartmentPage.xaml</DependentUpon>
|
||||||
</Compile>
|
</Compile>
|
||||||
<Compile Include="Pages\lecture\LecturePage.xaml.cs">
|
<Compile Include="Feed\Events\EventFeed.cs" />
|
||||||
|
<Compile Include="Pages\Events\EventIndexPage.xaml.cs">
|
||||||
|
<DependentUpon>EventIndexPage.xaml</DependentUpon>
|
||||||
|
</Compile>
|
||||||
|
<Compile Include="Pages\Events\EventPage.xaml.cs">
|
||||||
|
<DependentUpon>EventPage.xaml</DependentUpon>
|
||||||
|
</Compile>
|
||||||
|
<Compile Include="pages\lecture\LecturePage.xaml.cs">
|
||||||
<DependentUpon>LecturePage.xaml</DependentUpon>
|
<DependentUpon>LecturePage.xaml</DependentUpon>
|
||||||
</Compile>
|
</Compile>
|
||||||
<Compile Include="Model\BaseModel.cs" />
|
<Compile Include="Model\BaseModel.cs" />
|
||||||
<Compile Include="Model\BaseViewModel.cs" />
|
<Compile Include="Model\BaseViewModel.cs" />
|
||||||
<Compile Include="Feed\Mensa\MensaFeed.cs" />
|
<Compile Include="Feed\Mensa\MensaFeed.cs" />
|
||||||
|
<Compile Include="Pages\Lecture\ModulWebPage.xaml.cs">
|
||||||
|
<DependentUpon>ModulWebPage.xaml</DependentUpon>
|
||||||
|
</Compile>
|
||||||
|
<Compile Include="Pages\Lecture\ResultDetailPage.xaml.cs">
|
||||||
|
<DependentUpon>ResultDetailPage.xaml</DependentUpon>
|
||||||
|
</Compile>
|
||||||
|
<Compile Include="Pages\Lecture\ResultPage.xaml.cs">
|
||||||
|
<DependentUpon>ResultPage.xaml</DependentUpon>
|
||||||
|
</Compile>
|
||||||
<Compile Include="Pages\Mensa\MensaPage.xaml.cs">
|
<Compile Include="Pages\Mensa\MensaPage.xaml.cs">
|
||||||
<DependentUpon>MensaPage.xaml</DependentUpon>
|
<DependentUpon>MensaPage.xaml</DependentUpon>
|
||||||
</Compile>
|
</Compile>
|
||||||
<Compile Include="Pages\news\NewsPage.xaml.cs">
|
<Compile Include="Feed\News\NewsFeed.cs" />
|
||||||
|
<Compile Include="Pages\News\NewsIndexPage.xaml.cs">
|
||||||
|
<DependentUpon>NewsIndexPage.xaml</DependentUpon>
|
||||||
|
</Compile>
|
||||||
|
<Compile Include="Pages\News\NewsPage.xaml.cs">
|
||||||
<DependentUpon>NewsPage.xaml</DependentUpon>
|
<DependentUpon>NewsPage.xaml</DependentUpon>
|
||||||
</Compile>
|
</Compile>
|
||||||
<Compile Include="Pages\news\RSSItem.cs" />
|
<Compile Include="Model\Events\RSSModel.cs" />
|
||||||
<Compile Include="Pages\news\RSSNewsTemplate.xaml.cs">
|
<Compile Include="pages\StartPage.xaml.cs">
|
||||||
<DependentUpon>RSSNewsTemplate.xaml</DependentUpon>
|
|
||||||
</Compile>
|
|
||||||
<Compile Include="Pages\StartPage.xaml.cs">
|
|
||||||
<DependentUpon>StartPage.xaml</DependentUpon>
|
<DependentUpon>StartPage.xaml</DependentUpon>
|
||||||
</Compile>
|
</Compile>
|
||||||
<Compile Include="Pages\webmail\WebmailPage.xaml.cs">
|
<Compile Include="Pages\Webmail\WebmailPage.xaml.cs">
|
||||||
<DependentUpon>WebmailPage.xaml</DependentUpon>
|
<DependentUpon>WebmailPage.xaml</DependentUpon>
|
||||||
</Compile>
|
</Compile>
|
||||||
<Compile Include="Properties\AssemblyInfo.cs" />
|
<Compile Include="Properties\AssemblyInfo.cs" />
|
||||||
@@ -147,6 +174,8 @@
|
|||||||
<Compile Include="Utility\FileList.cs" />
|
<Compile Include="Utility\FileList.cs" />
|
||||||
<Compile Include="Utility\FileManager.cs" />
|
<Compile Include="Utility\FileManager.cs" />
|
||||||
<Compile Include="Utility\Logger.cs" />
|
<Compile Include="Utility\Logger.cs" />
|
||||||
|
<Compile Include="Utility\RestApi.cs" />
|
||||||
|
<Compile Include="Utility\StringManager.cs" />
|
||||||
<Compile Include="Utility\URLList.cs" />
|
<Compile Include="Utility\URLList.cs" />
|
||||||
<Compile Include="Utility\XmlFeed.cs" />
|
<Compile Include="Utility\XmlFeed.cs" />
|
||||||
</ItemGroup>
|
</ItemGroup>
|
||||||
@@ -155,35 +184,55 @@
|
|||||||
<SubType>Designer</SubType>
|
<SubType>Designer</SubType>
|
||||||
<Generator>MSBuild:Compile</Generator>
|
<Generator>MSBuild:Compile</Generator>
|
||||||
</ApplicationDefinition>
|
</ApplicationDefinition>
|
||||||
<Page Include="Pages\campusmap\CampusMapPage.xaml">
|
<Page Include="Pages\Campusmap\CampusMapPage.xaml">
|
||||||
<SubType>Designer</SubType>
|
<SubType>Designer</SubType>
|
||||||
<Generator>MSBuild:Compile</Generator>
|
<Generator>MSBuild:Compile</Generator>
|
||||||
</Page>
|
</Page>
|
||||||
<Page Include="Pages\departments\DepartmentPage.xaml">
|
<Page Include="Pages\Departments\DepartmentPage.xaml">
|
||||||
<SubType>Designer</SubType>
|
<SubType>Designer</SubType>
|
||||||
<Generator>MSBuild:Compile</Generator>
|
<Generator>MSBuild:Compile</Generator>
|
||||||
</Page>
|
</Page>
|
||||||
<Page Include="Pages\lecture\LecturePage.xaml">
|
<Page Include="Pages\Lecture\LecturePage.xaml">
|
||||||
<SubType>Designer</SubType>
|
<SubType>Designer</SubType>
|
||||||
<Generator>MSBuild:Compile</Generator>
|
<Generator>MSBuild:Compile</Generator>
|
||||||
</Page>
|
</Page>
|
||||||
|
<Page Include="Pages\Lecture\ModulWebPage.xaml">
|
||||||
|
<SubType>Designer</SubType>
|
||||||
|
<Generator>MSBuild:Compile</Generator>
|
||||||
|
</Page>
|
||||||
|
<Page Include="Pages\Lecture\ResultDetailPage.xaml">
|
||||||
|
<SubType>Designer</SubType>
|
||||||
|
<Generator>MSBuild:Compile</Generator>
|
||||||
|
</Page>
|
||||||
|
<Page Include="Pages\Lecture\ResultPage.xaml">
|
||||||
|
<SubType>Designer</SubType>
|
||||||
|
<Generator>MSBuild:Compile</Generator>
|
||||||
|
</Page>
|
||||||
|
<Page Include="Pages\Events\EventIndexPage.xaml">
|
||||||
|
<SubType>Designer</SubType>
|
||||||
|
<Generator>MSBuild:Compile</Generator>
|
||||||
|
</Page>
|
||||||
|
<Page Include="Pages\Events\EventPage.xaml">
|
||||||
|
<Generator>MSBuild:Compile</Generator>
|
||||||
|
<SubType>Designer</SubType>
|
||||||
|
</Page>
|
||||||
<Page Include="Pages\Mensa\MensaPage.xaml">
|
<Page Include="Pages\Mensa\MensaPage.xaml">
|
||||||
<Generator>MSBuild:Compile</Generator>
|
<Generator>MSBuild:Compile</Generator>
|
||||||
<SubType>Designer</SubType>
|
<SubType>Designer</SubType>
|
||||||
</Page>
|
</Page>
|
||||||
<Page Include="Pages\news\NewsPage.xaml">
|
<Page Include="Pages\News\NewsIndexPage.xaml">
|
||||||
<SubType>Designer</SubType>
|
<SubType>Designer</SubType>
|
||||||
<Generator>MSBuild:Compile</Generator>
|
<Generator>MSBuild:Compile</Generator>
|
||||||
</Page>
|
</Page>
|
||||||
<Page Include="Pages\news\RSSNewsTemplate.xaml">
|
<Page Include="Pages\News\NewsPage.xaml">
|
||||||
<SubType>Designer</SubType>
|
<SubType>Designer</SubType>
|
||||||
<Generator>MSBuild:Compile</Generator>
|
<Generator>MSBuild:Compile</Generator>
|
||||||
</Page>
|
</Page>
|
||||||
<Page Include="Pages\StartPage.xaml">
|
<Page Include="pages\StartPage.xaml">
|
||||||
<SubType>Designer</SubType>
|
<SubType>Designer</SubType>
|
||||||
<Generator>MSBuild:Compile</Generator>
|
<Generator>MSBuild:Compile</Generator>
|
||||||
</Page>
|
</Page>
|
||||||
<Page Include="Pages\webmail\WebmailPage.xaml">
|
<Page Include="Pages\Webmail\WebmailPage.xaml">
|
||||||
<Generator>MSBuild:Compile</Generator>
|
<Generator>MSBuild:Compile</Generator>
|
||||||
<SubType>Designer</SubType>
|
<SubType>Designer</SubType>
|
||||||
</Page>
|
</Page>
|
||||||
@@ -202,6 +251,28 @@
|
|||||||
<Content Include="Assets\ApplicationIcon.png">
|
<Content Include="Assets\ApplicationIcon.png">
|
||||||
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
|
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
|
||||||
</Content>
|
</Content>
|
||||||
|
<Content Include="Assets\icons\campus_159_dark.png" />
|
||||||
|
<Content Include="Assets\icons\campus_159_light.png" />
|
||||||
|
<Content Include="Assets\icons\departments_159_dark.png" />
|
||||||
|
<Content Include="Assets\icons\departments_159_light.png" />
|
||||||
|
<Content Include="Assets\icons\homework_159_dark.png" />
|
||||||
|
<Content Include="Assets\icons\homework_159_light.png" />
|
||||||
|
<Content Include="Assets\icons\link_159_dark.png" />
|
||||||
|
<Content Include="Assets\icons\link_159_light.png" />
|
||||||
|
<Content Include="Assets\icons\lectures_159_dark.png" />
|
||||||
|
<Content Include="Assets\icons\lectures_159_light.png" />
|
||||||
|
<Content Include="Assets\icons\mensa_159_dark.png" />
|
||||||
|
<Content Include="Assets\icons\mensa_159_light.png" />
|
||||||
|
<Content Include="Assets\icons\news_159_dark.png" />
|
||||||
|
<Content Include="Assets\icons\news_159_light.png" />
|
||||||
|
<Content Include="Assets\icons\openhours_159_dark.png" />
|
||||||
|
<Content Include="Assets\icons\openhours_159_light.png" />
|
||||||
|
<Content Include="Assets\icons\schedule_159_dark.png" />
|
||||||
|
<Content Include="Assets\icons\schedule_159_light.png" />
|
||||||
|
<Content Include="Assets\icons\student_council_159_dark.png" />
|
||||||
|
<Content Include="Assets\icons\student_council_159_light.png" />
|
||||||
|
<Content Include="Assets\icons\webmail_159_dark.png" />
|
||||||
|
<Content Include="Assets\icons\webmail_159_light.png" />
|
||||||
<Content Include="Assets\Tiles\FlipCycleTileLarge.png">
|
<Content Include="Assets\Tiles\FlipCycleTileLarge.png">
|
||||||
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
|
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
|
||||||
</Content>
|
</Content>
|
||||||
@@ -227,6 +298,7 @@
|
|||||||
<EmbeddedResource Include="Resources\AppResources.resx">
|
<EmbeddedResource Include="Resources\AppResources.resx">
|
||||||
<Generator>PublicResXFileCodeGenerator</Generator>
|
<Generator>PublicResXFileCodeGenerator</Generator>
|
||||||
<LastGenOutput>AppResources.Designer.cs</LastGenOutput>
|
<LastGenOutput>AppResources.Designer.cs</LastGenOutput>
|
||||||
|
<SubType>Designer</SubType>
|
||||||
</EmbeddedResource>
|
</EmbeddedResource>
|
||||||
<EmbeddedResource Include="Resources\Constants.resx">
|
<EmbeddedResource Include="Resources\Constants.resx">
|
||||||
<Generator>ResXFileCodeGenerator</Generator>
|
<Generator>ResXFileCodeGenerator</Generator>
|
||||||
|
|||||||
37
CampusAppWP8/CampusAppWP8/Feed/Departments/DepartmentFeed.cs
Normal file
@@ -0,0 +1,37 @@
|
|||||||
|
using CampusAppWP8.Model.Departments;
|
||||||
|
using CampusAppWP8.Utility;
|
||||||
|
using System;
|
||||||
|
using System.Collections.Generic;
|
||||||
|
using System.Linq;
|
||||||
|
using System.Text;
|
||||||
|
using System.Threading.Tasks;
|
||||||
|
|
||||||
|
namespace CampusAppWP8.Feed.Departments
|
||||||
|
{
|
||||||
|
class DepartmentFeed : XmlFeed<DepartmentViewModel>
|
||||||
|
{
|
||||||
|
public DepartmentFeed() : base(URLList.DepartmentFeedURL, "DepartmentFeed.xml")
|
||||||
|
{
|
||||||
|
|
||||||
|
}
|
||||||
|
public System.Collections.ObjectModel.ObservableCollection<FacultyModel> _faculties { get; set; }
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Method implement CheckIsModelUpToDate()-Method <see cref="Feed"/>
|
||||||
|
/// </summary>
|
||||||
|
/// <returns>true, if model is up-to-date, otherwise false</returns>
|
||||||
|
protected override bool CheckIsModelUpToDate()
|
||||||
|
{
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Method implement CheckIsFileUpToDate()-Method <see cref="Feed"/>
|
||||||
|
/// </summary>
|
||||||
|
/// <returns>true, if file is up-to-date, otherwise false</returns>
|
||||||
|
protected override bool CheckIsFileUpToDate()
|
||||||
|
{
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
41
CampusAppWP8/CampusAppWP8/Feed/Events/EventFeed.cs
Normal file
@@ -0,0 +1,41 @@
|
|||||||
|
using System;
|
||||||
|
using System.Collections.Generic;
|
||||||
|
using System.Linq;
|
||||||
|
using System.Text;
|
||||||
|
using System.Threading.Tasks;
|
||||||
|
|
||||||
|
using CampusAppWP8.Model.events_news;
|
||||||
|
using CampusAppWP8.Utility;
|
||||||
|
|
||||||
|
namespace CampusAppWP8.Feed.Events
|
||||||
|
{
|
||||||
|
/// <summary>
|
||||||
|
/// Event Feed.
|
||||||
|
/// </summary>
|
||||||
|
public class EventFeed : XmlFeed<RSSViewModel>
|
||||||
|
{
|
||||||
|
/// <summary>
|
||||||
|
/// Default constructor.
|
||||||
|
/// </summary>
|
||||||
|
public EventFeed() : base(URLList.EventsFeedURL, "EventFeed.xml")
|
||||||
|
{
|
||||||
|
}
|
||||||
|
/// <summary>
|
||||||
|
/// Method implement CheckIsModelUpToDate()-Method <see cref="Feed"/>
|
||||||
|
/// </summary>
|
||||||
|
/// <returns>true, if model is up-to-date, otherwise false</returns>
|
||||||
|
protected override bool CheckIsModelUpToDate()
|
||||||
|
{
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Method implement CheckIsFileUpToDate()-Method <see cref="Feed"/>
|
||||||
|
/// </summary>
|
||||||
|
/// <returns>true, if file is up-to-date, otherwise false</returns>
|
||||||
|
protected override bool CheckIsFileUpToDate()
|
||||||
|
{
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -29,15 +29,6 @@ namespace CampusAppWP8.Pages.Mensa
|
|||||||
|
|
||||||
#endregion
|
#endregion
|
||||||
|
|
||||||
#region Proberty
|
|
||||||
|
|
||||||
/// <summary>
|
|
||||||
/// Gets or sets i List of MenuModel
|
|
||||||
/// </summary>
|
|
||||||
public ObservableCollection<MenuModel> Menus { get; set; }
|
|
||||||
|
|
||||||
#endregion
|
|
||||||
|
|
||||||
#region Method
|
#region Method
|
||||||
|
|
||||||
#region Protected
|
#region Protected
|
||||||
@@ -66,22 +57,6 @@ namespace CampusAppWP8.Pages.Mensa
|
|||||||
|
|
||||||
#region Private
|
#region Private
|
||||||
|
|
||||||
/// <summary>
|
|
||||||
/// Method calculate this day of the week, which its gets new menus
|
|
||||||
/// </summary>
|
|
||||||
/// <returns>Date of NewMenuWeekDay</returns>
|
|
||||||
private DateTime CalcNewMenuWeekDay()
|
|
||||||
{
|
|
||||||
DateTime now = DateTime.Now;
|
|
||||||
while (now.DayOfWeek != DayOfWeek.Monday)
|
|
||||||
{
|
|
||||||
now = now.Subtract(new TimeSpan(1, 0, 0, 0));
|
|
||||||
}
|
|
||||||
|
|
||||||
DateTime monday = new DateTime(now.Year, now.Month, now.Day);
|
|
||||||
return monday;
|
|
||||||
}
|
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Method check if the last modification was later as the NewMenuWeekDay
|
/// Method check if the last modification was later as the NewMenuWeekDay
|
||||||
/// </summary>
|
/// </summary>
|
||||||
@@ -89,7 +64,7 @@ namespace CampusAppWP8.Pages.Mensa
|
|||||||
/// <returns>true, if is up-to-date, otherwise false</returns>
|
/// <returns>true, if is up-to-date, otherwise false</returns>
|
||||||
private bool CheckIsUpToDate(DateTime lastModified)
|
private bool CheckIsUpToDate(DateTime lastModified)
|
||||||
{
|
{
|
||||||
int diff = lastModified.CompareTo(this.CalcNewMenuWeekDay());
|
int diff = lastModified.CompareTo(MenuWeekModel.CalcFirstWeekDay());
|
||||||
|
|
||||||
if (diff < 0)
|
if (diff < 0)
|
||||||
{
|
{
|
||||||
|
|||||||
42
CampusAppWP8/CampusAppWP8/Feed/News/NewsFeed.cs
Normal file
@@ -0,0 +1,42 @@
|
|||||||
|
using System;
|
||||||
|
using System.Collections.Generic;
|
||||||
|
using System.Linq;
|
||||||
|
using System.Text;
|
||||||
|
using System.Threading.Tasks;
|
||||||
|
|
||||||
|
using CampusAppWP8.Model.events_news;
|
||||||
|
using CampusAppWP8.Utility;
|
||||||
|
|
||||||
|
namespace CampusAppWP8.Feed.News
|
||||||
|
{
|
||||||
|
/// <summary>
|
||||||
|
/// News Feed.
|
||||||
|
/// </summary>
|
||||||
|
public class NewsFeed : XmlFeed<RSSViewModel>
|
||||||
|
{
|
||||||
|
/// <summary>
|
||||||
|
/// Default constructor.
|
||||||
|
/// </summary>
|
||||||
|
public NewsFeed() : base(URLList.NewsFeedURL, "NewsFeed.xml")
|
||||||
|
{
|
||||||
|
}
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Method implement CheckIsModelUpToDate()-Method <see cref="Feed"/>
|
||||||
|
/// </summary>
|
||||||
|
/// <returns>true, if model is up-to-date, otherwise false</returns>
|
||||||
|
protected override bool CheckIsModelUpToDate()
|
||||||
|
{
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Method implement CheckIsFileUpToDate()-Method <see cref="Feed"/>
|
||||||
|
/// </summary>
|
||||||
|
/// <returns>true, if file is up-to-date, otherwise false</returns>
|
||||||
|
protected override bool CheckIsFileUpToDate()
|
||||||
|
{
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
90
CampusAppWP8/CampusAppWP8/Model/Departments/ChairModel.cs
Normal file
@@ -0,0 +1,90 @@
|
|||||||
|
using System;
|
||||||
|
using System.Collections.Generic;
|
||||||
|
using System.Linq;
|
||||||
|
using System.Text;
|
||||||
|
using System.Xml.Serialization;
|
||||||
|
|
||||||
|
namespace CampusAppWP8.Model.Departments
|
||||||
|
{
|
||||||
|
/// <summary>
|
||||||
|
/// Class to hold information about a professorship chair.
|
||||||
|
/// </summary>
|
||||||
|
public class ChairModel : BaseModel
|
||||||
|
{
|
||||||
|
private string name_de; // german name of the chair
|
||||||
|
private string url; // link-url to the chair homepage
|
||||||
|
private string name_en; // english name of the chair
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Default Constructor. Set every class variable to default value.
|
||||||
|
/// </summary>
|
||||||
|
public ChairModel()
|
||||||
|
{
|
||||||
|
this.name_de = String.Empty;
|
||||||
|
this.name_en = String.Empty;
|
||||||
|
this.url = String.Empty;
|
||||||
|
}
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Constructor. Set the german and english name.
|
||||||
|
/// </summary>
|
||||||
|
/// <param name="name">Name of the professorship chair.</param>
|
||||||
|
public ChairModel(string name)
|
||||||
|
{
|
||||||
|
this.name_de = name;
|
||||||
|
this.name_en = name;
|
||||||
|
this.url = String.Empty;
|
||||||
|
}
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Set or return the german name of the chair.
|
||||||
|
/// </summary>
|
||||||
|
[XmlAttribute("name_de")]
|
||||||
|
public string Name_DE
|
||||||
|
{
|
||||||
|
get { return this.name_de; }
|
||||||
|
set
|
||||||
|
{
|
||||||
|
if (value != this.name_de)
|
||||||
|
{
|
||||||
|
this.name_de = value;
|
||||||
|
NotifyPropertyChanged("chair");
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Set or return the english name of the chair.
|
||||||
|
/// </summary>
|
||||||
|
[XmlAttribute("name_en")]
|
||||||
|
public string Name_EN
|
||||||
|
{
|
||||||
|
get { return this.name_en; }
|
||||||
|
set
|
||||||
|
{
|
||||||
|
if (value != this.name_en)
|
||||||
|
{
|
||||||
|
this.name_en = value;
|
||||||
|
NotifyPropertyChanged("chair");
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Set or return the url of the chair homepage.
|
||||||
|
/// </summary>
|
||||||
|
[XmlAttribute("url")]
|
||||||
|
public string Url
|
||||||
|
{
|
||||||
|
get { return this.url; }
|
||||||
|
set
|
||||||
|
{
|
||||||
|
if (value != this.url)
|
||||||
|
{
|
||||||
|
this.url = value;
|
||||||
|
NotifyPropertyChanged("chair");
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -3,26 +3,32 @@ using System.Collections.Generic;
|
|||||||
using System.Collections.ObjectModel;
|
using System.Collections.ObjectModel;
|
||||||
using System.Linq;
|
using System.Linq;
|
||||||
using System.Text;
|
using System.Text;
|
||||||
|
using System.Windows;
|
||||||
|
using System.Xml.Serialization;
|
||||||
|
|
||||||
namespace CampusAppWP8.Model.departments
|
namespace CampusAppWP8.Model.Departments
|
||||||
{
|
{
|
||||||
public class DepartmentModel : BaseModel
|
public class DepartmentModel : BaseModel
|
||||||
{
|
{
|
||||||
private ObservableCollection<ChairModel> _chairs = null;
|
[XmlElement("chair")]
|
||||||
private string _name;
|
public ObservableCollection<ChairModel> _chairs { get; set; }
|
||||||
|
|
||||||
|
private string _name = "d_mod";
|
||||||
|
private Visibility visible;
|
||||||
|
|
||||||
public DepartmentModel()
|
public DepartmentModel()
|
||||||
{
|
{
|
||||||
|
this.visible = Visibility.Collapsed;
|
||||||
this.Chairs = new ObservableCollection<ChairModel>();
|
this.Chairs = new ObservableCollection<ChairModel>();
|
||||||
this.LoadData();
|
//this.LoadData();
|
||||||
}
|
}
|
||||||
|
|
||||||
public DepartmentModel(string name)
|
public DepartmentModel(string name)
|
||||||
{
|
{
|
||||||
|
this.visible = Visibility.Collapsed;
|
||||||
_name = name;
|
_name = name;
|
||||||
this.Chairs = new ObservableCollection<ChairModel>();
|
this.Chairs = new ObservableCollection<ChairModel>();
|
||||||
this.LoadData();
|
//this.LoadData();
|
||||||
}
|
}
|
||||||
|
|
||||||
public void LoadData()
|
public void LoadData()
|
||||||
@@ -64,5 +70,17 @@ namespace CampusAppWP8.Model.departments
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public Visibility Visible
|
||||||
|
{
|
||||||
|
get { return this.visible; }
|
||||||
|
set
|
||||||
|
{
|
||||||
|
if (value != this.visible)
|
||||||
|
{
|
||||||
|
this.visible = value;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -4,26 +4,20 @@ using System.Collections.ObjectModel;
|
|||||||
using System.Linq;
|
using System.Linq;
|
||||||
using System.Text;
|
using System.Text;
|
||||||
using System.Threading.Tasks;
|
using System.Threading.Tasks;
|
||||||
|
using System.Xml.Serialization;
|
||||||
|
|
||||||
namespace CampusAppWP8.Model.departments
|
namespace CampusAppWP8.Model.Departments
|
||||||
{
|
{
|
||||||
|
[XmlRoot("root")]
|
||||||
public class DepartmentViewModel : BaseViewModel
|
public class DepartmentViewModel : BaseViewModel
|
||||||
{
|
{
|
||||||
private ObservableCollection<FacultyModel> _faculties = null;
|
[XmlArray("professorships")]
|
||||||
|
[XmlArrayItem("faculty")]
|
||||||
|
public ObservableCollection<FacultyModel> _faculties { get; set; }
|
||||||
|
|
||||||
public DepartmentViewModel()
|
public DepartmentViewModel()
|
||||||
{
|
{
|
||||||
this.Faculties = new ObservableCollection<FacultyModel>();
|
this.Faculties = new ObservableCollection<FacultyModel>();
|
||||||
this.LoadData();
|
|
||||||
}
|
|
||||||
|
|
||||||
public void LoadData()
|
|
||||||
{
|
|
||||||
this.Faculties.Add(new FacultyModel("Fakultät 1"));
|
|
||||||
this.Faculties.Add(new FacultyModel("Fakultät 2"));
|
|
||||||
this.Faculties.Add(new FacultyModel("Fakultät 3"));
|
|
||||||
this.Faculties.Add(new FacultyModel("Fakultät 4"));
|
|
||||||
this.Faculties.Add(new FacultyModel("Favoriten"));
|
|
||||||
}
|
}
|
||||||
|
|
||||||
public ObservableCollection<FacultyModel> Faculties
|
public ObservableCollection<FacultyModel> Faculties
|
||||||
62
CampusAppWP8/CampusAppWP8/Model/Departments/FacultyModel.cs
Normal file
@@ -0,0 +1,62 @@
|
|||||||
|
using System;
|
||||||
|
using System.Collections.Generic;
|
||||||
|
using System.Collections.ObjectModel;
|
||||||
|
using System.Linq;
|
||||||
|
using System.Text;
|
||||||
|
using System.Xml.Serialization;
|
||||||
|
using CampusAppWP8.Resources;
|
||||||
|
|
||||||
|
namespace CampusAppWP8.Model.Departments
|
||||||
|
{
|
||||||
|
public class FacultyModel : BaseModel
|
||||||
|
{
|
||||||
|
[XmlElement("chair")]
|
||||||
|
public ObservableCollection<ChairModel> chairs { get; set; }
|
||||||
|
//public ObservableCollection<DepartmentModel> _faculties { get; set; }
|
||||||
|
|
||||||
|
private string name = "t_fak";
|
||||||
|
|
||||||
|
public FacultyModel()
|
||||||
|
{
|
||||||
|
//this.Faculties = new ObservableCollection<DepartmentModel>();
|
||||||
|
this.chairs = new ObservableCollection<ChairModel>();
|
||||||
|
}
|
||||||
|
|
||||||
|
public FacultyModel(string name)
|
||||||
|
{
|
||||||
|
this.name = name;
|
||||||
|
//this.Faculties = new ObservableCollection<DepartmentModel>();
|
||||||
|
this.chairs = new ObservableCollection<ChairModel>();
|
||||||
|
}
|
||||||
|
|
||||||
|
public ObservableCollection<ChairModel> Chairs
|
||||||
|
{
|
||||||
|
get { return this.chairs; }
|
||||||
|
set
|
||||||
|
{
|
||||||
|
if (value != this.chairs)
|
||||||
|
{
|
||||||
|
this.chairs = value;
|
||||||
|
NotifyPropertyChanged("faculty");
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
[XmlAttribute("id")]
|
||||||
|
public string Name
|
||||||
|
{
|
||||||
|
get
|
||||||
|
{
|
||||||
|
return AppResources.Faculty + " " + this.name;
|
||||||
|
}
|
||||||
|
set
|
||||||
|
{
|
||||||
|
if (value != this.name)
|
||||||
|
{
|
||||||
|
this.name = value;
|
||||||
|
NotifyPropertyChanged("faculty");
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
45
CampusAppWP8/CampusAppWP8/Model/Events/RSSChannelModel.cs
Normal file
@@ -0,0 +1,45 @@
|
|||||||
|
using CampusAppWP8.Model;
|
||||||
|
using System.Collections.ObjectModel;
|
||||||
|
using System.Xml.Serialization;
|
||||||
|
|
||||||
|
namespace CampusAppWP8.Model.events_news
|
||||||
|
{
|
||||||
|
/// <summary>
|
||||||
|
/// Channel Model, which contains the rss feed item list.
|
||||||
|
/// </summary>
|
||||||
|
public class RSSChannelModel : BaseModel
|
||||||
|
{
|
||||||
|
/// <summary>
|
||||||
|
/// RssFeed information item list.
|
||||||
|
/// </summary>
|
||||||
|
[XmlElement("item")]
|
||||||
|
public ObservableCollection<RSSModel> item { get; set; }
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Default constructor.
|
||||||
|
/// </summary>
|
||||||
|
public RSSChannelModel()
|
||||||
|
{
|
||||||
|
this.item = new ObservableCollection<RSSModel>();
|
||||||
|
}
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Set/Get the rss feed item list.
|
||||||
|
/// </summary>
|
||||||
|
public ObservableCollection<RSSModel> Item
|
||||||
|
{
|
||||||
|
get
|
||||||
|
{
|
||||||
|
return this.item;
|
||||||
|
}
|
||||||
|
set
|
||||||
|
{
|
||||||
|
if (value != this.item)
|
||||||
|
{
|
||||||
|
this.item = value;
|
||||||
|
NotifyPropertyChanged("item");
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
204
CampusAppWP8/CampusAppWP8/Model/Events/RSSModel.cs
Normal file
@@ -0,0 +1,204 @@
|
|||||||
|
using CampusAppWP8.Model;
|
||||||
|
using System;
|
||||||
|
using System.Collections.Generic;
|
||||||
|
using System.Linq;
|
||||||
|
using System.Text;
|
||||||
|
using System.Threading.Tasks;
|
||||||
|
using System.Xml.Serialization;
|
||||||
|
|
||||||
|
namespace CampusAppWP8.Model.events_news
|
||||||
|
{
|
||||||
|
/// <summary>
|
||||||
|
/// Contains the rss feed informations.
|
||||||
|
/// </summary>
|
||||||
|
public class RSSModel : BaseModel
|
||||||
|
{
|
||||||
|
/// <summary>
|
||||||
|
/// Title of the fees
|
||||||
|
/// </summary>
|
||||||
|
private string title;
|
||||||
|
/// <summary>
|
||||||
|
/// Description text of the feed.
|
||||||
|
/// </summary>
|
||||||
|
private string text;
|
||||||
|
/// <summary>
|
||||||
|
/// Timestamp (publication date) of the event or news.
|
||||||
|
/// </summary>
|
||||||
|
private DateTime timestamp;
|
||||||
|
/// <summary>
|
||||||
|
/// Url of the feed.
|
||||||
|
/// </summary>
|
||||||
|
private string link;
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Set/Get the title of the feed.
|
||||||
|
/// </summary>
|
||||||
|
[XmlElement("title")]
|
||||||
|
public string Title
|
||||||
|
{
|
||||||
|
get { return this.title; }
|
||||||
|
set
|
||||||
|
{
|
||||||
|
if (this.title != value)
|
||||||
|
{
|
||||||
|
this.title = value;
|
||||||
|
NotifyPropertyChanged("rss");
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Set/Get the text of the feed.
|
||||||
|
/// </summary>
|
||||||
|
[XmlElement("description")]
|
||||||
|
public string Text
|
||||||
|
{
|
||||||
|
get { return this.text; }
|
||||||
|
set
|
||||||
|
{
|
||||||
|
if (this.text != HTMLUnicodeToString(value))
|
||||||
|
{
|
||||||
|
this.text = HTMLUnicodeToString(value);
|
||||||
|
NotifyPropertyChanged("rss");
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Set/Get the timestamp of the feed as string.
|
||||||
|
/// </summary>
|
||||||
|
[XmlElement("pubDate")]
|
||||||
|
public string Timestamp
|
||||||
|
{
|
||||||
|
get { return this.timestamp.ToString("R"); }
|
||||||
|
set
|
||||||
|
{
|
||||||
|
if (this.timestamp != DateTime.Parse(value))
|
||||||
|
{
|
||||||
|
this.timestamp = DateTime.Parse(value);
|
||||||
|
NotifyPropertyChanged("rss");
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Set/Get the timestamp of the feed as DateTime object.
|
||||||
|
/// </summary>
|
||||||
|
public DateTime DTTimestamp
|
||||||
|
{
|
||||||
|
get { return this.timestamp; }
|
||||||
|
set { this.timestamp = value; }
|
||||||
|
}
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Return the date of the timestamp as string.
|
||||||
|
/// example: Mon, 25.06.2013.
|
||||||
|
/// </summary>
|
||||||
|
public string Date
|
||||||
|
{
|
||||||
|
get { return String.Format("{0:ddd, dd.MM.yyyy}", this.timestamp); }
|
||||||
|
}
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Return the time of the timestamp as string.
|
||||||
|
/// example: 12:56 Uhr.
|
||||||
|
/// </summary>
|
||||||
|
public string Time
|
||||||
|
{
|
||||||
|
get { return String.Format("{0:h:mm} Uhr", this.timestamp); }
|
||||||
|
}
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Set/Get the link/url of the feed.
|
||||||
|
/// </summary>
|
||||||
|
[XmlElement("link")]
|
||||||
|
public string Link
|
||||||
|
{
|
||||||
|
get { return this.link; }
|
||||||
|
set
|
||||||
|
{
|
||||||
|
if (this.link != value)
|
||||||
|
{
|
||||||
|
this.link = value;
|
||||||
|
NotifyPropertyChanged("rss");
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Remove or transform html-unicode specific tags into ascii.
|
||||||
|
/// </summary>
|
||||||
|
/// <param name="htmluni">html string</param>
|
||||||
|
/// <returns>ascii string</returns>
|
||||||
|
private string HTMLUnicodeToString(string htmluni)
|
||||||
|
{
|
||||||
|
StringBuilder retValue = new StringBuilder();
|
||||||
|
|
||||||
|
for(int i = 0; i < htmluni.Length; i++)
|
||||||
|
{
|
||||||
|
switch (htmluni[i])
|
||||||
|
{
|
||||||
|
// beginning tag of the unicode
|
||||||
|
case '&':
|
||||||
|
{
|
||||||
|
int startOff = i + 2;
|
||||||
|
// sear closing tag of the unicode
|
||||||
|
int endOff = htmluni.IndexOf(';', startOff);
|
||||||
|
// get and parse value inbetween
|
||||||
|
string sub = htmluni.Substring(startOff, endOff - startOff);
|
||||||
|
int cVal = int.Parse(sub);
|
||||||
|
|
||||||
|
switch (cVal)
|
||||||
|
{
|
||||||
|
// if the unicode value is 128 (€)
|
||||||
|
case 128:
|
||||||
|
retValue.Append('€');
|
||||||
|
break;
|
||||||
|
|
||||||
|
default:
|
||||||
|
retValue.Append((char)cVal);
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
|
||||||
|
// set the current index to the end of the unicode tag
|
||||||
|
i = endOff;
|
||||||
|
}
|
||||||
|
break;
|
||||||
|
case '<':
|
||||||
|
{
|
||||||
|
// ignoring <..> html tags
|
||||||
|
i = htmluni.IndexOf('>', i);
|
||||||
|
}
|
||||||
|
break;
|
||||||
|
case '\t':
|
||||||
|
// removing tabs
|
||||||
|
break;
|
||||||
|
|
||||||
|
default:
|
||||||
|
{
|
||||||
|
// adding other characters to the return string
|
||||||
|
retValue.Append(htmluni[i]);
|
||||||
|
}
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
return retValue.ToString();
|
||||||
|
}
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Comparing function for Datetime-Timestamps.
|
||||||
|
/// (currently unused)
|
||||||
|
/// </summary>
|
||||||
|
/// <param name="item1">first item</param>
|
||||||
|
/// <param name="item2">secound item</param>
|
||||||
|
/// <returns></returns>
|
||||||
|
public static int CompareTimeStamp(RSSModel item1, RSSModel item2)
|
||||||
|
{
|
||||||
|
if (item1.DTTimestamp > item2.DTTimestamp)
|
||||||
|
return -1;
|
||||||
|
else
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
47
CampusAppWP8/CampusAppWP8/Model/Events/RSSViewModel.cs
Normal file
@@ -0,0 +1,47 @@
|
|||||||
|
using CampusAppWP8.Model;
|
||||||
|
using System.Collections.ObjectModel;
|
||||||
|
using System.Xml.Serialization;
|
||||||
|
|
||||||
|
namespace CampusAppWP8.Model.events_news
|
||||||
|
{
|
||||||
|
/// <summary>
|
||||||
|
/// ViewModel of the rss feed, containing the feed/channel object.
|
||||||
|
/// </summary>
|
||||||
|
[XmlRoot("root")]
|
||||||
|
public class RSSViewModel : BaseViewModel
|
||||||
|
{
|
||||||
|
/// <summary>
|
||||||
|
/// channel list for the rss feeds.
|
||||||
|
/// </summary>
|
||||||
|
[XmlArray("rss")]
|
||||||
|
[XmlArrayItem("channel")]
|
||||||
|
public ObservableCollection<RSSChannelModel> channel { get; set; }
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Default constructor.
|
||||||
|
/// </summary>
|
||||||
|
public RSSViewModel()
|
||||||
|
{
|
||||||
|
this.channel = new ObservableCollection<RSSChannelModel>();
|
||||||
|
}
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Set/Get the channel list.
|
||||||
|
/// </summary>
|
||||||
|
public ObservableCollection<RSSChannelModel> Channel
|
||||||
|
{
|
||||||
|
get
|
||||||
|
{
|
||||||
|
return this.channel;
|
||||||
|
}
|
||||||
|
set
|
||||||
|
{
|
||||||
|
if (value != this.channel)
|
||||||
|
{
|
||||||
|
this.channel = value;
|
||||||
|
NotifyPropertyChanged("channel");
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
140
CampusAppWP8/CampusAppWP8/Model/Lecture/LectureActivity.cs
Normal file
@@ -0,0 +1,140 @@
|
|||||||
|
using CampusAppWP8.Utility;
|
||||||
|
using System;
|
||||||
|
using System.Collections.Generic;
|
||||||
|
using System.Collections.ObjectModel;
|
||||||
|
using System.Linq;
|
||||||
|
using System.Text;
|
||||||
|
using System.Threading.Tasks;
|
||||||
|
using System.Xml.Serialization;
|
||||||
|
|
||||||
|
namespace CampusAppWP8.Model.Lecture
|
||||||
|
{
|
||||||
|
public class LectureActivity
|
||||||
|
{
|
||||||
|
#region
|
||||||
|
private ObservableCollection<LectureLecturer> lecturer;
|
||||||
|
private string lecturerString;
|
||||||
|
private string courseString;
|
||||||
|
private string topic;
|
||||||
|
#endregion
|
||||||
|
#region Constructor
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Initializes a new instance of the <see cref="LectureList" /> class.
|
||||||
|
/// </summary>
|
||||||
|
public LectureActivity()
|
||||||
|
{
|
||||||
|
}
|
||||||
|
|
||||||
|
#endregion
|
||||||
|
|
||||||
|
#region Proberty
|
||||||
|
|
||||||
|
[XmlElement("art")]
|
||||||
|
public string Type { get; set; }
|
||||||
|
|
||||||
|
[XmlAttribute("id")]
|
||||||
|
public int Id { get; set; }
|
||||||
|
|
||||||
|
[XmlElement("semester")]
|
||||||
|
public int Semester { get; set; }
|
||||||
|
|
||||||
|
[XmlElement("sws")]
|
||||||
|
public string SWS { get; set; }
|
||||||
|
|
||||||
|
[XmlElement("modul")]
|
||||||
|
public LectureModul Modul { get; set; }
|
||||||
|
|
||||||
|
[XmlElement("lehrperson")]
|
||||||
|
public ObservableCollection<LectureLecturer> Lecturer {
|
||||||
|
get
|
||||||
|
{
|
||||||
|
return lecturer;
|
||||||
|
}
|
||||||
|
set
|
||||||
|
{
|
||||||
|
if (value != lecturer)
|
||||||
|
{
|
||||||
|
lecturer = value;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
public string LecturerString {
|
||||||
|
get
|
||||||
|
{
|
||||||
|
return this.lecturerString;
|
||||||
|
}
|
||||||
|
set
|
||||||
|
{
|
||||||
|
if (value != this.lecturerString)
|
||||||
|
{
|
||||||
|
this.lecturerString = value;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
public string CourseString
|
||||||
|
{
|
||||||
|
get
|
||||||
|
{
|
||||||
|
return this.courseString;
|
||||||
|
}
|
||||||
|
set
|
||||||
|
{
|
||||||
|
if (value != this.courseString)
|
||||||
|
{
|
||||||
|
this.courseString = value;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
[XmlElement("studiengang")]
|
||||||
|
public ObservableCollection<LectureCourse> Course { get; set; }
|
||||||
|
|
||||||
|
[XmlElement("termin")]
|
||||||
|
public ObservableCollection<LectureDate> Dates { get; set; }
|
||||||
|
|
||||||
|
[XmlElement("zugeordnete_einrichtung")]
|
||||||
|
public string Department { get; set; }
|
||||||
|
|
||||||
|
[XmlElement("lehrinhalt")]
|
||||||
|
public string Topic
|
||||||
|
{
|
||||||
|
get
|
||||||
|
{
|
||||||
|
return topic;
|
||||||
|
}
|
||||||
|
set
|
||||||
|
{
|
||||||
|
if (value != topic)
|
||||||
|
{
|
||||||
|
topic = StringManager.StripHTML(value);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
#endregion
|
||||||
|
|
||||||
|
public void createLectureString()
|
||||||
|
{
|
||||||
|
string result = string.Empty;
|
||||||
|
foreach (LectureLecturer tmpLecturer in Lecturer)
|
||||||
|
{
|
||||||
|
result += tmpLecturer.ToString() + "\n";
|
||||||
|
}
|
||||||
|
this.LecturerString = result.TrimEnd('\n');
|
||||||
|
}
|
||||||
|
|
||||||
|
public void createCourseString()
|
||||||
|
{
|
||||||
|
string result = string.Empty;
|
||||||
|
foreach (LectureCourse course in Course)
|
||||||
|
{
|
||||||
|
result += course.Title + "\n";
|
||||||
|
}
|
||||||
|
this.CourseString = result.TrimEnd('\n');
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
17
CampusAppWP8/CampusAppWP8/Model/Lecture/LectureCourse.cs
Normal file
@@ -0,0 +1,17 @@
|
|||||||
|
using System;
|
||||||
|
using System.Collections.Generic;
|
||||||
|
using System.Linq;
|
||||||
|
using System.Text;
|
||||||
|
using System.Xml.Serialization;
|
||||||
|
|
||||||
|
namespace CampusAppWP8.Model.Lecture
|
||||||
|
{
|
||||||
|
public class LectureCourse
|
||||||
|
{
|
||||||
|
public LectureCourse()
|
||||||
|
{
|
||||||
|
}
|
||||||
|
[XmlElement("bezeichnung")]
|
||||||
|
public string Title {get;set;}
|
||||||
|
}
|
||||||
|
}
|
||||||
31
CampusAppWP8/CampusAppWP8/Model/Lecture/LectureDate.cs
Normal file
@@ -0,0 +1,31 @@
|
|||||||
|
using System;
|
||||||
|
using System.Collections.Generic;
|
||||||
|
using System.Linq;
|
||||||
|
using System.Text;
|
||||||
|
using System.Xml.Serialization;
|
||||||
|
|
||||||
|
namespace CampusAppWP8.Model.Lecture
|
||||||
|
{
|
||||||
|
public class LectureDate
|
||||||
|
{
|
||||||
|
public LectureDate()
|
||||||
|
{
|
||||||
|
}
|
||||||
|
|
||||||
|
[XmlElement("wochentag")]
|
||||||
|
public string WeekDay { get; set; }
|
||||||
|
[XmlElement("von")]
|
||||||
|
public string From { get; set; }
|
||||||
|
[XmlElement("bis")]
|
||||||
|
public string To { get; set; }
|
||||||
|
[XmlElement("rhythmus")]
|
||||||
|
public string Interval { get; set; }
|
||||||
|
[XmlElement("raum")]
|
||||||
|
public string Room { get; set; }
|
||||||
|
[XmlElement("anfangsdatum")]
|
||||||
|
public string StarDate { get; set; }
|
||||||
|
[XmlElement("enddatum")]
|
||||||
|
public string EndDate { get; set; }
|
||||||
|
|
||||||
|
}
|
||||||
|
}
|
||||||
46
CampusAppWP8/CampusAppWP8/Model/Lecture/LectureLecturer.cs
Normal file
@@ -0,0 +1,46 @@
|
|||||||
|
using System;
|
||||||
|
using System.Collections.Generic;
|
||||||
|
using System.Linq;
|
||||||
|
using System.Text;
|
||||||
|
using System.Xml.Serialization;
|
||||||
|
|
||||||
|
namespace CampusAppWP8.Model.Lecture
|
||||||
|
{
|
||||||
|
public class LectureLecturer
|
||||||
|
{
|
||||||
|
public LectureLecturer()
|
||||||
|
{
|
||||||
|
}
|
||||||
|
|
||||||
|
[XmlElement("vorname")]
|
||||||
|
public string FirstName { get; set; }
|
||||||
|
|
||||||
|
[XmlElement("name")]
|
||||||
|
public string LastName { get; set; }
|
||||||
|
|
||||||
|
[XmlElement("titel")]
|
||||||
|
public string Title { get; set; }
|
||||||
|
|
||||||
|
[XmlAttribute("zustaendigkeit")]
|
||||||
|
public string Responsibility { get; set; }
|
||||||
|
|
||||||
|
public override string ToString()
|
||||||
|
{
|
||||||
|
string result = string.Empty;
|
||||||
|
|
||||||
|
if (!Title.Equals(string.Empty))
|
||||||
|
{
|
||||||
|
result += Title + " ";
|
||||||
|
}
|
||||||
|
|
||||||
|
result += FirstName + " ";
|
||||||
|
result += LastName + " ";
|
||||||
|
|
||||||
|
if (!Responsibility.Equals(string.Empty))
|
||||||
|
{
|
||||||
|
result += "(" + Responsibility + ") ";
|
||||||
|
}
|
||||||
|
return result;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
48
CampusAppWP8/CampusAppWP8/Model/Lecture/LectureList.cs
Normal file
@@ -0,0 +1,48 @@
|
|||||||
|
//-----------------------------------------------------------------------
|
||||||
|
// <copyright file="LectureList.cs" company="BTU/IIT">
|
||||||
|
// Company copyright tag.
|
||||||
|
// </copyright>
|
||||||
|
// <author>stubbfel</author>
|
||||||
|
// <sience>10.06.2013</sience>
|
||||||
|
//----------------------------------------------------------------------
|
||||||
|
namespace CampusAppWP8.Model.Lecture
|
||||||
|
{
|
||||||
|
using System.Collections.Generic;
|
||||||
|
using System.Collections.ObjectModel;
|
||||||
|
using System.Xml.Serialization;
|
||||||
|
using System.Linq;
|
||||||
|
|
||||||
|
[XmlRoot("lsf_auszug")]
|
||||||
|
public class LectureList
|
||||||
|
{
|
||||||
|
|
||||||
|
#region Constructor
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Initializes a new instance of the <see cref="LectureList" /> class.
|
||||||
|
/// </summary>
|
||||||
|
public LectureList()
|
||||||
|
{
|
||||||
|
}
|
||||||
|
|
||||||
|
#endregion
|
||||||
|
|
||||||
|
#region Proberty
|
||||||
|
|
||||||
|
[XmlArray("veranstaltungsliste")]
|
||||||
|
[XmlArrayItem("veranstaltung")]
|
||||||
|
public ObservableCollection<LectureActivity> Activities { get; set; }
|
||||||
|
|
||||||
|
#endregion
|
||||||
|
|
||||||
|
#region Methods
|
||||||
|
|
||||||
|
public LectureActivity GetActivity(int id)
|
||||||
|
{
|
||||||
|
LectureActivity activity = Activities.Where(p => p.Id == id).First();
|
||||||
|
return activity;
|
||||||
|
}
|
||||||
|
#endregion
|
||||||
|
|
||||||
|
}
|
||||||
|
}
|
||||||
70
CampusAppWP8/CampusAppWP8/Model/Lecture/LectureModul.cs
Normal file
@@ -0,0 +1,70 @@
|
|||||||
|
//-----------------------------------------------------------------------
|
||||||
|
// <copyright file="LectureModul.cs" company="BTU/IIT">
|
||||||
|
// Company copyright tag.
|
||||||
|
// </copyright>
|
||||||
|
// <author>stubbfel</author>
|
||||||
|
// <sience>10.06.2013</sience>
|
||||||
|
//----------------------------------------------------------------------
|
||||||
|
namespace CampusAppWP8.Model.Lecture
|
||||||
|
{
|
||||||
|
using CampusAppWP8.Resources;
|
||||||
|
using System;
|
||||||
|
using System.Xml.Serialization;
|
||||||
|
public class LectureModul
|
||||||
|
{
|
||||||
|
#region Members
|
||||||
|
|
||||||
|
private int number;
|
||||||
|
|
||||||
|
private Uri url;
|
||||||
|
|
||||||
|
#endregion
|
||||||
|
|
||||||
|
#region Constructor
|
||||||
|
|
||||||
|
public LectureModul()
|
||||||
|
{
|
||||||
|
}
|
||||||
|
|
||||||
|
#endregion
|
||||||
|
|
||||||
|
#region Property
|
||||||
|
|
||||||
|
[XmlElement("titel")]
|
||||||
|
public string Title {get; set;}
|
||||||
|
|
||||||
|
[XmlElement("nummer")]
|
||||||
|
public int Number{
|
||||||
|
get
|
||||||
|
{
|
||||||
|
return this.number;
|
||||||
|
}
|
||||||
|
set
|
||||||
|
{
|
||||||
|
if (value != this.number)
|
||||||
|
{
|
||||||
|
this.number = value;
|
||||||
|
this.createUrl();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
public Uri Url{
|
||||||
|
get
|
||||||
|
{
|
||||||
|
return url;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
#endregion
|
||||||
|
|
||||||
|
#region Methods
|
||||||
|
|
||||||
|
private void createUrl()
|
||||||
|
{
|
||||||
|
this.url = new Uri(Constants.UrlLectureModulBaseAddr + number.ToString());
|
||||||
|
}
|
||||||
|
|
||||||
|
#endregion
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -6,7 +6,7 @@
|
|||||||
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
|
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
|
||||||
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
|
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
|
||||||
xmlns:Location="clr-namespace:System.Device.Location;assembly=System.Device"
|
xmlns:Location="clr-namespace:System.Device.Location;assembly=System.Device"
|
||||||
x:Class="CampusAppWP8.Pages.campusmap.CampusMapPage"
|
x:Class="CampusAppWP8.Pages.Campusmap.CampusMapPage"
|
||||||
FontFamily="{StaticResource PhoneFontFamilyNormal}"
|
FontFamily="{StaticResource PhoneFontFamilyNormal}"
|
||||||
FontSize="{StaticResource PhoneFontSizeNormal}"
|
FontSize="{StaticResource PhoneFontSizeNormal}"
|
||||||
Foreground="{StaticResource PhoneForegroundBrush}"
|
Foreground="{StaticResource PhoneForegroundBrush}"
|
||||||
@@ -8,7 +8,7 @@ using System.Windows.Navigation;
|
|||||||
using Microsoft.Phone.Controls;
|
using Microsoft.Phone.Controls;
|
||||||
using Microsoft.Phone.Shell;
|
using Microsoft.Phone.Shell;
|
||||||
|
|
||||||
namespace CampusAppWP8.Pages.campusmap
|
namespace CampusAppWP8.Pages.Campusmap
|
||||||
{
|
{
|
||||||
public partial class CampusMapPage : PhoneApplicationPage
|
public partial class CampusMapPage : PhoneApplicationPage
|
||||||
{
|
{
|
||||||
@@ -1,12 +1,12 @@
|
|||||||
<phone:PhoneApplicationPage
|
<phone:PhoneApplicationPage
|
||||||
x:Class="CampusAppWP8.Pages.departments.DepartmentPage"
|
x:Class="CampusAppWP8.Pages.Departments.DepartmentPage"
|
||||||
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
|
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
|
||||||
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
|
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
|
||||||
xmlns:phone="clr-namespace:Microsoft.Phone.Controls;assembly=Microsoft.Phone"
|
xmlns:phone="clr-namespace:Microsoft.Phone.Controls;assembly=Microsoft.Phone"
|
||||||
xmlns:shell="clr-namespace:Microsoft.Phone.Shell;assembly=Microsoft.Phone"
|
xmlns:shell="clr-namespace:Microsoft.Phone.Shell;assembly=Microsoft.Phone"
|
||||||
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
|
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
|
||||||
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
|
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
|
||||||
xmlns:viewModel="clr-namespace:CampusAppWP8.Model.departments"
|
xmlns:viewModel="clr-namespace:CampusAppWP8.Model.Departments"
|
||||||
mc:Ignorable="d"
|
mc:Ignorable="d"
|
||||||
FontFamily="{StaticResource PhoneFontFamilyNormal}"
|
FontFamily="{StaticResource PhoneFontFamilyNormal}"
|
||||||
FontSize="{StaticResource PhoneFontSizeNormal}"
|
FontSize="{StaticResource PhoneFontSizeNormal}"
|
||||||
@@ -16,40 +16,44 @@
|
|||||||
shell:SystemTray.IsVisible="True">
|
shell:SystemTray.IsVisible="True">
|
||||||
|
|
||||||
<phone:PhoneApplicationPage.Resources>
|
<phone:PhoneApplicationPage.Resources>
|
||||||
<viewModel:DepartmentViewModel x:Key="DepartmentViewModel" />
|
<viewModel:DepartmentViewModel x:Key="DepartmentViewModel" x:Name="DepartmentView" />
|
||||||
</phone:PhoneApplicationPage.Resources>
|
</phone:PhoneApplicationPage.Resources>
|
||||||
<!--LayoutRoot ist das Stammraster, in dem alle anderen Seiteninhalte platziert werden-->
|
<!-- LayoutRoot -->
|
||||||
<Grid x:Name="LayoutRoot" Background="Transparent">
|
<Grid x:Name="LayoutRoot" Background="Transparent">
|
||||||
<Grid.DataContext>
|
<Grid.DataContext>
|
||||||
<viewModel:DepartmentViewModel/>
|
<viewModel:DepartmentViewModel />
|
||||||
</Grid.DataContext>
|
</Grid.DataContext>
|
||||||
<!--Pivotsteuerelement-->
|
<!-- Pivot -->
|
||||||
<phone:Pivot Title="{Binding Path=LocalizedResources.DepartmentApp_Title, Source={StaticResource LocalizedStrings}}" ItemsSource="{Binding Faculties}">
|
<phone:Pivot x:Name="DepartmentPivot" Title="{Binding Path=LocalizedResources.DepartmentApp_Title, Source={StaticResource LocalizedStrings}}" ItemsSource="{Binding Faculties}">
|
||||||
|
<!-- Pivotitem template -->
|
||||||
<phone:Pivot.HeaderTemplate>
|
<phone:Pivot.HeaderTemplate>
|
||||||
<DataTemplate>
|
<DataTemplate>
|
||||||
<TextBlock Text="{Binding Name}" />
|
<TextBlock Text="{Binding Path=Name, Mode=OneWay}" />
|
||||||
</DataTemplate>
|
</DataTemplate>
|
||||||
</phone:Pivot.HeaderTemplate>
|
</phone:Pivot.HeaderTemplate>
|
||||||
<phone:Pivot.ItemTemplate>
|
<phone:Pivot.ItemTemplate>
|
||||||
<DataTemplate>
|
<DataTemplate>
|
||||||
<ScrollViewer>
|
<!-- TEMPORARILY REMOVED, will be abck in soon
|
||||||
<phone:LongListSelector ItemsSource="{Binding Faculties}">
|
<phone:LongListSelector ItemsSource="{Binding Faculties}">
|
||||||
<phone:LongListSelector.ItemTemplate>
|
<phone:LongListSelector.ItemTemplate>
|
||||||
<DataTemplate>
|
<DataTemplate>
|
||||||
<StackPanel>
|
<StackPanel>
|
||||||
<TextBlock Text="{Binding Name}" Style="{StaticResource PhoneTextTitle2Style}" />
|
<Button x:Name="DepartmentBtn" Content="{Binding Name}" Background="Gray" BorderBrush="Gray" Foreground="Black" Click="DepartmentBtn_Click"/>
|
||||||
<phone:LongListSelector ItemsSource="{Binding Chairs}">
|
<phone:LongListSelector Tag="{Binding Name}" Visibility="{Binding Visible}" ItemsSource="{Binding Chairs}">
|
||||||
<phone:LongListSelector.ItemTemplate>
|
-->
|
||||||
<DataTemplate>
|
<ListBox ItemsSource="{Binding Chairs}">
|
||||||
<TextBlock Text="{Binding Name}" />
|
<ListBox.ItemTemplate>
|
||||||
</DataTemplate>
|
<DataTemplate>
|
||||||
</phone:LongListSelector.ItemTemplate>
|
<TextBlock x:Name="ChairTB" Tag="{Binding Url}" Text="{Binding Name_DE}" MouseLeftButtonDown="ChairTB_Click" Margin="12,6,12,6" Padding="0,0,0,0" HorizontalAlignment="Stretch" TextWrapping="Wrap" FontSize="24"/>
|
||||||
</phone:LongListSelector>
|
</DataTemplate>
|
||||||
|
</ListBox.ItemTemplate>
|
||||||
|
</ListBox>
|
||||||
|
<!--
|
||||||
</StackPanel>
|
</StackPanel>
|
||||||
</DataTemplate>
|
</DataTemplate>
|
||||||
</phone:LongListSelector.ItemTemplate>
|
</phone:LongListSelector.ItemTemplate>
|
||||||
</phone:LongListSelector>
|
</phone:LongListSelector>
|
||||||
</ScrollViewer>
|
-->
|
||||||
</DataTemplate>
|
</DataTemplate>
|
||||||
</phone:Pivot.ItemTemplate>
|
</phone:Pivot.ItemTemplate>
|
||||||
</phone:Pivot>
|
</phone:Pivot>
|
||||||
@@ -0,0 +1,131 @@
|
|||||||
|
using CampusAppWP8.Feed.Departments;
|
||||||
|
using CampusAppWP8.Pages.Departments;
|
||||||
|
using CampusAppWP8.Utility;
|
||||||
|
using Microsoft.Phone.Controls;
|
||||||
|
using Microsoft.Phone.Tasks;
|
||||||
|
using System;
|
||||||
|
using System.Linq;
|
||||||
|
using System.Windows;
|
||||||
|
using System.Windows.Controls;
|
||||||
|
using System.Windows.Navigation;
|
||||||
|
|
||||||
|
|
||||||
|
namespace CampusAppWP8.Pages.Departments
|
||||||
|
{
|
||||||
|
/// <summary>
|
||||||
|
/// Pivot page with list of the chairs of the facultis.
|
||||||
|
/// </summary>
|
||||||
|
public partial class DepartmentPage : PhoneApplicationPage
|
||||||
|
{
|
||||||
|
/// <summary>
|
||||||
|
/// Stores the last visible department panel.
|
||||||
|
/// </summary>
|
||||||
|
private UIElement lastVisibleUIElem = null;
|
||||||
|
/// <summary>
|
||||||
|
/// department/chair feed object, storing the model and data.
|
||||||
|
/// </summary>
|
||||||
|
private DepartmentFeed feed { get; set; }
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Default constructor.
|
||||||
|
/// </summary>
|
||||||
|
public DepartmentPage()
|
||||||
|
{
|
||||||
|
InitializeComponent();
|
||||||
|
// init feed object
|
||||||
|
this.feed = new DepartmentFeed();
|
||||||
|
}
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// On naviagtion to this page.
|
||||||
|
/// Init the feed loading.
|
||||||
|
/// </summary>
|
||||||
|
/// <param name="e">event args</param>
|
||||||
|
protected override void OnNavigatedTo(NavigationEventArgs e)
|
||||||
|
{
|
||||||
|
base.OnNavigatedTo(e);
|
||||||
|
|
||||||
|
this.feed.EventHandler.FeedIsReadyEvent += new FeedEventHandler.FeedReadyHandler(SetupDepartmentPivot);
|
||||||
|
this.feed.LoadFeed();
|
||||||
|
}
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Called after the feeds are loaded.
|
||||||
|
/// Set the pivotitem source of this page.
|
||||||
|
/// </summary>
|
||||||
|
private void SetupDepartmentPivot()
|
||||||
|
{
|
||||||
|
DepartmentPivot.ItemsSource = feed.Model._faculties;
|
||||||
|
}
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// On orientation changed.
|
||||||
|
/// </summary>
|
||||||
|
/// <param name="sender">unused</param>
|
||||||
|
/// <param name="e">unused</param>
|
||||||
|
private void PhoneApplicationPage_OrientationChanged(object sender, OrientationChangedEventArgs e)
|
||||||
|
{
|
||||||
|
}
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Called at clicking on the department headline buttons.
|
||||||
|
/// Collapses all visible department panels and open (set to visible)
|
||||||
|
/// the clicked department list.
|
||||||
|
/// </summary>
|
||||||
|
/// <param name="sender">clicked department button</param>
|
||||||
|
/// <param name="e">unused</param>
|
||||||
|
private void DepartmentBtn_Click(object sender, RoutedEventArgs e)
|
||||||
|
{
|
||||||
|
// if the sender was a button
|
||||||
|
if(sender is Button)
|
||||||
|
{
|
||||||
|
Button btn = sender as Button;
|
||||||
|
|
||||||
|
// if the parent is a stackpanel
|
||||||
|
if(btn.Parent is StackPanel)
|
||||||
|
{
|
||||||
|
StackPanel pan = (StackPanel)btn.Parent;
|
||||||
|
|
||||||
|
// if there is a child after the clicked button in the parent panel
|
||||||
|
if ((pan.Children.Count() > 1) && (pan.Children[1] != null))
|
||||||
|
{
|
||||||
|
// if the clicked department wasn't the one clicked before
|
||||||
|
if (pan.Children[1] != this.lastVisibleUIElem)
|
||||||
|
{
|
||||||
|
// collapse the last visible chair list
|
||||||
|
if (this.lastVisibleUIElem != null)
|
||||||
|
this.lastVisibleUIElem.Visibility = Visibility.Collapsed;
|
||||||
|
|
||||||
|
// open the choosen chair list
|
||||||
|
pan.Children[1].Visibility = Visibility.Visible;
|
||||||
|
this.lastVisibleUIElem = pan.Children[1];
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// On clicking a chair textbolock.
|
||||||
|
/// Open the browser with the url of the chair.
|
||||||
|
/// </summary>
|
||||||
|
/// <param name="sender">clicked chair textblock</param>
|
||||||
|
/// <param name="e"></param>
|
||||||
|
private void ChairTB_Click(object sender, RoutedEventArgs e)
|
||||||
|
{
|
||||||
|
if (sender is FrameworkElement)
|
||||||
|
{
|
||||||
|
FrameworkElement btn = sender as FrameworkElement;
|
||||||
|
|
||||||
|
// if the chair has a url in the tag element
|
||||||
|
if ((btn.Tag != null) && ((btn.Tag as string).Length > 0))
|
||||||
|
{
|
||||||
|
// open browser with the url
|
||||||
|
WebBrowserTask task = new WebBrowserTask();
|
||||||
|
task.Uri = new Uri(btn.Tag.ToString(), UriKind.Absolute);
|
||||||
|
task.Show();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
32
CampusAppWP8/CampusAppWP8/Pages/Events/EventIndexPage.xaml
Normal file
@@ -0,0 +1,32 @@
|
|||||||
|
<phone:PhoneApplicationPage
|
||||||
|
x:Class="CampusAppWP8.Pages.Events.EventIndexPage"
|
||||||
|
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"
|
||||||
|
FontFamily="{StaticResource PhoneFontFamilyNormal}"
|
||||||
|
FontSize="{StaticResource PhoneFontSizeNormal}"
|
||||||
|
Foreground="{StaticResource PhoneForegroundBrush}"
|
||||||
|
SupportedOrientations="Portrait" Orientation="Portrait"
|
||||||
|
mc:Ignorable="d"
|
||||||
|
shell:SystemTray.IsVisible="True">
|
||||||
|
|
||||||
|
<!--LayoutRoot -->
|
||||||
|
<Grid x:Name="LayoutRoot" Background="Transparent">
|
||||||
|
<Grid.RowDefinitions>
|
||||||
|
<RowDefinition Height="Auto"/>
|
||||||
|
<RowDefinition Height="*"/>
|
||||||
|
</Grid.RowDefinitions>
|
||||||
|
|
||||||
|
<!-- Title and headline -->
|
||||||
|
<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.EventApp_Title, Source={StaticResource LocalizedStrings}}" Margin="9,-7,0,0" Style="{StaticResource PhoneTextTitle1Style}"/>
|
||||||
|
</StackPanel>
|
||||||
|
<!-- Content -->
|
||||||
|
<ListBox x:Name="ButtonPanel" Grid.Row="1">
|
||||||
|
</ListBox>
|
||||||
|
</Grid>
|
||||||
|
</phone:PhoneApplicationPage>
|
||||||
104
CampusAppWP8/CampusAppWP8/Pages/Events/EventIndexPage.xaml.cs
Normal file
@@ -0,0 +1,104 @@
|
|||||||
|
using CampusAppWP8.Feed.Events;
|
||||||
|
using CampusAppWP8.Model.events_news;
|
||||||
|
using CampusAppWP8.Utility;
|
||||||
|
using Microsoft.Phone.Controls;
|
||||||
|
using System;
|
||||||
|
using System.Collections.Generic;
|
||||||
|
using System.Collections.ObjectModel;
|
||||||
|
using System.Linq;
|
||||||
|
using System.Windows;
|
||||||
|
using System.Windows.Controls;
|
||||||
|
using System.Windows.Navigation;
|
||||||
|
|
||||||
|
namespace CampusAppWP8.Pages.Events
|
||||||
|
{
|
||||||
|
/// <summary>
|
||||||
|
/// Overview page of all events.
|
||||||
|
/// </summary>
|
||||||
|
public partial class EventIndexPage : PhoneApplicationPage
|
||||||
|
{
|
||||||
|
/// <summary>
|
||||||
|
/// Event Feed object, which contains the rss models and data.
|
||||||
|
/// </summary>
|
||||||
|
public static EventFeed eventFeed { get; set; }
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Default constructor.
|
||||||
|
/// </summary>
|
||||||
|
public EventIndexPage()
|
||||||
|
{
|
||||||
|
InitializeComponent();
|
||||||
|
EventIndexPage.eventFeed = new EventFeed();
|
||||||
|
}
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// On navigation to this page, creates a FeedEventHandler and load the rss feed data.
|
||||||
|
/// </summary>
|
||||||
|
/// <param name="e">event args</param>
|
||||||
|
protected override void OnNavigatedTo(NavigationEventArgs e)
|
||||||
|
{
|
||||||
|
base.OnNavigatedTo(e);
|
||||||
|
|
||||||
|
// Set handler and load the fees informations.
|
||||||
|
EventIndexPage.eventFeed.EventHandler.FeedIsReadyEvent += new FeedEventHandler.FeedReadyHandler(SetupEventPageList);
|
||||||
|
EventIndexPage.eventFeed.LoadFeed();
|
||||||
|
}
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Is called after the rss feeds are loaded into the eventFeed model.
|
||||||
|
/// If there was no feed informations set to the ui, the feed list
|
||||||
|
/// will be sorted by timestamp and the buttons will be created.
|
||||||
|
/// </summary>
|
||||||
|
private void SetupEventPageList()
|
||||||
|
{
|
||||||
|
if ((EventIndexPage.eventFeed.Model != null)
|
||||||
|
&& (EventIndexPage.eventFeed.Model.Channel != null)
|
||||||
|
&& (EventIndexPage.eventFeed.Model.Channel.Count() >= 1)
|
||||||
|
&& (this.ButtonPanel.Items.Count() == 0))
|
||||||
|
{
|
||||||
|
// Sort the list of rssfeeds.
|
||||||
|
IEnumerable<RSSModel> tempList = EventIndexPage.eventFeed.Model.Channel[0].item.OrderByDescending(e => e.DTTimestamp);
|
||||||
|
EventIndexPage.eventFeed.Model.Channel[0].item = new ObservableCollection<RSSModel>(tempList);
|
||||||
|
|
||||||
|
// Create the buttons for the fees selection and add it to the buttonpanel.
|
||||||
|
for (int i = 0; i < EventIndexPage.eventFeed.Model.Channel[0].item.Count(); i++)
|
||||||
|
{
|
||||||
|
Button tempBtn = new Button();
|
||||||
|
tempBtn.Name = "EventRowAppButton";
|
||||||
|
tempBtn.Content = EventIndexPage.eventFeed.Model.Channel[0].item[i].Title;
|
||||||
|
tempBtn.VerticalContentAlignment = VerticalAlignment.Stretch;
|
||||||
|
tempBtn.HorizontalContentAlignment = HorizontalAlignment.Stretch;
|
||||||
|
tempBtn.BorderThickness = new Thickness(0.0);
|
||||||
|
tempBtn.Padding = new Thickness(0.0);
|
||||||
|
tempBtn.Click += EventRowAppButton_Click;
|
||||||
|
tempBtn.Tag = i;
|
||||||
|
|
||||||
|
this.ButtonPanel.Items.Add(tempBtn);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Return the eventFeed object.
|
||||||
|
/// </summary>
|
||||||
|
static public EventFeed GetEventFeed
|
||||||
|
{
|
||||||
|
get { return EventIndexPage.eventFeed; }
|
||||||
|
set { }
|
||||||
|
}
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Is called on clicking on a feed button.
|
||||||
|
/// Navigates to the event pivot page with the information of the
|
||||||
|
/// selected feed index.
|
||||||
|
/// </summary>
|
||||||
|
/// <param name="sender">pressed button object</param>
|
||||||
|
/// <param name="e">event args</param>
|
||||||
|
private void EventRowAppButton_Click(object sender, RoutedEventArgs e)
|
||||||
|
{
|
||||||
|
FrameworkElement tempElem = sender as FrameworkElement;
|
||||||
|
|
||||||
|
NavigationService.Navigate(new Uri("/pages/events/EventPage.xaml?pivotindex=" + tempElem.Tag, UriKind.Relative));
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
50
CampusAppWP8/CampusAppWP8/Pages/Events/EventPage.xaml
Normal file
@@ -0,0 +1,50 @@
|
|||||||
|
<phone:PhoneApplicationPage
|
||||||
|
x:Class="CampusAppWP8.Pages.Events.EventPage"
|
||||||
|
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"
|
||||||
|
xmlns:viewModel="clr-namespace:CampusAppWP8.Model.events_news"
|
||||||
|
mc:Ignorable="d"
|
||||||
|
FontFamily="{StaticResource PhoneFontFamilyNormal}"
|
||||||
|
FontSize="{StaticResource PhoneFontSizeNormal}"
|
||||||
|
Foreground="{StaticResource PhoneForegroundBrush}"
|
||||||
|
SupportedOrientations="Portrait" Orientation="Portrait"
|
||||||
|
shell:SystemTray.IsVisible="True">
|
||||||
|
|
||||||
|
<phone:PhoneApplicationPage.Resources>
|
||||||
|
<viewModel:RSSViewModel x:Key="RssViewModel" x:Name="RssView" />
|
||||||
|
</phone:PhoneApplicationPage.Resources>
|
||||||
|
<!-- LayoutRoot -->
|
||||||
|
<Grid x:Name="LayoutRoot" Background="Transparent">
|
||||||
|
<!-- Pivotpage -->
|
||||||
|
<phone:Pivot x:Name="EventPivot" Title="{Binding Path=LocalizedResources.ApplicationTitle, Source={StaticResource LocalizedStrings}}">
|
||||||
|
<!-- Pivotitem template -->
|
||||||
|
<phone:Pivot.HeaderTemplate>
|
||||||
|
<DataTemplate>
|
||||||
|
<TextBlock Text="{Binding Path=Date, Mode=OneWay}" />
|
||||||
|
</DataTemplate>
|
||||||
|
</phone:Pivot.HeaderTemplate>
|
||||||
|
<phone:Pivot.ItemTemplate>
|
||||||
|
<DataTemplate>
|
||||||
|
<Grid>
|
||||||
|
<Grid.RowDefinitions>
|
||||||
|
<RowDefinition Height="100"/>
|
||||||
|
<RowDefinition Height="*"/>
|
||||||
|
<RowDefinition Height="90"/>
|
||||||
|
</Grid.RowDefinitions>
|
||||||
|
|
||||||
|
<TextBlock x:Name="EventHeadline" Text="{Binding Path=Title, Mode=OneWay}" Grid.Row="0" Height="Auto" TextWrapping="Wrap" VerticalAlignment="Center" HorizontalAlignment="Left" FontSize="42"/>
|
||||||
|
<ScrollViewer Grid.Row="1">
|
||||||
|
<TextBlock x:Name="EventText" Text="{Binding Path=Text, Mode=OneWay}" Height="Auto" TextWrapping="Wrap" VerticalAlignment="Center" HorizontalAlignment="Left" FontSize="24" />
|
||||||
|
</ScrollViewer>
|
||||||
|
<Button Name="EventHome" Content="{Binding Path=LocalizedResources.NewsHomeBtn, Source={StaticResource LocalizedStrings}}" Grid.Row="2" VerticalAlignment="Bottom" HorizontalAlignment="Left" Click="EventHome_Click"/>
|
||||||
|
<Button Name="EventLink" Tag="{Binding Path=Link, Mode=OneWay}" Content="{Binding Path=LocalizedResources.NewsLinkBtn, Source={StaticResource LocalizedStrings}}" Grid.Row="2" VerticalAlignment="Bottom" HorizontalAlignment="Right" Click="EventLink_Click"/>
|
||||||
|
</Grid>
|
||||||
|
</DataTemplate>
|
||||||
|
</phone:Pivot.ItemTemplate>
|
||||||
|
</phone:Pivot>
|
||||||
|
</Grid>
|
||||||
|
</phone:PhoneApplicationPage>
|
||||||
97
CampusAppWP8/CampusAppWP8/Pages/Events/EventPage.xaml.cs
Normal file
@@ -0,0 +1,97 @@
|
|||||||
|
using Microsoft.Phone.Controls;
|
||||||
|
using Microsoft.Phone.Tasks;
|
||||||
|
using System;
|
||||||
|
using System.Linq;
|
||||||
|
using System.Windows;
|
||||||
|
using System.Windows.Navigation;
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
namespace CampusAppWP8.Pages.Events
|
||||||
|
{
|
||||||
|
/// <summary>
|
||||||
|
/// EventPage, where every event fees has his own pivotitem.
|
||||||
|
/// </summary>
|
||||||
|
public partial class EventPage : PhoneApplicationPage
|
||||||
|
{
|
||||||
|
/// <summary>
|
||||||
|
/// for checking if the feed source is already set or not.
|
||||||
|
/// </summary>
|
||||||
|
private bool isSourceSet = false;
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Default constructor.
|
||||||
|
/// </summary>
|
||||||
|
public EventPage()
|
||||||
|
{
|
||||||
|
InitializeComponent();
|
||||||
|
}
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// On navigation to this page.
|
||||||
|
/// The pivotitem source will be set, if it wasn't befor.
|
||||||
|
/// Navigating to the submited index of the choosen pivotitem page.
|
||||||
|
/// </summary>
|
||||||
|
/// <param name="e"></param>
|
||||||
|
protected override void OnNavigatedTo(NavigationEventArgs e)
|
||||||
|
{
|
||||||
|
base.OnNavigatedTo(e);
|
||||||
|
|
||||||
|
// Set pivotitem Source
|
||||||
|
if (this.isSourceSet == false)
|
||||||
|
{
|
||||||
|
if ((EventIndexPage.GetEventFeed.Model != null)
|
||||||
|
&& (EventIndexPage.GetEventFeed.Model.Channel != null)
|
||||||
|
&& (EventIndexPage.GetEventFeed.Model.Channel.Count() >= 1))
|
||||||
|
{
|
||||||
|
this.EventPivot.ItemsSource = EventIndexPage.GetEventFeed.Model.Channel[0].item;
|
||||||
|
this.isSourceSet = true;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
string pivotIndex = "";
|
||||||
|
|
||||||
|
// Navigate to the selected pivotitem
|
||||||
|
if (NavigationContext.QueryString.TryGetValue("pivotindex", out pivotIndex))
|
||||||
|
{
|
||||||
|
int pivotIndexInt = int.Parse(pivotIndex);
|
||||||
|
|
||||||
|
// if the index is in the range of the array
|
||||||
|
if((pivotIndexInt >= 0) && (pivotIndexInt < EventIndexPage.GetEventFeed.Model.Channel[0].item.Count()))
|
||||||
|
EventPivot.SelectedIndex = pivotIndexInt;
|
||||||
|
else
|
||||||
|
MessageBox.Show("ERROR: pivotIndex out of range!!!");
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// On clicking the home button (lower left).
|
||||||
|
/// Navigate back to the event index page.
|
||||||
|
/// </summary>
|
||||||
|
/// <param name="sender">clicked button</param>
|
||||||
|
/// <param name="e">event args</param>
|
||||||
|
private void EventHome_Click(object sender, RoutedEventArgs e)
|
||||||
|
{
|
||||||
|
// Navigate back to the event index page
|
||||||
|
NavigationService.GoBack();
|
||||||
|
}
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// On clicking the link button if a link exists in the feed
|
||||||
|
/// (lower right).
|
||||||
|
/// Open the webbrowser with the url set in the feed.
|
||||||
|
/// </summary>
|
||||||
|
/// <param name="sender">clicked button</param>
|
||||||
|
/// <param name="e">event args</param>
|
||||||
|
private void EventLink_Click(object sender, RoutedEventArgs e)
|
||||||
|
{
|
||||||
|
FrameworkElement fe = sender as FrameworkElement;
|
||||||
|
|
||||||
|
// Open the webbrowser
|
||||||
|
WebBrowserTask webBrowserTask = new WebBrowserTask();
|
||||||
|
webBrowserTask.Uri = new Uri(fe.Tag.ToString(), UriKind.Absolute);
|
||||||
|
webBrowserTask.Show();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
37
CampusAppWP8/CampusAppWP8/Pages/Lecture/LectureFeed.cs
Normal file
@@ -0,0 +1,37 @@
|
|||||||
|
using CampusAppWP8.Model.Lecture;
|
||||||
|
using CampusAppWP8.Utility;
|
||||||
|
using System;
|
||||||
|
using System.Collections.Generic;
|
||||||
|
using System.Linq;
|
||||||
|
using System.Text;
|
||||||
|
using System.Threading.Tasks;
|
||||||
|
|
||||||
|
namespace CampusAppWP8.Pages.Lecture
|
||||||
|
{
|
||||||
|
public class LectureFeed : XmlFeed<LectureList>
|
||||||
|
{
|
||||||
|
public LectureFeed()
|
||||||
|
: base(new Uri("http://www.zv.tu-cottbus.de/LSFveranst/LSF4?Semester=20112&Abschluss=82&Studiengang=079&Von=1&Bis=2"), "Lecture.xml")
|
||||||
|
{
|
||||||
|
this.validRootName = "lsf_auszug";
|
||||||
|
}
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Method implement CheckIsModelUpToDate()-Method <see cref="Feed"/>
|
||||||
|
/// </summary>
|
||||||
|
/// <returns>true, if model is up-to-date, otherwise false</returns>
|
||||||
|
protected override bool CheckIsModelUpToDate()
|
||||||
|
{
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Method implement CheckIsFileUpToDate()-Method <see cref="Feed"/>
|
||||||
|
/// </summary>
|
||||||
|
/// <returns>true, if file is up-to-date, otherwise false</returns>
|
||||||
|
protected override bool CheckIsFileUpToDate()
|
||||||
|
{
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -100,7 +100,7 @@
|
|||||||
</StackPanel>
|
</StackPanel>
|
||||||
</Border>
|
</Border>
|
||||||
<Border BorderBrush="{StaticResource PhoneBorderBrush}" BorderThickness="0,2,0,0" Grid.Row="5">
|
<Border BorderBrush="{StaticResource PhoneBorderBrush}" BorderThickness="0,2,0,0" Grid.Row="5">
|
||||||
<Button>
|
<Button Name="SearchButton">
|
||||||
<Image Source="/Toolkit.Content/ApplicationBar.Select.png" Width="100">
|
<Image Source="/Toolkit.Content/ApplicationBar.Select.png" Width="100">
|
||||||
</Image>
|
</Image>
|
||||||
</Button>
|
</Button>
|
||||||
@@ -7,6 +7,8 @@ using System.Windows.Controls;
|
|||||||
using System.Windows.Navigation;
|
using System.Windows.Navigation;
|
||||||
using Microsoft.Phone.Controls;
|
using Microsoft.Phone.Controls;
|
||||||
using Microsoft.Phone.Shell;
|
using Microsoft.Phone.Shell;
|
||||||
|
using CampusAppWP8.Pages.Lecture;
|
||||||
|
using CampusAppWP8.Utility;
|
||||||
|
|
||||||
namespace CampusAppWP8.Pages.lecture
|
namespace CampusAppWP8.Pages.lecture
|
||||||
{
|
{
|
||||||
@@ -15,6 +17,8 @@ namespace CampusAppWP8.Pages.lecture
|
|||||||
public Lecture()
|
public Lecture()
|
||||||
{
|
{
|
||||||
InitializeComponent();
|
InitializeComponent();
|
||||||
|
LectureFeed test = new LectureFeed();
|
||||||
|
test.LoadFeed();
|
||||||
}
|
}
|
||||||
|
|
||||||
private void PhoneApplicationPage_OrientationChanged(object sender, OrientationChangedEventArgs e)
|
private void PhoneApplicationPage_OrientationChanged(object sender, OrientationChangedEventArgs e)
|
||||||
27
CampusAppWP8/CampusAppWP8/Pages/Lecture/ModulWebPage.xaml
Normal file
@@ -0,0 +1,27 @@
|
|||||||
|
<phone:PhoneApplicationPage
|
||||||
|
x:Class="CampusAppWP8.Pages.Lecture.ModulWebPage"
|
||||||
|
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"
|
||||||
|
FontFamily="{StaticResource PhoneFontFamilyNormal}"
|
||||||
|
FontSize="{StaticResource PhoneFontSizeNormal}"
|
||||||
|
Foreground="{StaticResource PhoneForegroundBrush}"
|
||||||
|
SupportedOrientations="PortraitOrLandscape" Orientation="Portrait"
|
||||||
|
mc:Ignorable="d"
|
||||||
|
shell:SystemTray.IsVisible="True">
|
||||||
|
|
||||||
|
<!--LayoutRoot ist das Stammraster, in dem alle anderen Seiteninhalte platziert werden-->
|
||||||
|
<Grid x:Name="LayoutRoot" Background="Transparent">
|
||||||
|
<Grid.RowDefinitions>
|
||||||
|
<RowDefinition Height="*"/>
|
||||||
|
</Grid.RowDefinitions>
|
||||||
|
|
||||||
|
<!--ContentPanel - zusätzliche Inhalte hier platzieren-->
|
||||||
|
<Grid x:Name="ContentPanel" Grid.Row="1" Margin="12,0,12,0">
|
||||||
|
<phone:WebBrowser x:Name="WebmailBrowser" IsScriptEnabled="True"/>
|
||||||
|
</Grid>
|
||||||
|
</Grid>
|
||||||
|
</phone:PhoneApplicationPage>
|
||||||
43
CampusAppWP8/CampusAppWP8/Pages/Lecture/ModulWebPage.xaml.cs
Normal file
@@ -0,0 +1,43 @@
|
|||||||
|
//-----------------------------------------------------------------------
|
||||||
|
// <copyright file="ModulWebPage.xaml.cs" company="BTU/IIT">
|
||||||
|
// Company copyright tag.
|
||||||
|
// </copyright>
|
||||||
|
// <author>stubbfel</author>
|
||||||
|
// <sience>11.06.2013</sience>
|
||||||
|
//----------------------------------------------------------------------
|
||||||
|
namespace CampusAppWP8.Pages.Lecture
|
||||||
|
{
|
||||||
|
using System;
|
||||||
|
using System.Windows.Navigation;
|
||||||
|
using CampusAppWP8.Resources;
|
||||||
|
using Microsoft.Phone.Controls;
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Class for the page which shows Webpages from the BaseAddress <see cref="Constants.UrlLectureModulBaseAddr" />
|
||||||
|
/// </summary>
|
||||||
|
public partial class ModulWebPage : PhoneApplicationPage
|
||||||
|
{
|
||||||
|
/// <summary>
|
||||||
|
/// Initializes a new instance of the <see cref="ModulWebPage" /> class.
|
||||||
|
/// </summary>
|
||||||
|
public ModulWebPage()
|
||||||
|
{
|
||||||
|
this.InitializeComponent();
|
||||||
|
}
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Override the OnNavigatedTo method
|
||||||
|
/// </summary>
|
||||||
|
/// <param name="e">Arguments of navigation</param>
|
||||||
|
protected override void OnNavigatedTo(NavigationEventArgs e)
|
||||||
|
{
|
||||||
|
if (NavigationContext.QueryString.ContainsKey(Constants.ParamLectureModulNumber))
|
||||||
|
{
|
||||||
|
string number = NavigationContext.QueryString[Constants.ParamLectureModulNumber];
|
||||||
|
this.WebmailBrowser.Navigate(new Uri(Constants.UrlLectureModulBaseAddr + number, UriKind.Absolute));
|
||||||
|
}
|
||||||
|
|
||||||
|
base.OnNavigatedTo(e);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -0,0 +1,73 @@
|
|||||||
|
<phone:PhoneApplicationPage
|
||||||
|
x:Class="CampusAppWP8.Pages.Lecture.ResultDetailPage"
|
||||||
|
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"
|
||||||
|
FontFamily="{StaticResource PhoneFontFamilyNormal}"
|
||||||
|
FontSize="{StaticResource PhoneFontSizeNormal}"
|
||||||
|
Foreground="{StaticResource PhoneForegroundBrush}"
|
||||||
|
SupportedOrientations="Portrait" Orientation="Portrait"
|
||||||
|
mc:Ignorable="d"
|
||||||
|
shell:SystemTray.IsVisible="True">
|
||||||
|
|
||||||
|
<!--LayoutRoot ist das Stammraster, in dem alle anderen Seiteninhalte platziert werden-->
|
||||||
|
<Grid x:Name="LayoutRoot" Background="Transparent">
|
||||||
|
<Grid.RowDefinitions>
|
||||||
|
<RowDefinition Height="Auto"/>
|
||||||
|
<RowDefinition Height="*"/>
|
||||||
|
</Grid.RowDefinitions>
|
||||||
|
|
||||||
|
<!--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}}"/>
|
||||||
|
</StackPanel>
|
||||||
|
|
||||||
|
<!--ContentPanel - zusätzliche Inhalte hier platzieren-->
|
||||||
|
<Grid x:Name="ContentPanel" Grid.Row="1" Margin="12,0,12,0">
|
||||||
|
<ScrollViewer>
|
||||||
|
<StackPanel>
|
||||||
|
<Border BorderBrush="{StaticResource PhoneInverseInactiveBrush}" BorderThickness="0,0,0,0" Padding="0,12,0,12">
|
||||||
|
<StackPanel>
|
||||||
|
<TextBlock Text="{Binding Path=LocalizedResources.LectureApp_Type, Source={StaticResource LocalizedStrings}}" Style="{StaticResource PhoneTextGroupHeaderStyle}" Margin="0,0,0,0"/>
|
||||||
|
<TextBlock Text="{Binding Type}" TextWrapping="Wrap"/>
|
||||||
|
</StackPanel>
|
||||||
|
</Border>
|
||||||
|
<Border BorderBrush="{StaticResource PhoneInverseInactiveBrush}" BorderThickness="0,1,0,0" Padding="0,12,0,12">
|
||||||
|
<StackPanel>
|
||||||
|
<TextBlock Text="{Binding Path=LocalizedResources.LectureApp_LectureName, Source={StaticResource LocalizedStrings}}" Style="{StaticResource PhoneTextGroupHeaderStyle}" Margin="0,0,0,0"/>
|
||||||
|
<TextBlock Text="{Binding Modul.Title}" TextWrapping="Wrap"/>
|
||||||
|
</StackPanel>
|
||||||
|
</Border>
|
||||||
|
<Border BorderBrush="{StaticResource PhoneInverseInactiveBrush}" BorderThickness="0,1,0,0" Padding="0,12,0,12">
|
||||||
|
<StackPanel>
|
||||||
|
<TextBlock Text="{Binding Path=LocalizedResources.LectureApp_Officer, Source={StaticResource LocalizedStrings}}" Style="{StaticResource PhoneTextGroupHeaderStyle}" Margin="0,0,0,0"/>
|
||||||
|
<TextBlock Text="{Binding LecturerString}" TextWrapping="Wrap"/>
|
||||||
|
</StackPanel>
|
||||||
|
</Border>
|
||||||
|
<Border BorderBrush="{StaticResource PhoneInverseInactiveBrush}" BorderThickness="0,1,0,0" Padding="0,12,0,12">
|
||||||
|
<StackPanel>
|
||||||
|
<TextBlock Text="{Binding Path=LocalizedResources.LectureApp_Courses, Source={StaticResource LocalizedStrings}}" Style="{StaticResource PhoneTextGroupHeaderStyle}" Margin="0,0,0,0"/>
|
||||||
|
<TextBlock Text="{Binding CourseString}" TextWrapping="Wrap"/>
|
||||||
|
</StackPanel>
|
||||||
|
</Border>
|
||||||
|
<Border BorderBrush="{StaticResource PhoneInverseInactiveBrush}" BorderThickness="0,1,0,0" Padding="0,12,0,12">
|
||||||
|
<StackPanel>
|
||||||
|
<TextBlock Text="{Binding Path=LocalizedResources.LectureApp_Department, Source={StaticResource LocalizedStrings}}" Style="{StaticResource PhoneTextGroupHeaderStyle}" Margin="0,0,0,0"/>
|
||||||
|
<TextBlock Text="{Binding Department}" TextWrapping="Wrap"/>
|
||||||
|
</StackPanel>
|
||||||
|
</Border>
|
||||||
|
<Border BorderBrush="{StaticResource PhoneInverseInactiveBrush}" BorderThickness="0,1,0,0" Padding="0,12,0,12">
|
||||||
|
<StackPanel>
|
||||||
|
<TextBlock Text="{Binding Path=LocalizedResources.LectureApp_LectureTopic, Source={StaticResource LocalizedStrings}}" Style="{StaticResource PhoneTextGroupHeaderStyle}" Margin="0,0,0,0"/>
|
||||||
|
<TextBlock Text="{Binding Topic}" TextWrapping="Wrap"/>
|
||||||
|
</StackPanel>
|
||||||
|
</Border>
|
||||||
|
</StackPanel>
|
||||||
|
</ScrollViewer>
|
||||||
|
</Grid>
|
||||||
|
</Grid>
|
||||||
|
|
||||||
|
</phone:PhoneApplicationPage>
|
||||||
@@ -0,0 +1,59 @@
|
|||||||
|
//-----------------------------------------------------------------------
|
||||||
|
// <copyright file="ResultDetailPage.xaml.cs" company="BTU/IIT">
|
||||||
|
// Company copyright tag.
|
||||||
|
// </copyright>
|
||||||
|
// <author>stubbfel</author>
|
||||||
|
// <sience>11.06.2013</sience>
|
||||||
|
//----------------------------------------------------------------------
|
||||||
|
namespace CampusAppWP8.Pages.Lecture
|
||||||
|
{
|
||||||
|
using System.Windows.Navigation;
|
||||||
|
using CampusAppWP8.Model.Lecture;
|
||||||
|
using CampusAppWP8.Resources;
|
||||||
|
using Microsoft.Phone.Controls;
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Class for the page which shows details of an activity
|
||||||
|
/// </summary>
|
||||||
|
public partial class ResultDetailPage : PhoneApplicationPage
|
||||||
|
{
|
||||||
|
/// <summary>
|
||||||
|
/// Initializes a new instance of the <see cref="ResultDetailPage" /> class.
|
||||||
|
/// </summary>
|
||||||
|
public ResultDetailPage()
|
||||||
|
{
|
||||||
|
this.InitializeComponent();
|
||||||
|
}
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Override the OnNavigatedTo method
|
||||||
|
/// </summary>
|
||||||
|
/// <param name="e">Arguments of navigation</param>
|
||||||
|
protected override void OnNavigatedTo(NavigationEventArgs e)
|
||||||
|
{
|
||||||
|
if (NavigationContext.QueryString.ContainsKey(Constants.ParamLectureActivityId))
|
||||||
|
{
|
||||||
|
string activityId = NavigationContext.QueryString[Constants.ParamLectureActivityId];
|
||||||
|
this.LoadActivity(int.Parse(activityId));
|
||||||
|
}
|
||||||
|
|
||||||
|
base.OnNavigatedTo(e);
|
||||||
|
}
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Method load a certain Activity from the model
|
||||||
|
/// </summary>
|
||||||
|
/// <param name="activityId">id of the activity</param>
|
||||||
|
private void LoadActivity(int activityId)
|
||||||
|
{
|
||||||
|
LectureList list = App.LoadFromIsolatedStorage<LectureList>(Constants.IsolatedStorageLectureModel);
|
||||||
|
if (list != null)
|
||||||
|
{
|
||||||
|
LectureActivity activity = list.GetActivity(activityId);
|
||||||
|
activity.createLectureString();
|
||||||
|
activity.createCourseString();
|
||||||
|
this.ContentPanel.DataContext = activity;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
70
CampusAppWP8/CampusAppWP8/Pages/Lecture/ResultPage.xaml
Normal file
@@ -0,0 +1,70 @@
|
|||||||
|
<phone:PhoneApplicationPage
|
||||||
|
x:Class="CampusAppWP8.Pages.Lecture.ResultPage"
|
||||||
|
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"
|
||||||
|
FontFamily="{StaticResource PhoneFontFamilyNormal}"
|
||||||
|
FontSize="{StaticResource PhoneFontSizeNormal}"
|
||||||
|
Foreground="{StaticResource PhoneForegroundBrush}"
|
||||||
|
SupportedOrientations="PortraitOrLandscape" Orientation="Portrait"
|
||||||
|
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" BorderBrush="{x:Null}">
|
||||||
|
<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 Modul.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>
|
||||||
|
<RowDefinition Height="Auto"/>
|
||||||
|
<RowDefinition Height="*"/>
|
||||||
|
</Grid.RowDefinitions>
|
||||||
|
|
||||||
|
<!--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}}"/>
|
||||||
|
</StackPanel>
|
||||||
|
|
||||||
|
<!--ContentPanel - zusätzliche Inhalte hier platzieren-->
|
||||||
|
<Grid x:Name="ContentPanel" Grid.Row="1" Margin="12,0,12,0">
|
||||||
|
<ScrollViewer>
|
||||||
|
<phone:LongListSelector Name="ResultList" ItemTemplate="{StaticResource LectureItemTemplate}" HorizontalContentAlignment="Left" />
|
||||||
|
</ScrollViewer>
|
||||||
|
</Grid>
|
||||||
|
</Grid>
|
||||||
|
|
||||||
|
</phone:PhoneApplicationPage>
|
||||||
|
|
||||||
158
CampusAppWP8/CampusAppWP8/Pages/Lecture/ResultPage.xaml.cs
Normal file
@@ -0,0 +1,158 @@
|
|||||||
|
//-----------------------------------------------------------------------
|
||||||
|
// <copyright file="ResultPage.xaml.cs" company="BTU/IIT">
|
||||||
|
// Company copyright tag.
|
||||||
|
// </copyright>
|
||||||
|
// <author>stubbfel</author>
|
||||||
|
// <sience>11.06.2013</sience>
|
||||||
|
//----------------------------------------------------------------------
|
||||||
|
namespace CampusAppWP8.Pages.Lecture
|
||||||
|
{
|
||||||
|
using System;
|
||||||
|
using System.Windows;
|
||||||
|
using System.Windows.Controls;
|
||||||
|
using System.Windows.Navigation;
|
||||||
|
using CampusAppWP8.Model.Lecture;
|
||||||
|
using CampusAppWP8.Resources;
|
||||||
|
using CampusAppWP8.Utility;
|
||||||
|
using Microsoft.Phone.Controls;
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Class for the page which shows the results of an LectureRequest
|
||||||
|
/// </summary>
|
||||||
|
public partial class ResultPage : PhoneApplicationPage
|
||||||
|
{
|
||||||
|
/// <summary>
|
||||||
|
/// actual LectureFeed
|
||||||
|
/// </summary>
|
||||||
|
private LectureFeed feed;
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Reference of the button which was lastClicked
|
||||||
|
/// </summary>
|
||||||
|
private Button lastClickedButton;
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Initializes a new instance of the <see cref="ResultPage" /> class.
|
||||||
|
/// </summary>
|
||||||
|
public ResultPage()
|
||||||
|
{
|
||||||
|
this.InitializeComponent();
|
||||||
|
this.feed = new LectureFeed();
|
||||||
|
this.feed.EventHandler.FeedIsReadyEvent += new FeedEventHandler.FeedReadyHandler(this.FeedIsReady);
|
||||||
|
this.feed.LoadFeed();
|
||||||
|
}
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Method will be execute if the feed is ready
|
||||||
|
/// </summary>
|
||||||
|
private void FeedIsReady()
|
||||||
|
{
|
||||||
|
this.ResultList.ItemsSource = this.feed.Model.Activities;
|
||||||
|
App.SaveToIsolatedStorage<LectureList>(Constants.IsolatedStorageLectureModel, this.feed.Model);
|
||||||
|
}
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Method toggle the Visibility of the Link- and Details-Buttons
|
||||||
|
/// </summary>
|
||||||
|
/// <param name="sender">Caller of the function</param>
|
||||||
|
/// <param name="e">some EventArgs</param>
|
||||||
|
private void ToggleOptions(object sender, RoutedEventArgs e)
|
||||||
|
{
|
||||||
|
Button button = (Button)sender;
|
||||||
|
StackPanel parent = (StackPanel)button.Parent;
|
||||||
|
if (this.lastClickedButton != null && !this.lastClickedButton.Equals(button))
|
||||||
|
{
|
||||||
|
this.HideOptions(parent);
|
||||||
|
}
|
||||||
|
|
||||||
|
this.lastClickedButton = button;
|
||||||
|
|
||||||
|
Button link = (Button)parent.FindName("Link");
|
||||||
|
Button details = (Button)parent.FindName("Details");
|
||||||
|
this.ToogleVisibility(link);
|
||||||
|
this.ToogleVisibility(details);
|
||||||
|
}
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Method shows the Link- and Details-Buttons
|
||||||
|
/// </summary>
|
||||||
|
/// <param name="parent">Reference of the StackPanel which include the buttons </param>
|
||||||
|
private void ShowOptions(StackPanel parent)
|
||||||
|
{
|
||||||
|
Button link = (Button)parent.FindName("Link");
|
||||||
|
Button details = (Button)parent.FindName("Details");
|
||||||
|
this.ShowVisibility(link);
|
||||||
|
this.ShowVisibility(details);
|
||||||
|
}
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Method hide the Link- and Details-Buttons
|
||||||
|
/// </summary>
|
||||||
|
/// <param name="parent">Reference of the StackPanel which include the buttons </param>
|
||||||
|
private void HideOptions(StackPanel parent)
|
||||||
|
{
|
||||||
|
Button link = (Button)parent.FindName("Link");
|
||||||
|
Button details = (Button)parent.FindName("Details");
|
||||||
|
this.HideVisibility(link);
|
||||||
|
this.HideVisibility(details);
|
||||||
|
}
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Method toggle the Visibility of an UIElement
|
||||||
|
/// </summary>
|
||||||
|
/// <param name="element">UIElement which Visibility has to be toggle</param>
|
||||||
|
private void ToogleVisibility(UIElement element)
|
||||||
|
{
|
||||||
|
if (System.Windows.Visibility.Visible.Equals(element.Visibility))
|
||||||
|
{
|
||||||
|
this.HideVisibility(element);
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
this.ShowVisibility(element);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Method set the Visibility=true of an UIElement
|
||||||
|
/// </summary>
|
||||||
|
/// <param name="element">UIElement which Visibility has to been true</param>
|
||||||
|
private void ShowVisibility(UIElement element)
|
||||||
|
{
|
||||||
|
element.Visibility = System.Windows.Visibility.Visible;
|
||||||
|
}
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Method set the Visibility=false of an UIElement
|
||||||
|
/// </summary>
|
||||||
|
/// <param name="element">UIElement which Visibility has to been false</param>
|
||||||
|
private void HideVisibility(UIElement element)
|
||||||
|
{
|
||||||
|
element.Visibility = System.Windows.Visibility.Collapsed;
|
||||||
|
}
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Method navigate to ModuleWebPage
|
||||||
|
/// </summary>
|
||||||
|
/// <param name="sender">Caller of the function</param>
|
||||||
|
/// <param name="e">some EventArgs</param>
|
||||||
|
private void ShowModulWebPage(object sender, RoutedEventArgs e)
|
||||||
|
{
|
||||||
|
Button btn = (Button)sender;
|
||||||
|
Uri url = new Uri(Constants.PathLectureModulWebPage + Constants.Paramseparator + Constants.ParamLectureModulNumber + "=" + btn.Tag, UriKind.Relative);
|
||||||
|
NavigationService.Navigate(url);
|
||||||
|
}
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Method navigate to DetailPage
|
||||||
|
/// </summary>
|
||||||
|
/// <param name="sender">Caller of the function</param>
|
||||||
|
/// <param name="e">some EventArgs</param>
|
||||||
|
private void ShowDetailPage(object sender, RoutedEventArgs e)
|
||||||
|
{
|
||||||
|
Button btn = (Button)sender;
|
||||||
|
Uri url = new Uri(Constants.PathResultDetailWebPage + Constants.Paramseparator + Constants.ParamLectureActivityId + "=" + btn.Tag, UriKind.Relative);
|
||||||
|
NavigationService.Navigate(url);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
33
CampusAppWP8/CampusAppWP8/Pages/News/NewsIndexPage.xaml
Normal file
@@ -0,0 +1,33 @@
|
|||||||
|
<phone:PhoneApplicationPage
|
||||||
|
x:Class="CampusAppWP8.Pages.News.NewsIndexPage"
|
||||||
|
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"
|
||||||
|
FontFamily="{StaticResource PhoneFontFamilyNormal}"
|
||||||
|
FontSize="{StaticResource PhoneFontSizeNormal}"
|
||||||
|
Foreground="{StaticResource PhoneForegroundBrush}"
|
||||||
|
SupportedOrientations="Portrait" Orientation="Portrait"
|
||||||
|
mc:Ignorable="d"
|
||||||
|
shell:SystemTray.IsVisible="True">
|
||||||
|
|
||||||
|
<!--LayoutRoot -->
|
||||||
|
<Grid x:Name="LayoutRoot" Background="Transparent">
|
||||||
|
<Grid.RowDefinitions>
|
||||||
|
<RowDefinition Height="Auto"/>
|
||||||
|
<RowDefinition Height="*"/>
|
||||||
|
</Grid.RowDefinitions>
|
||||||
|
|
||||||
|
<!-- Title and headline -->
|
||||||
|
<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.NewsApp_Title, Source={StaticResource LocalizedStrings}}" Margin="9,-7,0,0" Style="{StaticResource PhoneTextTitle1Style}"/>
|
||||||
|
</StackPanel>
|
||||||
|
<!-- Content -->
|
||||||
|
<ListBox x:Name="ButtonPanel" Grid.Row="1">
|
||||||
|
</ListBox>
|
||||||
|
</Grid>
|
||||||
|
|
||||||
|
</phone:PhoneApplicationPage>
|
||||||
108
CampusAppWP8/CampusAppWP8/Pages/News/NewsIndexPage.xaml.cs
Normal file
@@ -0,0 +1,108 @@
|
|||||||
|
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.Model.events_news;
|
||||||
|
using CampusAppWP8.Utility;
|
||||||
|
using CampusAppWP8.Resources;
|
||||||
|
using System.Collections.ObjectModel;
|
||||||
|
using CampusAppWP8.Feed.News;
|
||||||
|
|
||||||
|
namespace CampusAppWP8.Pages.News
|
||||||
|
{
|
||||||
|
/// <summary>
|
||||||
|
/// Overview page of all news.
|
||||||
|
/// </summary>
|
||||||
|
public partial class NewsIndexPage : PhoneApplicationPage
|
||||||
|
{
|
||||||
|
/// <summary>
|
||||||
|
/// News Feed object, which contains the rss models and data.
|
||||||
|
/// </summary>
|
||||||
|
public static NewsFeed newsFeed { get; set; }
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Default constructor.
|
||||||
|
/// </summary>
|
||||||
|
public NewsIndexPage()
|
||||||
|
{
|
||||||
|
InitializeComponent();
|
||||||
|
NewsIndexPage.newsFeed = new NewsFeed();
|
||||||
|
}
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// On navigation to this page, creates a FeedEventHandler and load the rss feed data.
|
||||||
|
/// </summary>
|
||||||
|
/// <param name="e">event args</param>
|
||||||
|
protected override void OnNavigatedTo(NavigationEventArgs e)
|
||||||
|
{
|
||||||
|
base.OnNavigatedTo(e);
|
||||||
|
|
||||||
|
// Set handler and load the fees informations.
|
||||||
|
NewsIndexPage.newsFeed.EventHandler.FeedIsReadyEvent += new FeedEventHandler.FeedReadyHandler(SetupNewsPageList);
|
||||||
|
NewsIndexPage.newsFeed.LoadFeed();
|
||||||
|
}
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Is called after the rss feeds are loaded into the newsFeed model.
|
||||||
|
/// If there was no feed informations set to the ui, the feed list
|
||||||
|
/// will be sorted by timestamp and the buttons will be created.
|
||||||
|
/// </summary>
|
||||||
|
private void SetupNewsPageList()
|
||||||
|
{
|
||||||
|
if ((NewsIndexPage.newsFeed.Model != null)
|
||||||
|
&& (NewsIndexPage.newsFeed.Model.Channel != null)
|
||||||
|
&& (NewsIndexPage.newsFeed.Model.Channel.Count() >= 1)
|
||||||
|
&& (this.ButtonPanel.Items.Count() == 0))
|
||||||
|
{
|
||||||
|
// Sort the list of rssfeeds.
|
||||||
|
IEnumerable<RSSModel> tempList = NewsIndexPage.newsFeed.Model.Channel[0].item.OrderByDescending(e => e.DTTimestamp);
|
||||||
|
NewsIndexPage.newsFeed.Model.Channel[0].item = new ObservableCollection<RSSModel>(tempList);
|
||||||
|
|
||||||
|
// Create the buttons for the fees selection and add it to the buttonpanel.
|
||||||
|
for (int i = 0; i < NewsIndexPage.newsFeed.Model.Channel[0].item.Count(); i++)
|
||||||
|
{
|
||||||
|
Button tempBtn = new Button();
|
||||||
|
tempBtn.Name = "NewsRowAppButton";
|
||||||
|
tempBtn.Content = NewsIndexPage.newsFeed.Model.Channel[0].item[i].Title;
|
||||||
|
tempBtn.VerticalContentAlignment = VerticalAlignment.Stretch;
|
||||||
|
tempBtn.HorizontalContentAlignment = HorizontalAlignment.Stretch;
|
||||||
|
tempBtn.BorderThickness = new Thickness(0.0);
|
||||||
|
tempBtn.Padding = new Thickness(0.0);
|
||||||
|
tempBtn.Click += NewsRowAppButton_Click;
|
||||||
|
tempBtn.Tag = i;
|
||||||
|
|
||||||
|
this.ButtonPanel.Items.Add(tempBtn);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Return the newsFeed object.
|
||||||
|
/// </summary>
|
||||||
|
static public NewsFeed GetNewsFeed
|
||||||
|
{
|
||||||
|
get { return NewsIndexPage.newsFeed; }
|
||||||
|
set { }
|
||||||
|
}
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Is called on clicking on a feed button.
|
||||||
|
/// Navigates to the news pivot page with the information of the
|
||||||
|
/// selected feed index.
|
||||||
|
/// </summary>
|
||||||
|
/// <param name="sender">pressed button object</param>
|
||||||
|
/// <param name="e">event args</param>
|
||||||
|
private void NewsRowAppButton_Click(object sender, RoutedEventArgs e)
|
||||||
|
{
|
||||||
|
FrameworkElement tempElem = sender as FrameworkElement;
|
||||||
|
|
||||||
|
NavigationService.Navigate(new Uri("/pages/news/NewsPage.xaml?pivotindex=" + tempElem.Tag, UriKind.Relative));
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
50
CampusAppWP8/CampusAppWP8/Pages/News/NewsPage.xaml
Normal file
@@ -0,0 +1,50 @@
|
|||||||
|
<phone:PhoneApplicationPage
|
||||||
|
x:Class="CampusAppWP8.Pages.News.NewsPage"
|
||||||
|
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"
|
||||||
|
xmlns:viewModel="clr-namespace:CampusAppWP8.Model.events_news"
|
||||||
|
mc:Ignorable="d"
|
||||||
|
FontFamily="{StaticResource PhoneFontFamilyNormal}"
|
||||||
|
FontSize="{StaticResource PhoneFontSizeNormal}"
|
||||||
|
Foreground="{StaticResource PhoneForegroundBrush}"
|
||||||
|
SupportedOrientations="Portrait" Orientation="Portrait"
|
||||||
|
shell:SystemTray.IsVisible="True">
|
||||||
|
|
||||||
|
<phone:PhoneApplicationPage.Resources>
|
||||||
|
<viewModel:RSSViewModel x:Key="RssViewModel" x:Name="RssView" />
|
||||||
|
</phone:PhoneApplicationPage.Resources>
|
||||||
|
<!-- LayoutRoot -->
|
||||||
|
<Grid x:Name="LayoutRoot" Background="Transparent">
|
||||||
|
<!-- Pivotpage -->
|
||||||
|
<phone:Pivot x:Name="NewsPivot" Title="{Binding Path=LocalizedResources.ApplicationTitle, Source={StaticResource LocalizedStrings}}">
|
||||||
|
<!-- Pivotitem template -->
|
||||||
|
<phone:Pivot.HeaderTemplate>
|
||||||
|
<DataTemplate>
|
||||||
|
<TextBlock Text="{Binding Path=Date, Mode=OneWay}" />
|
||||||
|
</DataTemplate>
|
||||||
|
</phone:Pivot.HeaderTemplate>
|
||||||
|
<phone:Pivot.ItemTemplate>
|
||||||
|
<DataTemplate>
|
||||||
|
<Grid>
|
||||||
|
<Grid.RowDefinitions>
|
||||||
|
<RowDefinition Height="100"/>
|
||||||
|
<RowDefinition Height="*"/>
|
||||||
|
<RowDefinition Height="90"/>
|
||||||
|
</Grid.RowDefinitions>
|
||||||
|
|
||||||
|
<TextBlock x:Name="NewsHeadline" Text="{Binding Path=Title, Mode=OneWay}" Grid.Row="0" Height="Auto" TextWrapping="Wrap" VerticalAlignment="Center" HorizontalAlignment="Left" FontSize="42"/>
|
||||||
|
<ScrollViewer Grid.Row="1">
|
||||||
|
<TextBlock x:Name="NewsText" Text="{Binding Path=Text, Mode=OneWay}" Height="Auto" TextWrapping="Wrap" VerticalAlignment="Center" HorizontalAlignment="Left" FontSize="24" />
|
||||||
|
</ScrollViewer>
|
||||||
|
<Button Name="NewsHome" Content="{Binding Path=LocalizedResources.NewsHomeBtn, Source={StaticResource LocalizedStrings}}" Grid.Row="2" VerticalAlignment="Bottom" HorizontalAlignment="Left" Click="NewsHome_Click"/>
|
||||||
|
<Button Name="NewsLink" Tag="{Binding Path=Link, Mode=OneWay}" Content="{Binding Path=LocalizedResources.NewsLinkBtn, Source={StaticResource LocalizedStrings}}" Grid.Row="2" VerticalAlignment="Bottom" HorizontalAlignment="Right" Click="NewsLink_Click"/>
|
||||||
|
</Grid>
|
||||||
|
</DataTemplate>
|
||||||
|
</phone:Pivot.ItemTemplate>
|
||||||
|
</phone:Pivot>
|
||||||
|
</Grid>
|
||||||
|
</phone:PhoneApplicationPage>
|
||||||
108
CampusAppWP8/CampusAppWP8/Pages/News/NewsPage.xaml.cs
Normal file
@@ -0,0 +1,108 @@
|
|||||||
|
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 System.Xml.Linq;
|
||||||
|
using System.Xml;
|
||||||
|
using System.IO;
|
||||||
|
using Microsoft.Phone.Tasks;
|
||||||
|
|
||||||
|
using CampusAppWP8.Model.events_news;
|
||||||
|
using CampusAppWP8.Utility;
|
||||||
|
using CampusAppWP8.Resources;
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
namespace CampusAppWP8.Pages.News
|
||||||
|
{
|
||||||
|
/// <summary>
|
||||||
|
/// EventPage, where every news fees has his own pivotitem.
|
||||||
|
/// </summary>
|
||||||
|
public partial class NewsPage : PhoneApplicationPage
|
||||||
|
{
|
||||||
|
/// <summary>
|
||||||
|
/// for checking if the feed source is already set or not.
|
||||||
|
/// </summary>
|
||||||
|
private bool isSourceSet = false;
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Default constructor.
|
||||||
|
/// </summary>
|
||||||
|
public NewsPage()
|
||||||
|
{
|
||||||
|
InitializeComponent();
|
||||||
|
}
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// On navigation to this page.
|
||||||
|
/// The pivotitem source will be set, if it wasn't befor.
|
||||||
|
/// Navigating to the submited index of the choosen pivotitem page.
|
||||||
|
/// </summary>
|
||||||
|
/// <param name="e"></param>
|
||||||
|
protected override void OnNavigatedTo(NavigationEventArgs e)
|
||||||
|
{
|
||||||
|
base.OnNavigatedTo(e);
|
||||||
|
|
||||||
|
// Set pivotitem Source
|
||||||
|
if (this.isSourceSet == false)
|
||||||
|
{
|
||||||
|
if ((NewsIndexPage.GetNewsFeed.Model != null)
|
||||||
|
&& (NewsIndexPage.GetNewsFeed.Model.Channel != null)
|
||||||
|
&& (NewsIndexPage.GetNewsFeed.Model.Channel.Count() >= 1))
|
||||||
|
{
|
||||||
|
this.NewsPivot.ItemsSource = NewsIndexPage.GetNewsFeed.Model.Channel[0].item;
|
||||||
|
this.isSourceSet = true;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
string pivotIndex = "";
|
||||||
|
|
||||||
|
// Navigate to the selected pivotitem
|
||||||
|
if (NavigationContext.QueryString.TryGetValue("pivotindex", out pivotIndex))
|
||||||
|
{
|
||||||
|
int pivotIndexInt = int.Parse(pivotIndex);
|
||||||
|
|
||||||
|
// if the index is in the range of the array
|
||||||
|
if ((pivotIndexInt >= 0) && (pivotIndexInt < NewsIndexPage.GetNewsFeed.Model.Channel[0].item.Count()))
|
||||||
|
NewsPivot.SelectedIndex = pivotIndexInt;
|
||||||
|
else
|
||||||
|
MessageBox.Show("ERROR: pivotIndex out of range!!!");
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// On clicking the home button (lower left).
|
||||||
|
/// Navigate back to the news index page.
|
||||||
|
/// </summary>
|
||||||
|
/// <param name="sender">clicked button</param>
|
||||||
|
/// <param name="e">event args</param>
|
||||||
|
private void NewsHome_Click(object sender, RoutedEventArgs e)
|
||||||
|
{
|
||||||
|
// Navigate back to the news index page
|
||||||
|
NavigationService.GoBack();
|
||||||
|
}
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// On clicking the link button if a link exists in the feed
|
||||||
|
/// (lower right).
|
||||||
|
/// Open the webbrowser with the url set in the feed.
|
||||||
|
/// </summary>
|
||||||
|
/// <param name="sender">clicked button</param>
|
||||||
|
/// <param name="e">event args</param>
|
||||||
|
private void NewsLink_Click(object sender, RoutedEventArgs e)
|
||||||
|
{
|
||||||
|
FrameworkElement fe = sender as FrameworkElement;
|
||||||
|
|
||||||
|
// Open the webbrowser
|
||||||
|
WebBrowserTask webBrowserTask = new WebBrowserTask();
|
||||||
|
webBrowserTask.Uri = new Uri(fe.Tag.ToString(), UriKind.Absolute);
|
||||||
|
webBrowserTask.Show();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -1,5 +1,5 @@
|
|||||||
<phone:PhoneApplicationPage
|
<phone:PhoneApplicationPage
|
||||||
x:Class="CampusAppWP8.Pages.webmail.Webmail"
|
x:Class="CampusAppWP8.Pages.Webmail.Webmail"
|
||||||
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
|
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
|
||||||
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
|
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
|
||||||
xmlns:phone="clr-namespace:Microsoft.Phone.Controls;assembly=Microsoft.Phone"
|
xmlns:phone="clr-namespace:Microsoft.Phone.Controls;assembly=Microsoft.Phone"
|
||||||
@@ -1,15 +1,8 @@
|
|||||||
using System;
|
using Microsoft.Phone.Controls;
|
||||||
using System.Collections.Generic;
|
using System;
|
||||||
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 System.Threading.Tasks;
|
|
||||||
|
|
||||||
namespace CampusAppWP8.Pages.webmail
|
|
||||||
|
namespace CampusAppWP8.Pages.Webmail
|
||||||
{
|
{
|
||||||
public partial class Webmail : PhoneApplicationPage
|
public partial class Webmail : PhoneApplicationPage
|
||||||
{
|
{
|
||||||
@@ -13,7 +13,7 @@
|
|||||||
<Capability Name="ID_CAP_ISV_CAMERA" />
|
<Capability Name="ID_CAP_ISV_CAMERA" />
|
||||||
</Capabilities>
|
</Capabilities>
|
||||||
<Tasks>
|
<Tasks>
|
||||||
<DefaultTask Name="_default" NavigationPage="pages/mensa/MensaPage.xaml" />
|
<DefaultTask Name="_default" NavigationPage="pages/StartPage.xaml" />
|
||||||
</Tasks>
|
</Tasks>
|
||||||
<Tokens>
|
<Tokens>
|
||||||
<PrimaryToken TokenID="CampusAppWP8Token" TaskName="_default">
|
<PrimaryToken TokenID="CampusAppWP8Token" TaskName="_default">
|
||||||
|
|||||||
@@ -114,6 +114,15 @@ namespace CampusAppWP8.Resources {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Sucht eine lokalisierte Zeichenfolge, die Fakultät ähnelt.
|
||||||
|
/// </summary>
|
||||||
|
public static string Faculty {
|
||||||
|
get {
|
||||||
|
return ResourceManager.GetString("Faculty", resourceCulture);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Sucht eine lokalisierte Zeichenfolge, die Hausaufgaben ähnelt.
|
/// Sucht eine lokalisierte Zeichenfolge, die Hausaufgaben ähnelt.
|
||||||
/// </summary>
|
/// </summary>
|
||||||
@@ -132,6 +141,15 @@ namespace CampusAppWP8.Resources {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Sucht eine lokalisierte Zeichenfolge, die Studiengänge ähnelt.
|
||||||
|
/// </summary>
|
||||||
|
public static string LectureApp_Courses {
|
||||||
|
get {
|
||||||
|
return ResourceManager.GetString("LectureApp_Courses", resourceCulture);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Sucht eine lokalisierte Zeichenfolge, die Abschluss ähnelt.
|
/// Sucht eine lokalisierte Zeichenfolge, die Abschluss ähnelt.
|
||||||
/// </summary>
|
/// </summary>
|
||||||
@@ -142,7 +160,25 @@ namespace CampusAppWP8.Resources {
|
|||||||
}
|
}
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Sucht eine lokalisierte Zeichenfolge, die Vorlesungsname ähnelt.
|
/// Sucht eine lokalisierte Zeichenfolge, die Lehrstuhl ähnelt.
|
||||||
|
/// </summary>
|
||||||
|
public static string LectureApp_Department {
|
||||||
|
get {
|
||||||
|
return ResourceManager.GetString("LectureApp_Department", resourceCulture);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Sucht eine lokalisierte Zeichenfolge, die Vorlesungen - Details ähnelt.
|
||||||
|
/// </summary>
|
||||||
|
public static string LectureApp_DetailsHeader {
|
||||||
|
get {
|
||||||
|
return ResourceManager.GetString("LectureApp_DetailsHeader", resourceCulture);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Sucht eine lokalisierte Zeichenfolge, die Veranstaltungsname ähnelt.
|
||||||
/// </summary>
|
/// </summary>
|
||||||
public static string LectureApp_LectureName {
|
public static string LectureApp_LectureName {
|
||||||
get {
|
get {
|
||||||
@@ -150,6 +186,24 @@ namespace CampusAppWP8.Resources {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Sucht eine lokalisierte Zeichenfolge, die Lehrinhalt ähnelt.
|
||||||
|
/// </summary>
|
||||||
|
public static string LectureApp_LectureTopic {
|
||||||
|
get {
|
||||||
|
return ResourceManager.GetString("LectureApp_LectureTopic", resourceCulture);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Sucht eine lokalisierte Zeichenfolge, die Verantwortlicher ähnelt.
|
||||||
|
/// </summary>
|
||||||
|
public static string LectureApp_Officer {
|
||||||
|
get {
|
||||||
|
return ResourceManager.GetString("LectureApp_Officer", resourceCulture);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Sucht eine lokalisierte Zeichenfolge, die Semester ähnelt.
|
/// Sucht eine lokalisierte Zeichenfolge, die Semester ähnelt.
|
||||||
/// </summary>
|
/// </summary>
|
||||||
@@ -169,7 +223,7 @@ namespace CampusAppWP8.Resources {
|
|||||||
}
|
}
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Sucht eine lokalisierte Zeichenfolge, die Vorlesung ähnelt.
|
/// Sucht eine lokalisierte Zeichenfolge, die Vorlesungen ähnelt.
|
||||||
/// </summary>
|
/// </summary>
|
||||||
public static string LectureApp_Title {
|
public static string LectureApp_Title {
|
||||||
get {
|
get {
|
||||||
@@ -177,6 +231,15 @@ namespace CampusAppWP8.Resources {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Sucht eine lokalisierte Zeichenfolge, die Veranstaltungsart ähnelt.
|
||||||
|
/// </summary>
|
||||||
|
public static string LectureApp_Type {
|
||||||
|
get {
|
||||||
|
return ResourceManager.GetString("LectureApp_Type", resourceCulture);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Sucht eine lokalisierte Zeichenfolge, die Links ähnelt.
|
/// Sucht eine lokalisierte Zeichenfolge, die Links ähnelt.
|
||||||
/// </summary>
|
/// </summary>
|
||||||
@@ -249,6 +312,15 @@ namespace CampusAppWP8.Resources {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Sucht eine lokalisierte Zeichenfolge, die 84 ähnelt.
|
||||||
|
/// </summary>
|
||||||
|
public static string MensaApp_DinnerLabelW {
|
||||||
|
get {
|
||||||
|
return ResourceManager.GetString("MensaApp_DinnerLabelW", resourceCulture);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Sucht eine lokalisierte Zeichenfolge, die Heute nicht im Angbot ähnelt.
|
/// Sucht eine lokalisierte Zeichenfolge, die Heute nicht im Angbot ähnelt.
|
||||||
/// </summary>
|
/// </summary>
|
||||||
@@ -285,6 +357,15 @@ namespace CampusAppWP8.Resources {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Sucht eine lokalisierte Zeichenfolge, die Link ähnelt.
|
||||||
|
/// </summary>
|
||||||
|
public static string NewsLinkBtn {
|
||||||
|
get {
|
||||||
|
return ResourceManager.GetString("NewsLinkBtn", resourceCulture);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Sucht eine lokalisierte Zeichenfolge, die Öffnungszeiten ähnelt.
|
/// Sucht eine lokalisierte Zeichenfolge, die Öffnungszeiten ähnelt.
|
||||||
/// </summary>
|
/// </summary>
|
||||||
@@ -303,6 +384,15 @@ namespace CampusAppWP8.Resources {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Sucht eine lokalisierte Zeichenfolge, die Lehrstühle ähnelt.
|
||||||
|
/// </summary>
|
||||||
|
public static string Professorship_chairs {
|
||||||
|
get {
|
||||||
|
return ResourceManager.GetString("Professorship_chairs", resourceCulture);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Sucht eine lokalisierte Zeichenfolge, die LeftToRight ähnelt.
|
/// Sucht eine lokalisierte Zeichenfolge, die LeftToRight ähnelt.
|
||||||
/// </summary>
|
/// </summary>
|
||||||
|
|||||||
@@ -153,7 +153,7 @@
|
|||||||
<value>Hausaufgaben</value>
|
<value>Hausaufgaben</value>
|
||||||
</data>
|
</data>
|
||||||
<data name="LectureApp_Title" xml:space="preserve">
|
<data name="LectureApp_Title" xml:space="preserve">
|
||||||
<value>Vorlesung</value>
|
<value>Vorlesungen</value>
|
||||||
</data>
|
</data>
|
||||||
<data name="LinkApp_Title" xml:space="preserve">
|
<data name="LinkApp_Title" xml:space="preserve">
|
||||||
<value>Links</value>
|
<value>Links</value>
|
||||||
@@ -183,7 +183,7 @@
|
|||||||
<value>Abschluss</value>
|
<value>Abschluss</value>
|
||||||
</data>
|
</data>
|
||||||
<data name="LectureApp_LectureName" xml:space="preserve">
|
<data name="LectureApp_LectureName" xml:space="preserve">
|
||||||
<value>Vorlesungsname</value>
|
<value>Veranstaltungsname</value>
|
||||||
</data>
|
</data>
|
||||||
<data name="LectureApp_Semester" xml:space="preserve">
|
<data name="LectureApp_Semester" xml:space="preserve">
|
||||||
<value>Semester</value>
|
<value>Semester</value>
|
||||||
@@ -226,8 +226,39 @@
|
|||||||
</data>
|
</data>
|
||||||
<data name="MensaApp_NotToday" xml:space="preserve">
|
<data name="MensaApp_NotToday" xml:space="preserve">
|
||||||
<value>Heute nicht im Angbot</value>
|
<value>Heute nicht im Angbot</value>
|
||||||
</data>
|
</data>
|
||||||
<data name="NewsHomeBtn" xml:space="preserve">
|
<data name="NewsHomeBtn" xml:space="preserve">
|
||||||
<value>zur Übersicht</value>
|
<value>zur Übersicht</value>
|
||||||
</data>
|
</data>
|
||||||
|
|
||||||
|
<data name="MensaApp_DinnerLabelW" xml:space="preserve">
|
||||||
|
<value>84</value>
|
||||||
|
</data>
|
||||||
|
<data name="LectureApp_Courses" xml:space="preserve">
|
||||||
|
<value>Studiengänge</value>
|
||||||
|
</data>
|
||||||
|
<data name="LectureApp_Department" xml:space="preserve">
|
||||||
|
<value>Lehrstuhl</value>
|
||||||
|
</data>
|
||||||
|
<data name="LectureApp_DetailsHeader" xml:space="preserve">
|
||||||
|
<value>Vorlesungen - Details</value>
|
||||||
|
</data>
|
||||||
|
<data name="LectureApp_LectureTopic" xml:space="preserve">
|
||||||
|
<value>Lehrinhalt</value>
|
||||||
|
</data>
|
||||||
|
<data name="LectureApp_Officer" xml:space="preserve">
|
||||||
|
<value>Verantwortlicher</value>
|
||||||
|
</data>
|
||||||
|
<data name="LectureApp_Type" xml:space="preserve">
|
||||||
|
<value>Veranstaltungsart</value>
|
||||||
|
</data>
|
||||||
|
<data name="Faculty" xml:space="preserve">
|
||||||
|
<value>Fakultät</value>
|
||||||
|
</data>
|
||||||
|
<data name="Professorship_chairs" xml:space="preserve">
|
||||||
|
<value>Lehrstühle</value>
|
||||||
|
</data>
|
||||||
|
<data name="NewsLinkBtn" xml:space="preserve">
|
||||||
|
<value>Link</value>
|
||||||
|
</data>
|
||||||
</root>
|
</root>
|
||||||
@@ -60,6 +60,78 @@ namespace CampusAppWP8.Resources {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Sucht eine lokalisierte Zeichenfolge, die LectureModel ähnelt.
|
||||||
|
/// </summary>
|
||||||
|
internal static string IsolatedStorageLectureModel {
|
||||||
|
get {
|
||||||
|
return ResourceManager.GetString("IsolatedStorageLectureModel", resourceCulture);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Sucht eine lokalisierte Zeichenfolge, die ActivityId ähnelt.
|
||||||
|
/// </summary>
|
||||||
|
internal static string ParamLectureActivityId {
|
||||||
|
get {
|
||||||
|
return ResourceManager.GetString("ParamLectureActivityId", resourceCulture);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Sucht eine lokalisierte Zeichenfolge, die ModulNumber ähnelt.
|
||||||
|
/// </summary>
|
||||||
|
internal static string ParamLectureModulNumber {
|
||||||
|
get {
|
||||||
|
return ResourceManager.GetString("ParamLectureModulNumber", resourceCulture);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Sucht eine lokalisierte Zeichenfolge, die ? ähnelt.
|
||||||
|
/// </summary>
|
||||||
|
internal static string Paramseparator {
|
||||||
|
get {
|
||||||
|
return ResourceManager.GetString("Paramseparator", resourceCulture);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Sucht eine lokalisierte Zeichenfolge, die Url ähnelt.
|
||||||
|
/// </summary>
|
||||||
|
internal static string ParamUrl {
|
||||||
|
get {
|
||||||
|
return ResourceManager.GetString("ParamUrl", resourceCulture);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Sucht eine lokalisierte Zeichenfolge, die /Pages/Lecture/ModulWebPage.xaml ähnelt.
|
||||||
|
/// </summary>
|
||||||
|
internal static string PathLectureModulWebPage {
|
||||||
|
get {
|
||||||
|
return ResourceManager.GetString("PathLectureModulWebPage", resourceCulture);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Sucht eine lokalisierte Zeichenfolge, die /Pages/Lecture/ResultDetailPage.xaml ähnelt.
|
||||||
|
/// </summary>
|
||||||
|
internal static string PathResultDetailWebPage {
|
||||||
|
get {
|
||||||
|
return ResourceManager.GetString("PathResultDetailWebPage", resourceCulture);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Sucht eine lokalisierte Zeichenfolge, die https://www.tu-cottbus.de/modul/ ähnelt.
|
||||||
|
/// </summary>
|
||||||
|
internal static string UrlLectureModulBaseAddr {
|
||||||
|
get {
|
||||||
|
return ResourceManager.GetString("UrlLectureModulBaseAddr", resourceCulture);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Sucht eine lokalisierte Zeichenfolge, die root ähnelt.
|
/// Sucht eine lokalisierte Zeichenfolge, die root ähnelt.
|
||||||
/// </summary>
|
/// </summary>
|
||||||
|
|||||||
@@ -117,6 +117,30 @@
|
|||||||
<resheader name="writer">
|
<resheader name="writer">
|
||||||
<value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
|
<value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
|
||||||
</resheader>
|
</resheader>
|
||||||
|
<data name="IsolatedStorageLectureModel" xml:space="preserve">
|
||||||
|
<value>LectureModel</value>
|
||||||
|
</data>
|
||||||
|
<data name="ParamLectureActivityId" xml:space="preserve">
|
||||||
|
<value>ActivityId</value>
|
||||||
|
</data>
|
||||||
|
<data name="ParamLectureModulNumber" xml:space="preserve">
|
||||||
|
<value>ModulNumber</value>
|
||||||
|
</data>
|
||||||
|
<data name="Paramseparator" xml:space="preserve">
|
||||||
|
<value>?</value>
|
||||||
|
</data>
|
||||||
|
<data name="ParamUrl" xml:space="preserve">
|
||||||
|
<value>Url</value>
|
||||||
|
</data>
|
||||||
|
<data name="PathLectureModulWebPage" xml:space="preserve">
|
||||||
|
<value>/Pages/Lecture/ModulWebPage.xaml</value>
|
||||||
|
</data>
|
||||||
|
<data name="PathResultDetailWebPage" xml:space="preserve">
|
||||||
|
<value>/Pages/Lecture/ResultDetailPage.xaml</value>
|
||||||
|
</data>
|
||||||
|
<data name="UrlLectureModulBaseAddr" xml:space="preserve">
|
||||||
|
<value>https://www.tu-cottbus.de/modul/</value>
|
||||||
|
</data>
|
||||||
<data name="XMLRootElementName" xml:space="preserve">
|
<data name="XMLRootElementName" xml:space="preserve">
|
||||||
<value>root</value>
|
<value>root</value>
|
||||||
</data>
|
</data>
|
||||||
|
|||||||
181
CampusAppWP8/CampusAppWP8/Utility/RestApi.cs
Normal file
@@ -0,0 +1,181 @@
|
|||||||
|
//-----------------------------------------------------------------------
|
||||||
|
// <copyright file="RestApi.cs" company="BTU/IIT">
|
||||||
|
// Company copyright tag.
|
||||||
|
// </copyright>
|
||||||
|
// <author>stubbfel</author>
|
||||||
|
// <sience>10.06.2013</sience>
|
||||||
|
//----------------------------------------------------------------------using System;
|
||||||
|
namespace CampusAppWP8.Utility
|
||||||
|
{
|
||||||
|
using System;
|
||||||
|
using System.Net;
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Class realize the access of restful RestAPI
|
||||||
|
/// </summary>
|
||||||
|
public abstract class RestApi
|
||||||
|
{
|
||||||
|
#region Members
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// the WebClient, which send the requests
|
||||||
|
/// </summary>
|
||||||
|
private WebClient client;
|
||||||
|
|
||||||
|
#endregion
|
||||||
|
|
||||||
|
#region Constructor
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Initializes a new instance of the <see cref="RestApi" /> class.
|
||||||
|
/// </summary>
|
||||||
|
public RestApi()
|
||||||
|
{
|
||||||
|
this.client = new WebClient();
|
||||||
|
}
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Initializes a new instance of the <see cref="RestApi" /> class.
|
||||||
|
/// </summary>
|
||||||
|
/// <param name="apiBaseAddress">the url of the RestAPI base address</param>
|
||||||
|
public RestApi(Uri apiBaseAddress)
|
||||||
|
{
|
||||||
|
this.client = new WebClient();
|
||||||
|
this.client.BaseAddress = apiBaseAddress.AbsoluteUri;
|
||||||
|
}
|
||||||
|
|
||||||
|
#endregion
|
||||||
|
|
||||||
|
#region Methods
|
||||||
|
#region public
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Method realize the http-get-method resource
|
||||||
|
/// </summary>
|
||||||
|
/// <param name="url">Url of the resource</param>
|
||||||
|
/// <param name="action">callback method</param>
|
||||||
|
public void HttpGet(Uri url, Action<object, DownloadStringCompletedEventArgs> action)
|
||||||
|
{
|
||||||
|
this.client.DownloadStringCompleted += new DownloadStringCompletedEventHandler(action);
|
||||||
|
this.client.DownloadStringAsync(url);
|
||||||
|
}
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Method realize the http-delete-method
|
||||||
|
/// </summary>
|
||||||
|
/// <remarks>
|
||||||
|
/// is not supported by WebClient
|
||||||
|
/// </remarks>
|
||||||
|
/// <param name="url">Url of the resource</param>
|
||||||
|
/// <param name="action">callback method</param>
|
||||||
|
public void HttpDelete(Uri url, Action<object, DownloadStringCompletedEventArgs> action)
|
||||||
|
{
|
||||||
|
throw new NotSupportedException();
|
||||||
|
}
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Method realize the http-delete-method
|
||||||
|
/// </summary>
|
||||||
|
/// <remarks>
|
||||||
|
/// is not supported by WebClient
|
||||||
|
/// </remarks>
|
||||||
|
/// <param name="url">Url of the resource</param>
|
||||||
|
/// <param name="action">callback method</param>
|
||||||
|
public void HttpHead(Uri url, Action<object, DownloadStringCompletedEventArgs> action)
|
||||||
|
{
|
||||||
|
throw new NotSupportedException();
|
||||||
|
}
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Method realize the http-delete-method
|
||||||
|
/// </summary>
|
||||||
|
/// <remarks>
|
||||||
|
/// is not supported by WebClient
|
||||||
|
/// </remarks>
|
||||||
|
/// <param name="url">Url of the resource</param>
|
||||||
|
/// <param name="action">callback method</param>
|
||||||
|
public void HttpOptions(Uri url, Action<object, DownloadStringCompletedEventArgs> action)
|
||||||
|
{
|
||||||
|
throw new NotSupportedException();
|
||||||
|
}
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Method realize the http-delete-method
|
||||||
|
/// </summary>
|
||||||
|
/// <remarks>
|
||||||
|
/// is not supported by WebClient
|
||||||
|
/// </remarks>
|
||||||
|
/// <param name="url">Url of the resource</param>
|
||||||
|
/// <param name="action">callback method</param>
|
||||||
|
public void HttpConnect(Uri url, Action<object, DownloadStringCompletedEventArgs> action)
|
||||||
|
{
|
||||||
|
throw new NotSupportedException();
|
||||||
|
}
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Method realize the http-delete-method
|
||||||
|
/// </summary>
|
||||||
|
/// <remarks>
|
||||||
|
/// is not supported by WebClient
|
||||||
|
/// </remarks>
|
||||||
|
/// <param name="url">Url of the resource</param>
|
||||||
|
/// <param name="action">callback method</param>
|
||||||
|
public void HttpTrace(Uri url, Action<object, DownloadStringCompletedEventArgs> action)
|
||||||
|
{
|
||||||
|
throw new NotSupportedException();
|
||||||
|
}
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Method realize the http-post-method
|
||||||
|
/// </summary>
|
||||||
|
/// <param name="url">Url of the resource</param>
|
||||||
|
/// <param name="action">callback method</param>
|
||||||
|
/// <param name="postData">Data which are sending via post to the RestAPI</param>
|
||||||
|
public void HttpPost(Uri url, Action<object, UploadStringCompletedEventArgs> action, string postData)
|
||||||
|
{
|
||||||
|
this.UploadData(url, action, "POST", postData);
|
||||||
|
}
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Method realize the http-get-method
|
||||||
|
/// </summary>
|
||||||
|
/// <param name="url">Url of the resource</param>
|
||||||
|
/// <param name="action">callback method</param>
|
||||||
|
/// <param name="putData">Data which are sending via put to the RestAPI</param>
|
||||||
|
public void HttpPut(Uri url, Action<object, UploadStringCompletedEventArgs> action, string putData)
|
||||||
|
{
|
||||||
|
this.UploadData(url, action, "PUT", putData);
|
||||||
|
}
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Method realize the http-get-method
|
||||||
|
/// </summary>
|
||||||
|
/// <param name="url">Url of the resource</param>
|
||||||
|
/// <param name="action">callback method</param>
|
||||||
|
/// <param name="patchData">Data which are sending via patch to the RestAPI</param>
|
||||||
|
public void HttpPatch(Uri url, Action<object, UploadStringCompletedEventArgs> action, string patchData)
|
||||||
|
{
|
||||||
|
this.UploadData(url, action, "PATCH", patchData);
|
||||||
|
}
|
||||||
|
|
||||||
|
#endregion
|
||||||
|
|
||||||
|
#region private
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Method uploaded Data to the RestAPI
|
||||||
|
/// </summary>
|
||||||
|
/// <param name="url">Url of the resource</param>
|
||||||
|
/// <param name="action">callback method</param>
|
||||||
|
/// <param name="method">name of APIMethod, how the data will be uploaded</param>
|
||||||
|
/// <param name="data">Data which are sending to the RestAPI</param>
|
||||||
|
private void UploadData(Uri url, Action<object, UploadStringCompletedEventArgs> action, string method, string data)
|
||||||
|
{
|
||||||
|
this.client.UploadStringCompleted += new UploadStringCompletedEventHandler(action);
|
||||||
|
this.client.UploadStringAsync(url, method, data);
|
||||||
|
}
|
||||||
|
#endregion
|
||||||
|
|
||||||
|
#endregion
|
||||||
|
}
|
||||||
|
}
|
||||||
40
CampusAppWP8/CampusAppWP8/Utility/StringManager.cs
Normal file
@@ -0,0 +1,40 @@
|
|||||||
|
//-----------------------------------------------------------------------
|
||||||
|
// <copyright file="StringManager.cs" company="BTU/IIT">
|
||||||
|
// Company copyright tag.
|
||||||
|
// </copyright>
|
||||||
|
// <author>stubbfel</author>
|
||||||
|
// <sience>06.06.2013</sience>
|
||||||
|
//----------------------------------------------------------------------
|
||||||
|
namespace CampusAppWP8.Utility
|
||||||
|
{
|
||||||
|
using System.Text.RegularExpressions;
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Class provides some special StringMethods
|
||||||
|
/// </summary>
|
||||||
|
public static class StringManager
|
||||||
|
{
|
||||||
|
#region Members
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Patter for Html-Tags
|
||||||
|
/// </summary>
|
||||||
|
private static readonly string HtmlTagPattern = "<.*?>";
|
||||||
|
|
||||||
|
#endregion
|
||||||
|
|
||||||
|
#region Methods
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Method removes Html-Tag of a String
|
||||||
|
/// </summary>
|
||||||
|
/// <param name="inputString">String with Html-Tags</param>
|
||||||
|
/// <returns>String without Html-Tags</returns>
|
||||||
|
public static string StripHTML(string inputString)
|
||||||
|
{
|
||||||
|
return Regex.Replace(inputString, HtmlTagPattern, string.Empty);
|
||||||
|
}
|
||||||
|
|
||||||
|
#endregion
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -1,37 +0,0 @@
|
|||||||
using System;
|
|
||||||
using System.Collections.Generic;
|
|
||||||
using System.Linq;
|
|
||||||
using System.Text;
|
|
||||||
|
|
||||||
namespace CampusAppWP8.Model.departments
|
|
||||||
{
|
|
||||||
public class ChairModel : BaseModel
|
|
||||||
{
|
|
||||||
private string _name;
|
|
||||||
|
|
||||||
public ChairModel()
|
|
||||||
{
|
|
||||||
_name = String.Empty;
|
|
||||||
}
|
|
||||||
public ChairModel(string name)
|
|
||||||
{
|
|
||||||
_name = name;
|
|
||||||
}
|
|
||||||
|
|
||||||
public string Name
|
|
||||||
{
|
|
||||||
get
|
|
||||||
{
|
|
||||||
return _name;
|
|
||||||
}
|
|
||||||
set
|
|
||||||
{
|
|
||||||
if (value != _name)
|
|
||||||
{
|
|
||||||
_name = value;
|
|
||||||
NotifyPropertyChanged("chair");
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
@@ -1,66 +0,0 @@
|
|||||||
using System;
|
|
||||||
using System.Collections.Generic;
|
|
||||||
using System.Collections.ObjectModel;
|
|
||||||
using System.Linq;
|
|
||||||
using System.Text;
|
|
||||||
|
|
||||||
namespace CampusAppWP8.Model.departments
|
|
||||||
{
|
|
||||||
public class FacultyModel : BaseModel
|
|
||||||
{
|
|
||||||
private ObservableCollection<DepartmentModel> _faculties = null;
|
|
||||||
private string _name;
|
|
||||||
public FacultyModel()
|
|
||||||
{
|
|
||||||
this.Faculties = new ObservableCollection<DepartmentModel>();
|
|
||||||
this.LoadData();
|
|
||||||
}
|
|
||||||
|
|
||||||
public FacultyModel(string name)
|
|
||||||
{
|
|
||||||
_name = name;
|
|
||||||
this.Faculties = new ObservableCollection<DepartmentModel>();
|
|
||||||
this.LoadData();
|
|
||||||
}
|
|
||||||
|
|
||||||
public void LoadData()
|
|
||||||
{
|
|
||||||
this.Faculties.Add(new DepartmentModel("Institut 1"));
|
|
||||||
this.Faculties.Add(new DepartmentModel("Institut 2"));
|
|
||||||
this.Faculties.Add(new DepartmentModel("Institut 3"));
|
|
||||||
this.Faculties.Add(new DepartmentModel("Institut 4"));
|
|
||||||
}
|
|
||||||
|
|
||||||
public ObservableCollection<DepartmentModel> Faculties
|
|
||||||
{
|
|
||||||
get
|
|
||||||
{
|
|
||||||
return _faculties;
|
|
||||||
}
|
|
||||||
set
|
|
||||||
{
|
|
||||||
if (value != _faculties)
|
|
||||||
{
|
|
||||||
_faculties = value;
|
|
||||||
NotifyPropertyChanged("faculty");
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
public string Name
|
|
||||||
{
|
|
||||||
get
|
|
||||||
{
|
|
||||||
return _name;
|
|
||||||
}
|
|
||||||
set
|
|
||||||
{
|
|
||||||
if (value != _name)
|
|
||||||
{
|
|
||||||
_name = value;
|
|
||||||
NotifyPropertyChanged("chair");
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
@@ -10,6 +10,7 @@ namespace CampusAppWP8.Model.Mensa
|
|||||||
using System;
|
using System;
|
||||||
using System.Xml.Serialization;
|
using System.Xml.Serialization;
|
||||||
using CampusAppWP8.Resources;
|
using CampusAppWP8.Resources;
|
||||||
|
using CampusAppWP8.Utility;
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Model for menu
|
/// Model for menu
|
||||||
@@ -48,6 +49,21 @@ namespace CampusAppWP8.Model.Mensa
|
|||||||
/// </summary>
|
/// </summary>
|
||||||
private string action = AppResources.MensaApp_NotToday;
|
private string action = AppResources.MensaApp_NotToday;
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Name of the day
|
||||||
|
/// </summary>
|
||||||
|
private string dayName;
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// DateTime of the day
|
||||||
|
/// </summary>
|
||||||
|
private DateTime date;
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// DateTime of the monday
|
||||||
|
/// </summary>
|
||||||
|
private DateTime monday;
|
||||||
|
|
||||||
#endregion
|
#endregion
|
||||||
|
|
||||||
#region Constructor
|
#region Constructor
|
||||||
@@ -57,6 +73,7 @@ namespace CampusAppWP8.Model.Mensa
|
|||||||
/// </summary>
|
/// </summary>
|
||||||
public MenuModel()
|
public MenuModel()
|
||||||
{
|
{
|
||||||
|
this.monday = MenuWeekModel.CalcFirstWeekDay();
|
||||||
}
|
}
|
||||||
|
|
||||||
#endregion
|
#endregion
|
||||||
@@ -67,7 +84,38 @@ namespace CampusAppWP8.Model.Mensa
|
|||||||
/// Gets or sets the WeekDay
|
/// Gets or sets the WeekDay
|
||||||
/// </summary>
|
/// </summary>
|
||||||
[XmlElement("Wochentag")]
|
[XmlElement("Wochentag")]
|
||||||
public string Day { get; set; }
|
public string Day
|
||||||
|
{
|
||||||
|
get
|
||||||
|
{
|
||||||
|
return this.dayName;
|
||||||
|
}
|
||||||
|
|
||||||
|
set
|
||||||
|
{
|
||||||
|
this.SetValue(value, ref this.dayName);
|
||||||
|
this.CalcDateOfDay();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Gets or sets of Date
|
||||||
|
/// </summary>
|
||||||
|
public DateTime Date
|
||||||
|
{
|
||||||
|
get
|
||||||
|
{
|
||||||
|
return this.date;
|
||||||
|
}
|
||||||
|
|
||||||
|
set
|
||||||
|
{
|
||||||
|
if (value != this.date)
|
||||||
|
{
|
||||||
|
this.date = value;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Gets or sets dinner 1
|
/// Gets or sets dinner 1
|
||||||
@@ -185,7 +233,35 @@ namespace CampusAppWP8.Model.Mensa
|
|||||||
{
|
{
|
||||||
if (value != null && !string.Empty.Equals(value) && !value.Equals(property))
|
if (value != null && !string.Empty.Equals(value) && !value.Equals(property))
|
||||||
{
|
{
|
||||||
property = value;
|
property = StringManager.StripHTML(value);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Method calculate the DateTime of the MenuDay
|
||||||
|
/// </summary>
|
||||||
|
private void CalcDateOfDay()
|
||||||
|
{
|
||||||
|
switch (this.dayName)
|
||||||
|
{
|
||||||
|
case "Montag":
|
||||||
|
this.date = this.monday;
|
||||||
|
break;
|
||||||
|
case "Diensttag":
|
||||||
|
this.date = this.monday.AddDays(1);
|
||||||
|
break;
|
||||||
|
case "Mittwoch":
|
||||||
|
this.date = this.monday.AddDays(2);
|
||||||
|
break;
|
||||||
|
case "Donnerstag":
|
||||||
|
this.date = this.monday.AddDays(3);
|
||||||
|
break;
|
||||||
|
case "Freitag":
|
||||||
|
this.date = this.monday.AddDays(4);
|
||||||
|
break;
|
||||||
|
default:
|
||||||
|
this.date = this.monday;
|
||||||
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
#endregion
|
#endregion
|
||||||
|
|||||||
@@ -17,6 +17,7 @@ namespace CampusAppWP8.Model.Mensa
|
|||||||
[XmlRoot("root")]
|
[XmlRoot("root")]
|
||||||
public class MenuWeekModel
|
public class MenuWeekModel
|
||||||
{
|
{
|
||||||
|
#region Members
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Time when the model was created
|
/// Time when the model was created
|
||||||
/// </summary>
|
/// </summary>
|
||||||
@@ -30,6 +31,10 @@ namespace CampusAppWP8.Model.Mensa
|
|||||||
this.createTime = DateTime.Now;
|
this.createTime = DateTime.Now;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#endregion
|
||||||
|
|
||||||
|
#region Constructor
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Gets or sets the menus for the week
|
/// Gets or sets the menus for the week
|
||||||
/// </summary>
|
/// </summary>
|
||||||
@@ -37,6 +42,9 @@ namespace CampusAppWP8.Model.Mensa
|
|||||||
[XmlArrayItem("Tagesmenu")]
|
[XmlArrayItem("Tagesmenu")]
|
||||||
public ObservableCollection<MenuModel> Menus { get; set; }
|
public ObservableCollection<MenuModel> Menus { get; set; }
|
||||||
|
|
||||||
|
#endregion
|
||||||
|
|
||||||
|
#region Proberty
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Gets the creation time of the model
|
/// Gets the creation time of the model
|
||||||
/// </summary>
|
/// </summary>
|
||||||
@@ -47,5 +55,27 @@ namespace CampusAppWP8.Model.Mensa
|
|||||||
return this.createTime;
|
return this.createTime;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#endregion
|
||||||
|
|
||||||
|
#region Methods
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Method calculate this day of the week, which its gets new menus
|
||||||
|
/// </summary>
|
||||||
|
/// <returns>Date of NewMenuWeekDay</returns>
|
||||||
|
public static DateTime CalcFirstWeekDay()
|
||||||
|
{
|
||||||
|
DateTime now = DateTime.Now;
|
||||||
|
while (now.DayOfWeek != DayOfWeek.Monday)
|
||||||
|
{
|
||||||
|
now = now.Subtract(new TimeSpan(1, 0, 0, 0));
|
||||||
|
}
|
||||||
|
|
||||||
|
DateTime monday = new DateTime(now.Year, now.Month, now.Day);
|
||||||
|
return monday;
|
||||||
|
}
|
||||||
|
|
||||||
|
#endregion
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -44,21 +44,24 @@
|
|||||||
<!-- Row 0 -->
|
<!-- Row 0 -->
|
||||||
<Button Name="TimeTableAppButton" Grid.Row="0" Grid.Column="0" BorderBrush="{x:Null}" Background="{x:Null}" VerticalContentAlignment="Stretch" HorizontalContentAlignment="Stretch" BorderThickness="0" Padding="0">
|
<Button Name="TimeTableAppButton" Grid.Row="0" Grid.Column="0" BorderBrush="{x:Null}" Background="{x:Null}" VerticalContentAlignment="Stretch" HorizontalContentAlignment="Stretch" BorderThickness="0" Padding="0">
|
||||||
<StackPanel Height="auto" Margin="-12,-12,-12,-12">
|
<StackPanel Height="auto" Margin="-12,-12,-12,-12">
|
||||||
<Image Source="/Assets/ApplicationIcon.png" Height="100" />
|
<Image x:Name="ImgDarkTimetable" Source="/Assets/icons/schedule_159_dark.png" Height="100" Visibility="Collapsed"/>
|
||||||
|
<Image x:Name="ImgLightTimetable" Source="/Assets/icons/schedule_159_light.png" Height="100" Visibility="Visible"/>
|
||||||
<TextBlock Text="{Binding Path=LocalizedResources.TimeTableApp_Title, Source={StaticResource LocalizedStrings}}" Height="Auto" VerticalAlignment="Center" HorizontalAlignment="Center" />
|
<TextBlock Text="{Binding Path=LocalizedResources.TimeTableApp_Title, Source={StaticResource LocalizedStrings}}" Height="Auto" VerticalAlignment="Center" HorizontalAlignment="Center" />
|
||||||
</StackPanel>
|
</StackPanel>
|
||||||
</Button>
|
</Button>
|
||||||
|
|
||||||
<Button Name="LectureAppButton" Grid.Row="0" Grid.Column="1" BorderBrush="{x:Null}" Background="{x:Null}" VerticalContentAlignment="Stretch" HorizontalContentAlignment="Stretch" BorderThickness="0" Padding="0">
|
<Button Name="LectureAppButton" Grid.Row="0" Grid.Column="1" BorderBrush="{x:Null}" Background="{x:Null}" VerticalContentAlignment="Stretch" HorizontalContentAlignment="Stretch" BorderThickness="0" Padding="0">
|
||||||
<StackPanel Height="auto" Margin="-12,-12,-12,-12">
|
<StackPanel Height="auto" Margin="-12,-12,-12,-12">
|
||||||
<Image Source="/Assets/ApplicationIcon.png" Height="100" />
|
<Image x:Name="ImgDarkLectures" Source="/Assets/icons/lectures_159_dark.png" Height="100" Visibility="Collapsed"/>
|
||||||
|
<Image x:Name="ImgLightLectures" Source="/Assets/icons/lectures_159_light.png" Height="100" Visibility="Visible"/>
|
||||||
<TextBlock Text="{Binding Path=LocalizedResources.LectureApp_Title, Source={StaticResource LocalizedStrings}}" Height="Auto" VerticalAlignment="Center" HorizontalAlignment="Center" />
|
<TextBlock Text="{Binding Path=LocalizedResources.LectureApp_Title, Source={StaticResource LocalizedStrings}}" Height="Auto" VerticalAlignment="Center" HorizontalAlignment="Center" />
|
||||||
</StackPanel>
|
</StackPanel>
|
||||||
</Button>
|
</Button>
|
||||||
|
|
||||||
<Button Name="NewsAppButton" Grid.Row="0" Grid.Column="2" BorderBrush="{x:Null}" Background="{x:Null}" VerticalContentAlignment="Stretch" HorizontalContentAlignment="Stretch" BorderThickness="0" Padding="0">
|
<Button Name="NewsAppButton" Grid.Row="0" Grid.Column="2" BorderBrush="{x:Null}" Background="{x:Null}" VerticalContentAlignment="Stretch" HorizontalContentAlignment="Stretch" BorderThickness="0" Padding="0">
|
||||||
<StackPanel Height="auto" Margin="-12,-12,-12,-12">
|
<StackPanel Height="auto" Margin="-12,-12,-12,-12">
|
||||||
<Image Source="/Assets/ApplicationIcon.png" Height="100"/>
|
<Image x:Name="ImgDarkNews" Source="/Assets/icons/news_159_dark.png" Height="100" Visibility="Collapsed"/>
|
||||||
|
<Image x:Name="ImgLightNews" Source="/Assets/icons/news_159_light.png" Height="100" Visibility="Visible"/>
|
||||||
<TextBlock Text="{Binding Path=LocalizedResources.NewsApp_Title, Source={StaticResource LocalizedStrings}}" Height="Auto" VerticalAlignment="Center" HorizontalAlignment="Center" />
|
<TextBlock Text="{Binding Path=LocalizedResources.NewsApp_Title, Source={StaticResource LocalizedStrings}}" Height="Auto" VerticalAlignment="Center" HorizontalAlignment="Center" />
|
||||||
</StackPanel>
|
</StackPanel>
|
||||||
</Button>
|
</Button>
|
||||||
@@ -66,21 +69,24 @@
|
|||||||
<!-- Row 1 -->
|
<!-- Row 1 -->
|
||||||
<Button Name="MensaAppButton" Grid.Row="1" Grid.Column="0" BorderBrush="{x:Null}" Background="{x:Null}" VerticalContentAlignment="Stretch" HorizontalContentAlignment="Stretch" BorderThickness="0" Padding="0">
|
<Button Name="MensaAppButton" Grid.Row="1" Grid.Column="0" BorderBrush="{x:Null}" Background="{x:Null}" VerticalContentAlignment="Stretch" HorizontalContentAlignment="Stretch" BorderThickness="0" Padding="0">
|
||||||
<StackPanel Height="auto" Margin="-12,-12,-12,-12">
|
<StackPanel Height="auto" Margin="-12,-12,-12,-12">
|
||||||
<Image Source="/Assets/ApplicationIcon.png" Height="100" />
|
<Image x:Name="ImgDarkMensa" Source="/Assets/icons/mensa_159_dark.png" Height="100" Visibility="Collapsed"/>
|
||||||
|
<Image x:Name="ImgLightMensa" Source="/Assets/icons/mensa_159_light.png" Height="100" Visibility="Visible"/>
|
||||||
<TextBlock Text="{Binding Path=LocalizedResources.MensaApp_Title, Source={StaticResource LocalizedStrings}}" Height="Auto" VerticalAlignment="Center" HorizontalAlignment="Center" />
|
<TextBlock Text="{Binding Path=LocalizedResources.MensaApp_Title, Source={StaticResource LocalizedStrings}}" Height="Auto" VerticalAlignment="Center" HorizontalAlignment="Center" />
|
||||||
</StackPanel>
|
</StackPanel>
|
||||||
</Button>
|
</Button>
|
||||||
|
|
||||||
<Button Name="CampusMapAppButton" Grid.Row="1" Grid.Column="1" BorderBrush="{x:Null}" Background="{x:Null}" VerticalContentAlignment="Stretch" HorizontalContentAlignment="Stretch" BorderThickness="0" Padding="0">
|
<Button Name="CampusMapAppButton" Grid.Row="1" Grid.Column="1" BorderBrush="{x:Null}" Background="{x:Null}" VerticalContentAlignment="Stretch" HorizontalContentAlignment="Stretch" BorderThickness="0" Padding="0">
|
||||||
<StackPanel Height="auto" Margin="-12,-12,-12,-12">
|
<StackPanel Height="auto" Margin="-12,-12,-12,-12">
|
||||||
<Image Source="/Assets/ApplicationIcon.png" Height="100" />
|
<Image x:Name="ImgDarkCampus" Source="/Assets/icons/campus_159_dark.png" Height="100" Visibility="Collapsed"/>
|
||||||
|
<Image x:Name="ImgLightCampus" Source="/Assets/icons/campus_159_light.png" Height="100" Visibility="Visible"/>
|
||||||
<TextBlock Text="{Binding Path=LocalizedResources.CampusMapApp_Title, Source={StaticResource LocalizedStrings}}" Height="Auto" VerticalAlignment="Center" HorizontalAlignment="Center" />
|
<TextBlock Text="{Binding Path=LocalizedResources.CampusMapApp_Title, Source={StaticResource LocalizedStrings}}" Height="Auto" VerticalAlignment="Center" HorizontalAlignment="Center" />
|
||||||
</StackPanel>
|
</StackPanel>
|
||||||
</Button>
|
</Button>
|
||||||
|
|
||||||
<Button Name="HomeworkAppButton" Grid.Row="1" Grid.Column="2" BorderBrush="{x:Null}" Background="{x:Null}" VerticalContentAlignment="Stretch" HorizontalContentAlignment="Stretch" BorderThickness="0" Padding="0">
|
<Button Name="HomeworkAppButton" Grid.Row="1" Grid.Column="2" BorderBrush="{x:Null}" Background="{x:Null}" VerticalContentAlignment="Stretch" HorizontalContentAlignment="Stretch" BorderThickness="0" Padding="0">
|
||||||
<StackPanel Height="auto" Margin="-12,-12,-12,-12">
|
<StackPanel Height="auto" Margin="-12,-12,-12,-12">
|
||||||
<Image Source="/Assets/ApplicationIcon.png" Height="100" />
|
<Image x:Name="ImgDarkHomework" Source="/Assets/icons/homework_159_dark.png" Height="100" Visibility="Collapsed"/>
|
||||||
|
<Image x:Name="ImgLightHomework" Source="/Assets/icons/homework_159_light.png" Height="100" Visibility="Visible"/>
|
||||||
<TextBlock Text="{Binding Path=LocalizedResources.HomeworkApp_Title, Source={StaticResource LocalizedStrings}}" Height="Auto" VerticalAlignment="Center" HorizontalAlignment="Center" />
|
<TextBlock Text="{Binding Path=LocalizedResources.HomeworkApp_Title, Source={StaticResource LocalizedStrings}}" Height="Auto" VerticalAlignment="Center" HorizontalAlignment="Center" />
|
||||||
</StackPanel>
|
</StackPanel>
|
||||||
</Button>
|
</Button>
|
||||||
@@ -88,21 +94,24 @@
|
|||||||
<!-- Row 2 -->
|
<!-- Row 2 -->
|
||||||
<Button Name="DepartmentAppButton" Grid.Row="2" Grid.Column="0" BorderBrush="{x:Null}" Background="{x:Null}" VerticalContentAlignment="Stretch" HorizontalContentAlignment="Stretch" BorderThickness="0" Padding="0">
|
<Button Name="DepartmentAppButton" Grid.Row="2" Grid.Column="0" BorderBrush="{x:Null}" Background="{x:Null}" VerticalContentAlignment="Stretch" HorizontalContentAlignment="Stretch" BorderThickness="0" Padding="0">
|
||||||
<StackPanel Height="auto" Margin="-12,-12,-12,-12">
|
<StackPanel Height="auto" Margin="-12,-12,-12,-12">
|
||||||
<Image Source="/Assets/ApplicationIcon.png" Height="100" />
|
<Image x:Name="ImgDarkDepartments" Source="/Assets/icons/departments_159_dark.png" Height="100" Visibility="Collapsed"/>
|
||||||
|
<Image x:Name="ImgLightDepartments" Source="/Assets/icons/departments_159_light.png" Height="100" Visibility="Visible"/>
|
||||||
<TextBlock Text="{Binding Path=LocalizedResources.DepartmentApp_Title, Source={StaticResource LocalizedStrings}}" Height="Auto" VerticalAlignment="Center" HorizontalAlignment="Center" />
|
<TextBlock Text="{Binding Path=LocalizedResources.DepartmentApp_Title, Source={StaticResource LocalizedStrings}}" Height="Auto" VerticalAlignment="Center" HorizontalAlignment="Center" />
|
||||||
</StackPanel>
|
</StackPanel>
|
||||||
</Button>
|
</Button>
|
||||||
|
|
||||||
<Button Name="EventAppButton" Grid.Row="2" Grid.Column="1" BorderBrush="{x:Null}" Background="{x:Null}" VerticalContentAlignment="Stretch" HorizontalContentAlignment="Stretch" BorderThickness="0" Padding="0">
|
<Button Name="EventAppButton" Grid.Row="2" Grid.Column="1" BorderBrush="{x:Null}" Background="{x:Null}" VerticalContentAlignment="Stretch" HorizontalContentAlignment="Stretch" BorderThickness="0" Padding="0">
|
||||||
<StackPanel Height="auto" Margin="-12,-12,-12,-12">
|
<StackPanel Height="auto" Margin="-12,-12,-12,-12">
|
||||||
<Image Source="/Assets/ApplicationIcon.png" Height="100" />
|
<Image x:Name="ImgDarkEvents" Source="/Assets/icons/news_159_dark.png" Height="100" Visibility="Collapsed"/>
|
||||||
|
<Image x:Name="ImgLightEvents" Source="/Assets/icons/news_159_light.png" Height="100" Visibility="Visible"/>
|
||||||
<TextBlock Text="{Binding Path=LocalizedResources.EventApp_Title, Source={StaticResource LocalizedStrings}}" Height="Auto" VerticalAlignment="Center" HorizontalAlignment="Center" />
|
<TextBlock Text="{Binding Path=LocalizedResources.EventApp_Title, Source={StaticResource LocalizedStrings}}" Height="Auto" VerticalAlignment="Center" HorizontalAlignment="Center" />
|
||||||
</StackPanel>
|
</StackPanel>
|
||||||
</Button>
|
</Button>
|
||||||
|
|
||||||
<Button Name="MailAppButton" Grid.Row="2" Grid.Column="2" BorderBrush="{x:Null}" Background="{x:Null}" VerticalContentAlignment="Stretch" HorizontalContentAlignment="Stretch" BorderThickness="0" Padding="0">
|
<Button Name="MailAppButton" Grid.Row="2" Grid.Column="2" BorderBrush="{x:Null}" Background="{x:Null}" VerticalContentAlignment="Stretch" HorizontalContentAlignment="Stretch" BorderThickness="0" Padding="0">
|
||||||
<StackPanel Height="auto" Margin="-12,-12,-12,-12">
|
<StackPanel Height="auto" Margin="-12,-12,-12,-12">
|
||||||
<Image Source="/Assets/ApplicationIcon.png" Height="100"/>
|
<Image x:Name="ImgDarkWebmail" Source="/Assets/icons/webmail_159_dark.png" Height="100" Visibility="Collapsed"/>
|
||||||
|
<Image x:Name="ImgLightWebmail" Source="/Assets/icons/webmail_159_light.png" Height="100" Visibility="Visible"/>
|
||||||
<TextBlock Text="{Binding Path=LocalizedResources.MailApp_Title, Source={StaticResource LocalizedStrings}}" Height="Auto" VerticalAlignment="Center" HorizontalAlignment="Center" />
|
<TextBlock Text="{Binding Path=LocalizedResources.MailApp_Title, Source={StaticResource LocalizedStrings}}" Height="Auto" VerticalAlignment="Center" HorizontalAlignment="Center" />
|
||||||
</StackPanel>
|
</StackPanel>
|
||||||
</Button>
|
</Button>
|
||||||
@@ -110,21 +119,24 @@
|
|||||||
<!-- Row 3 -->
|
<!-- Row 3 -->
|
||||||
<Button Name="OpenHoursAppButton" Grid.Row="3" Grid.Column="0" BorderBrush="{x:Null}" Background="{x:Null}" VerticalContentAlignment="Stretch" HorizontalContentAlignment="Stretch" BorderThickness="0" Padding="0">
|
<Button Name="OpenHoursAppButton" Grid.Row="3" Grid.Column="0" BorderBrush="{x:Null}" Background="{x:Null}" VerticalContentAlignment="Stretch" HorizontalContentAlignment="Stretch" BorderThickness="0" Padding="0">
|
||||||
<StackPanel Height="auto" Margin="-12,-12,-12,-12">
|
<StackPanel Height="auto" Margin="-12,-12,-12,-12">
|
||||||
<Image Source="/Assets/ApplicationIcon.png" Height="100"/>
|
<Image x:Name="ImgDarkOpenhours" Source="/Assets/icons/openhours_159_dark.png" Height="100" Visibility="Collapsed"/>
|
||||||
|
<Image x:Name="ImgLightOpenhours" Source="/Assets/icons/openhours_159_light.png" Height="100" Visibility="Visible"/>
|
||||||
<TextBlock Text="{Binding Path=LocalizedResources.OpenHoursApp_Title, Source={StaticResource LocalizedStrings}}" Height="Auto" VerticalAlignment="Center" HorizontalAlignment="Center" />
|
<TextBlock Text="{Binding Path=LocalizedResources.OpenHoursApp_Title, Source={StaticResource LocalizedStrings}}" Height="Auto" VerticalAlignment="Center" HorizontalAlignment="Center" />
|
||||||
</StackPanel>
|
</StackPanel>
|
||||||
</Button>
|
</Button>
|
||||||
|
|
||||||
<Button Name="OSAAppButton" Grid.Row="3" Grid.Column="1" BorderBrush="{x:Null}" Background="{x:Null}" VerticalContentAlignment="Stretch" HorizontalContentAlignment="Stretch" BorderThickness="0" Padding="0">
|
<Button Name="OSAAppButton" Grid.Row="3" Grid.Column="1" BorderBrush="{x:Null}" Background="{x:Null}" VerticalContentAlignment="Stretch" HorizontalContentAlignment="Stretch" BorderThickness="0" Padding="0">
|
||||||
<StackPanel Height="auto" Margin="-12,-12,-12,-12">
|
<StackPanel Height="auto" Margin="-12,-12,-12,-12">
|
||||||
<Image Source="/Assets/ApplicationIcon.png" Height="100" />
|
<Image x:Name="ImgDarkStudentcouncil" Source="/Assets/icons/student_council_159_dark.png" Height="100" Visibility="Collapsed"/>
|
||||||
|
<Image x:Name="ImgLightStudentcouncil" Source="/Assets/icons/student_council_159_light.png" Height="100" Visibility="Visible"/>
|
||||||
<TextBlock Text="{Binding Path=LocalizedResources.OSAApp_Title, Source={StaticResource LocalizedStrings}}" Height="Auto" VerticalAlignment="Center" HorizontalAlignment="Center" />
|
<TextBlock Text="{Binding Path=LocalizedResources.OSAApp_Title, Source={StaticResource LocalizedStrings}}" Height="Auto" VerticalAlignment="Center" HorizontalAlignment="Center" />
|
||||||
</StackPanel>
|
</StackPanel>
|
||||||
</Button>
|
</Button>
|
||||||
|
|
||||||
<Button Name="LinkAppButton" Grid.Row="3" Grid.Column="2" BorderBrush="{x:Null}" Background="{x:Null}" VerticalContentAlignment="Stretch" HorizontalContentAlignment="Stretch" BorderThickness="0" Padding="0">
|
<Button Name="LinkAppButton" Grid.Row="3" Grid.Column="2" BorderBrush="{x:Null}" Background="{x:Null}" VerticalContentAlignment="Stretch" HorizontalContentAlignment="Stretch" BorderThickness="0" Padding="0">
|
||||||
<StackPanel Height="auto" Margin="-12,-12,-12,-12">
|
<StackPanel Height="auto" Margin="-12,-12,-12,-12">
|
||||||
<Image Source="/Assets/ApplicationIcon.png" Height="100" />
|
<Image x:Name="ImgDarkLink" Source="/Assets/icons/link_159_dark.png" Height="100" Visibility="Collapsed"/>
|
||||||
|
<Image x:Name="ImgLightLink" Source="/Assets/icons/link_159_light.png" Height="100" Visibility="Visible"/>
|
||||||
<TextBlock Text="{Binding Path=LocalizedResources.LinkApp_Title, Source={StaticResource LocalizedStrings}}" Height="Auto" VerticalAlignment="Center" HorizontalAlignment="Center" />
|
<TextBlock Text="{Binding Path=LocalizedResources.LinkApp_Title, Source={StaticResource LocalizedStrings}}" Height="Auto" VerticalAlignment="Center" HorizontalAlignment="Center" />
|
||||||
</StackPanel>
|
</StackPanel>
|
||||||
</Button>
|
</Button>
|
||||||
|
|||||||
@@ -16,6 +16,9 @@ namespace CampusAppWP8.Pages
|
|||||||
public StartPage()
|
public StartPage()
|
||||||
{
|
{
|
||||||
InitializeComponent();
|
InitializeComponent();
|
||||||
|
|
||||||
|
if ((Visibility)Application.Current.Resources["PhoneDarkThemeVisibility"] == Visibility.Visible)
|
||||||
|
this.SetIconThemeToDark();
|
||||||
}
|
}
|
||||||
|
|
||||||
private void PhoneApplicationPage_OrientationChanged(object sender, OrientationChangedEventArgs e)
|
private void PhoneApplicationPage_OrientationChanged(object sender, OrientationChangedEventArgs e)
|
||||||
@@ -49,5 +52,34 @@ namespace CampusAppWP8.Pages
|
|||||||
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
private void SetIconThemeToDark()
|
||||||
|
{
|
||||||
|
this.ImgLightCampus.Visibility = Visibility.Collapsed;
|
||||||
|
this.ImgLightDepartments.Visibility = Visibility.Collapsed;
|
||||||
|
this.ImgLightEvents.Visibility = Visibility.Collapsed;
|
||||||
|
this.ImgLightHomework.Visibility = Visibility.Collapsed;
|
||||||
|
this.ImgLightLectures.Visibility = Visibility.Collapsed;
|
||||||
|
this.ImgLightLink.Visibility = Visibility.Collapsed;
|
||||||
|
this.ImgLightMensa.Visibility = Visibility.Collapsed;
|
||||||
|
this.ImgLightNews.Visibility = Visibility.Collapsed;
|
||||||
|
this.ImgLightOpenhours.Visibility = Visibility.Collapsed;
|
||||||
|
this.ImgLightStudentcouncil.Visibility = Visibility.Collapsed;
|
||||||
|
this.ImgLightTimetable.Visibility = Visibility.Collapsed;
|
||||||
|
this.ImgLightWebmail.Visibility = Visibility.Collapsed;
|
||||||
|
|
||||||
|
this.ImgDarkCampus.Visibility = Visibility.Visible;
|
||||||
|
this.ImgDarkDepartments.Visibility = Visibility.Visible;
|
||||||
|
this.ImgDarkEvents.Visibility = Visibility.Visible;
|
||||||
|
this.ImgDarkHomework.Visibility = Visibility.Visible;
|
||||||
|
this.ImgDarkLectures.Visibility = Visibility.Visible;
|
||||||
|
this.ImgDarkLink.Visibility = Visibility.Visible;
|
||||||
|
this.ImgDarkMensa.Visibility = Visibility.Visible;
|
||||||
|
this.ImgDarkNews.Visibility = Visibility.Visible;
|
||||||
|
this.ImgDarkOpenhours.Visibility = Visibility.Visible;
|
||||||
|
this.ImgDarkStudentcouncil.Visibility = Visibility.Visible;
|
||||||
|
this.ImgDarkTimetable.Visibility = Visibility.Visible;
|
||||||
|
this.ImgDarkWebmail.Visibility = Visibility.Visible;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -1,24 +0,0 @@
|
|||||||
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;
|
|
||||||
|
|
||||||
namespace CampusAppWP8.Pages.departments
|
|
||||||
{
|
|
||||||
public partial class DepartmentPage : PhoneApplicationPage
|
|
||||||
{
|
|
||||||
public DepartmentPage()
|
|
||||||
{
|
|
||||||
InitializeComponent();
|
|
||||||
}
|
|
||||||
|
|
||||||
private void PhoneApplicationPage_OrientationChanged(object sender, OrientationChangedEventArgs e)
|
|
||||||
{
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
@@ -23,48 +23,113 @@
|
|||||||
</phone:Pivot.HeaderTemplate>
|
</phone:Pivot.HeaderTemplate>
|
||||||
<phone:Pivot.ItemTemplate>
|
<phone:Pivot.ItemTemplate>
|
||||||
<DataTemplate>
|
<DataTemplate>
|
||||||
<Grid>
|
<StackPanel Margin="12,0,12,0">
|
||||||
<Grid.RowDefinitions>
|
<TextBlock Text="{Binding Date, StringFormat='{}{0:dd.MM.yyyy}'}"/>
|
||||||
<RowDefinition Height="auto"/>
|
<ScrollViewer>
|
||||||
<RowDefinition Height="auto"/>
|
<Grid>
|
||||||
<RowDefinition Height="auto"/>
|
<Grid.RowDefinitions>
|
||||||
<RowDefinition Height="auto"/>
|
<RowDefinition Height="*"/>
|
||||||
<RowDefinition Height="auto"/>
|
<RowDefinition Height="*"/>
|
||||||
<RowDefinition Height="auto"/>
|
<RowDefinition Height="*"/>
|
||||||
</Grid.RowDefinitions>
|
<RowDefinition Height="*"/>
|
||||||
<Grid.ColumnDefinitions>
|
<RowDefinition Height="*"/>
|
||||||
<ColumnDefinition Width="auto"/>
|
<RowDefinition Height="*"/>
|
||||||
<ColumnDefinition Width="auto"/>
|
</Grid.RowDefinitions>
|
||||||
<ColumnDefinition Width="*"/>
|
|
||||||
</Grid.ColumnDefinitions>
|
|
||||||
|
|
||||||
<TextBlock Grid.Row="0" Grid.Column="0" Text="{Binding Path=LocalizedResources.MensaApp_Dinner1, Source={StaticResource LocalizedStrings}}" FontWeight="Bold" />
|
<!-- Dinner 1 -->
|
||||||
<TextBlock Grid.Row="0" Grid.Column="1" Text=" : "/>
|
<Border Grid.Row="0" Background="{x:Null}" BorderBrush="{StaticResource PhoneInverseInactiveBrush}" BorderThickness="0,0,0,0" Padding="0,12,0,12">
|
||||||
<TextBlock Grid.Row="0" Grid.Column="2" Text="{Binding Dinner1}" TextWrapping="Wrap"/>
|
<Grid>
|
||||||
|
<Grid.ColumnDefinitions>
|
||||||
|
<ColumnDefinition Width="{Binding Path=LocalizedResources.MensaApp_DinnerLabelW, Source={StaticResource LocalizedStrings}}" />
|
||||||
|
<ColumnDefinition Width="*"/>
|
||||||
|
</Grid.ColumnDefinitions>
|
||||||
|
<StackPanel Grid.Column="0" Orientation="Horizontal">
|
||||||
|
<TextBlock Text="{Binding Path=LocalizedResources.MensaApp_Dinner1, Source={StaticResource LocalizedStrings}}" FontWeight="Bold" />
|
||||||
|
<TextBlock Text=" : "/>
|
||||||
|
</StackPanel>
|
||||||
|
<TextBlock Grid.Column="2" Text="{Binding Dinner1}" TextWrapping="Wrap"/>
|
||||||
|
</Grid>
|
||||||
|
</Border>
|
||||||
|
|
||||||
<TextBlock Grid.Row="1" Grid.Column="0" Text="{Binding Path=LocalizedResources.MensaApp_Dinner2, Source={StaticResource LocalizedStrings}}" FontWeight="Bold"/>
|
<!-- Dinner 2 -->
|
||||||
<TextBlock Grid.Row="1" Grid.Column="1" Text=" : "/>
|
<Border Grid.Row="1" Background="{x:Null}" BorderBrush="{StaticResource PhoneInverseInactiveBrush}" BorderThickness="0,1,0,0" Padding="0,12,0,12">
|
||||||
<TextBlock Grid.Row="1" Grid.Column="2" Text="{Binding Dinner2}" TextWrapping="Wrap"/>
|
<Grid>
|
||||||
|
<Grid.ColumnDefinitions>
|
||||||
|
<ColumnDefinition Width="{Binding Path=LocalizedResources.MensaApp_DinnerLabelW, Source={StaticResource LocalizedStrings}}"/>
|
||||||
|
<ColumnDefinition Width="*"/>
|
||||||
|
</Grid.ColumnDefinitions>
|
||||||
|
<StackPanel Grid.Column="0" Orientation="Horizontal">
|
||||||
|
<TextBlock Text="{Binding Path=LocalizedResources.MensaApp_Dinner2, Source={StaticResource LocalizedStrings}}" FontWeight="Bold" />
|
||||||
|
<TextBlock Text=" : "/>
|
||||||
|
</StackPanel>
|
||||||
|
<TextBlock Grid.Column="2" Text="{Binding Dinner2}" TextWrapping="Wrap"/>
|
||||||
|
</Grid>
|
||||||
|
</Border>
|
||||||
|
|
||||||
<TextBlock Grid.Row="2" Grid.Column="0" Text="{Binding Path=LocalizedResources.MensaApp_Dinner3, Source={StaticResource LocalizedStrings}}" FontWeight="Bold"/>
|
<!-- Dinner 3 -->
|
||||||
<TextBlock Grid.Row="2" Grid.Column="1" Text=" : "/>
|
<Border Grid.Row="2" Background="{x:Null}" BorderBrush="{StaticResource PhoneInverseInactiveBrush}" BorderThickness="0,1,0,0" Padding="0,12,0,12">
|
||||||
<TextBlock Grid.Row="2" Grid.Column="2" Text="{Binding Dinner3}" TextWrapping="Wrap"/>
|
<Grid>
|
||||||
|
<Grid.ColumnDefinitions>
|
||||||
|
<ColumnDefinition Width="{Binding Path=LocalizedResources.MensaApp_DinnerLabelW, Source={StaticResource LocalizedStrings}}"/>
|
||||||
|
<ColumnDefinition Width="*"/>
|
||||||
|
</Grid.ColumnDefinitions>
|
||||||
|
<StackPanel Grid.Column="0" Orientation="Horizontal">
|
||||||
|
<TextBlock Text="{Binding Path=LocalizedResources.MensaApp_Dinner3, Source={StaticResource LocalizedStrings}}" FontWeight="Bold" />
|
||||||
|
<TextBlock Text=" : "/>
|
||||||
|
</StackPanel>
|
||||||
|
<TextBlock Grid.Column="2" Text="{Binding Dinner3}" TextWrapping="Wrap"/>
|
||||||
|
</Grid>
|
||||||
|
</Border>
|
||||||
|
|
||||||
<TextBlock Grid.Row="3" Grid.Column="0" Text="{Binding Path=LocalizedResources.MensaApp_Dinner4, Source={StaticResource LocalizedStrings}}" FontWeight="Bold"/>
|
<!-- Dinner 4 -->
|
||||||
<TextBlock Grid.Row="3" Grid.Column="1" Text=" : "/>
|
<Border Grid.Row="3" Background="{x:Null}" BorderBrush="{StaticResource PhoneInverseInactiveBrush}" BorderThickness="0,1,0,0" Padding="0,12,0,12">
|
||||||
<TextBlock Grid.Row="3" Grid.Column="2" Text="{Binding Dinner4}" TextWrapping="Wrap"/>
|
<Grid>
|
||||||
|
<Grid.ColumnDefinitions>
|
||||||
|
<ColumnDefinition Width="{Binding Path=LocalizedResources.MensaApp_DinnerLabelW, Source={StaticResource LocalizedStrings}}"/>
|
||||||
|
<ColumnDefinition Width="*"/>
|
||||||
|
</Grid.ColumnDefinitions>
|
||||||
|
<StackPanel Grid.Column="0" Orientation="Horizontal">
|
||||||
|
<TextBlock Text="{Binding Path=LocalizedResources.MensaApp_Dinner4, Source={StaticResource LocalizedStrings}}" FontWeight="Bold" />
|
||||||
|
<TextBlock Text=" : "/>
|
||||||
|
</StackPanel>
|
||||||
|
<TextBlock Grid.Column="2" Text="{Binding Dinner4}" TextWrapping="Wrap"/>
|
||||||
|
</Grid>
|
||||||
|
</Border>
|
||||||
|
|
||||||
<TextBlock Grid.Row="4" Grid.Column="0" Text="{Binding Path=LocalizedResources.MensaApp_Bio, Source={StaticResource LocalizedStrings}}" FontWeight="Bold"/>
|
<!-- Bio-->
|
||||||
<TextBlock Grid.Row="4" Grid.Column="1" Text=" : "/>
|
<Border Grid.Row="4" Background="{x:Null}" BorderBrush="{StaticResource PhoneInverseInactiveBrush}" BorderThickness="0,1,0,0" Padding="0,12,0,12">
|
||||||
<TextBlock Grid.Row="4" Grid.Column="2" Text="{Binding Bio}" TextWrapping="Wrap"/>
|
<Grid>
|
||||||
|
<Grid.ColumnDefinitions>
|
||||||
|
<ColumnDefinition Width="{Binding Path=LocalizedResources.MensaApp_DinnerLabelW, Source={StaticResource LocalizedStrings}}"/>
|
||||||
|
<ColumnDefinition Width="*"/>
|
||||||
|
</Grid.ColumnDefinitions>
|
||||||
|
<StackPanel Grid.Column="0" Orientation="Horizontal">
|
||||||
|
<TextBlock Text="{Binding Path=LocalizedResources.MensaApp_Bio, Source={StaticResource LocalizedStrings}}" FontWeight="Bold" />
|
||||||
|
<TextBlock Text=" : "/>
|
||||||
|
</StackPanel>
|
||||||
|
<TextBlock Grid.Column="1" Text="{Binding Bio}" TextWrapping="Wrap"/>
|
||||||
|
</Grid>
|
||||||
|
</Border>
|
||||||
|
|
||||||
<TextBlock Grid.Row="5" Grid.Column="0" Text="{Binding Path=LocalizedResources.MensaApp_Action, Source={StaticResource LocalizedStrings}}" FontWeight="Bold"/>
|
<Border Grid.Row="5" Background="{x:Null}" BorderBrush="{StaticResource PhoneInverseInactiveBrush}" BorderThickness="0,1,0,0" Padding="0,12,0,12">
|
||||||
<TextBlock Grid.Row="5" Grid.Column="1" Text=" : "/>
|
<Grid>
|
||||||
<TextBlock Grid.Row="5" Grid.Column="2" Text="{Binding Action}" TextWrapping="Wrap"/>
|
<Grid.ColumnDefinitions>
|
||||||
|
<ColumnDefinition Width="{Binding Path=LocalizedResources.MensaApp_DinnerLabelW, Source={StaticResource LocalizedStrings}}"/>
|
||||||
</Grid>
|
<ColumnDefinition Width="*"/>
|
||||||
|
</Grid.ColumnDefinitions>
|
||||||
|
<StackPanel Grid.Column="0" Orientation="Horizontal">
|
||||||
|
<TextBlock Text="{Binding Path=LocalizedResources.MensaApp_Action, Source={StaticResource LocalizedStrings}}" FontWeight="Bold" />
|
||||||
|
<TextBlock Text=" : "/>
|
||||||
|
</StackPanel>
|
||||||
|
<TextBlock Grid.Column="2" Text="{Binding Action}" TextWrapping="Wrap"/>
|
||||||
|
</Grid>
|
||||||
|
</Border>
|
||||||
|
</Grid>
|
||||||
|
</ScrollViewer>
|
||||||
|
</StackPanel>
|
||||||
</DataTemplate>
|
</DataTemplate>
|
||||||
</phone:Pivot.ItemTemplate>
|
</phone:Pivot.ItemTemplate>
|
||||||
</phone:Pivot>
|
</phone:Pivot>
|
||||||
|
<!-- <Image Source="/Assets/AlignmentGrid.png" VerticalAlignment="Top" Height="800" Width="480" Margin="0,-32,0,0" Grid.Row="0" Grid.RowSpan="2" IsHitTestVisible="False" /> -->
|
||||||
</Grid>
|
</Grid>
|
||||||
</phone:PhoneApplicationPage>
|
</phone:PhoneApplicationPage>
|
||||||
@@ -35,6 +35,7 @@ namespace CampusAppWP8.Pages.Mensa
|
|||||||
private int selectedIndex;
|
private int selectedIndex;
|
||||||
|
|
||||||
#endregion
|
#endregion
|
||||||
|
|
||||||
#region Constructor
|
#region Constructor
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
@@ -95,7 +96,7 @@ namespace CampusAppWP8.Pages.Mensa
|
|||||||
{
|
{
|
||||||
this.MensaPivot.ItemsSource = this.feed.Model.Menus;
|
this.MensaPivot.ItemsSource = this.feed.Model.Menus;
|
||||||
this.MensaPivot.SelectedIndex = this.selectedIndex;
|
this.MensaPivot.SelectedIndex = this.selectedIndex;
|
||||||
}
|
}
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Method calculate which pivot has to be selected
|
/// Method calculate which pivot has to be selected
|
||||||
|
|||||||
@@ -1,47 +0,0 @@
|
|||||||
<phone:PhoneApplicationPage
|
|
||||||
x:Class="CampusAppWP8.Pages.news.NewsPage"
|
|
||||||
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 x:Name="NewsPivot" Title="{Binding Path=LocalizedResources.ApplicationTitle, Source={StaticResource LocalizedStrings}}">
|
|
||||||
<!--Pivotelement eins-->
|
|
||||||
<phone:PivotItem Name="NewsPivotHome" Header="{Binding Path=LocalizedResources.NewsApp_Title, Source={StaticResource LocalizedStrings}}">
|
|
||||||
<ListBox x:Name="ButtonPanel" Grid.Row="1">
|
|
||||||
|
|
||||||
<!-- rows
|
|
||||||
<Button Name="NewsRow01AppButton" Content="Test News Title 01" Click="NewsRow01AppButton_Click" Grid.Row="0" BorderBrush="{x:Null}" Background="{x:Null}" VerticalContentAlignment="Stretch" HorizontalContentAlignment="Stretch" BorderThickness="0" Padding="0">
|
|
||||||
</Button>
|
|
||||||
-->
|
|
||||||
</ListBox>
|
|
||||||
</phone:PivotItem>
|
|
||||||
|
|
||||||
<!--Pivotelement news template
|
|
||||||
<phone:PivotItem Name="NewsPivot01" Header="(timestamp)">
|
|
||||||
<Grid>
|
|
||||||
<Grid.RowDefinitions>
|
|
||||||
<RowDefinition Height="100"/>
|
|
||||||
<RowDefinition Height="*"/>
|
|
||||||
<RowDefinition Height="90"/>
|
|
||||||
</Grid.RowDefinitions>
|
|
||||||
<TextBlock x:Name="NewsHeadline01" Text="(headline)" Grid.Row="0" Height="Auto" TextWrapping="Wrap" VerticalAlignment="Center" HorizontalAlignment="Left" FontSize="42"/>
|
|
||||||
<TextBlock x:Name="NewsText01" Text="(text)" Grid.Row="1" Height="Auto" TextWrapping="Wrap" VerticalAlignment="Center" HorizontalAlignment="Left" FontSize="24" />
|
|
||||||
<Button Name="NewsHome" Content="zur News Übersicht" Click="NewsHome_Click" Grid.Row="2" VerticalAlignment="Bottom" HorizontalAlignment="Left" />
|
|
||||||
</Grid>
|
|
||||||
</phone:PivotItem>
|
|
||||||
-->
|
|
||||||
</phone:Pivot>
|
|
||||||
</Grid>
|
|
||||||
</phone:PhoneApplicationPage>
|
|
||||||
@@ -1,106 +0,0 @@
|
|||||||
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 System.Xml.Linq;
|
|
||||||
using System.Xml;
|
|
||||||
using System.IO;
|
|
||||||
|
|
||||||
namespace CampusAppWP8.Pages.news
|
|
||||||
{
|
|
||||||
public partial class NewsPage : PhoneApplicationPage
|
|
||||||
{
|
|
||||||
List<RSSItem> itemList;
|
|
||||||
|
|
||||||
public NewsPage()
|
|
||||||
{
|
|
||||||
InitializeComponent();
|
|
||||||
}
|
|
||||||
|
|
||||||
//
|
|
||||||
protected override void OnNavigatedTo(NavigationEventArgs e)
|
|
||||||
{
|
|
||||||
this.itemList = new List<RSSItem>();
|
|
||||||
this.itemList.Clear();
|
|
||||||
|
|
||||||
WebClient wc = new WebClient();
|
|
||||||
wc.DownloadStringCompleted += new DownloadStringCompletedEventHandler(WC_DownloadStringCompleted);
|
|
||||||
|
|
||||||
wc.DownloadStringAsync(new Uri("http://www.tu-cottbus.de/oracle-gateway/php/rss2feed_aktuelles.php"));
|
|
||||||
}
|
|
||||||
|
|
||||||
private void WC_DownloadStringCompleted(object sender, DownloadStringCompletedEventArgs e)
|
|
||||||
{
|
|
||||||
if (e.Error != null)
|
|
||||||
return;
|
|
||||||
|
|
||||||
int i = 0;
|
|
||||||
|
|
||||||
XElement xmlitems = XElement.Parse(e.Result);
|
|
||||||
|
|
||||||
List<XElement> elements = xmlitems.Descendants("item").ToList();
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
foreach (XElement rssItem in elements)
|
|
||||||
{
|
|
||||||
if(i < 12)
|
|
||||||
{
|
|
||||||
RSSItem rss = new RSSItem();
|
|
||||||
|
|
||||||
rss.Title = rssItem.Element("title").Value;
|
|
||||||
rss.Text = rssItem.Element("description").Value;
|
|
||||||
rss.Timestamp = rssItem.Element("pubDate").Value;
|
|
||||||
|
|
||||||
this.itemList.Add(rss);
|
|
||||||
|
|
||||||
|
|
||||||
Button btn = new Button();
|
|
||||||
btn.Name = "NewsRowAppButton" + i;
|
|
||||||
btn.Content = rss.Title;
|
|
||||||
btn.BorderBrush = null;
|
|
||||||
btn.Background = null;
|
|
||||||
btn.VerticalContentAlignment = VerticalAlignment.Stretch;
|
|
||||||
btn.HorizontalContentAlignment = HorizontalAlignment.Stretch;
|
|
||||||
btn.BorderThickness = new Thickness(0);
|
|
||||||
btn.Padding = new Thickness(0);
|
|
||||||
btn.Click += NewsRowAppButton_Click;
|
|
||||||
btn.Tag = i;
|
|
||||||
|
|
||||||
PivotItem newPivItem = new PivotItem();
|
|
||||||
newPivItem.Name = "NewsPivot" + i;
|
|
||||||
newPivItem.Header = rss.Date;
|
|
||||||
|
|
||||||
RSSNewsTemplate pvContent = new RSSNewsTemplate();
|
|
||||||
pvContent.NewsHeadline.Text = rss.Title;
|
|
||||||
pvContent.NewsText.Text = rss.Text;
|
|
||||||
pvContent.NewsHome.Click += NewsHome_Click;
|
|
||||||
|
|
||||||
newPivItem.Content = pvContent;
|
|
||||||
NewsPivot.Items.Add(newPivItem);
|
|
||||||
|
|
||||||
ButtonPanel.Items.Add(btn);
|
|
||||||
|
|
||||||
i++;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
// Button Functions
|
|
||||||
private void NewsRowAppButton_Click(object sender, RoutedEventArgs e)
|
|
||||||
{
|
|
||||||
Button btn = (Button)sender;
|
|
||||||
NewsPivot.SelectedIndex = (int)btn.Tag + 1;
|
|
||||||
}
|
|
||||||
|
|
||||||
private void NewsHome_Click(object sender, RoutedEventArgs e)
|
|
||||||
{
|
|
||||||
NewsPivot.SelectedIndex = 0;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
@@ -14,7 +14,7 @@ namespace CampusAppWP8.Utility
|
|||||||
/// This a abstract Class for reading, store and deserialization Feeds from the Web.
|
/// This a abstract Class for reading, store and deserialization Feeds from the Web.
|
||||||
/// </summary>
|
/// </summary>
|
||||||
/// <typeparam name="T">Type for model of the feed</typeparam>
|
/// <typeparam name="T">Type for model of the feed</typeparam>
|
||||||
public abstract class Feed<T>
|
public abstract class Feed<T>:RestApi
|
||||||
{
|
{
|
||||||
#region Member
|
#region Member
|
||||||
|
|
||||||
@@ -174,9 +174,7 @@ namespace CampusAppWP8.Utility
|
|||||||
/// </summary>
|
/// </summary>
|
||||||
private void DownloadFeed()
|
private void DownloadFeed()
|
||||||
{
|
{
|
||||||
WebClient client = new WebClient();
|
this.HttpGet(this.FeedURL, this.DownloadCompleted);
|
||||||
client.DownloadStringCompleted += new DownloadStringCompletedEventHandler(this.DownloadCompleted);
|
|
||||||
client.DownloadStringAsync(this.FeedURL);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
|
|||||||
@@ -17,9 +17,14 @@ namespace CampusAppWP8.Utility
|
|||||||
/// </remarks>
|
/// </remarks>
|
||||||
public static class URLList
|
public static class URLList
|
||||||
{
|
{
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Url for the feed of the mensa
|
/// Url for the feed of the mensa
|
||||||
/// </summary>
|
/// </summary>
|
||||||
public static readonly Uri MensaFeedURL = new Uri("http://www.studentenwerk-frankfurt.de/2011/ClassPackage/App_IKMZ_BTU/", UriKind.Absolute);
|
public static readonly Uri MensaFeedURL = new Uri("http://www.studentenwerk-frankfurt.de/2011/ClassPackage/App_IKMZ_BTU/", UriKind.Absolute);
|
||||||
|
public static Uri DepartmentFeedURL = new Uri("http://www.tu-cottbus.de/campusapp-data/professorships.xml", UriKind.Absolute);
|
||||||
|
public static Uri EventsFeedURL = new Uri("http://www.tu-cottbus.de/oracle-gateway/php/rss2feed_veranstaltungen.php", UriKind.Absolute);
|
||||||
|
public static Uri NewsFeedURL = new Uri("http://www.tu-cottbus.de/oracle-gateway/php/rss2feed_aktuelles.php", UriKind.Absolute);
|
||||||
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -18,6 +18,8 @@ namespace CampusAppWP8.Utility
|
|||||||
/// <typeparam name="T">Type for model of the feed</typeparam>
|
/// <typeparam name="T">Type for model of the feed</typeparam>
|
||||||
public abstract class XmlFeed<T> : Feed<T>
|
public abstract class XmlFeed<T> : Feed<T>
|
||||||
{
|
{
|
||||||
|
protected string validRootName = Constants.XMLRootElementName;
|
||||||
|
|
||||||
#region Constructor
|
#region Constructor
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
@@ -48,10 +50,9 @@ namespace CampusAppWP8.Utility
|
|||||||
{
|
{
|
||||||
XmlSerializer serializer = new XmlSerializer(typeof(T));
|
XmlSerializer serializer = new XmlSerializer(typeof(T));
|
||||||
XDocument document = XDocument.Parse(feedString);
|
XDocument document = XDocument.Parse(feedString);
|
||||||
string validRootName = Constants.XMLRootElementName;
|
if (!document.Root.Name.ToString().Equals(validRootName))
|
||||||
if (!document.Root.Name.Equals(validRootName))
|
|
||||||
{
|
{
|
||||||
XElement content = document.Root;
|
XElement content = document.Root;
|
||||||
document = new XDocument();
|
document = new XDocument();
|
||||||
document.Add(new XElement(validRootName, content));
|
document.Add(new XElement(validRootName, content));
|
||||||
}
|
}
|
||||||
|
|||||||