mv lecture
This commit is contained in:
@@ -18,7 +18,7 @@ namespace CampusAppWP8.Api.Lecture
|
||||
/// <remarks>
|
||||
/// need the XmlAPI
|
||||
/// </remarks>
|
||||
public class LectureApi : XmlModel<LectureList>
|
||||
public class LectureApi : XmlModel<LectureWp8List>
|
||||
{
|
||||
#region Constructor
|
||||
|
||||
|
||||
@@ -97,6 +97,7 @@
|
||||
<Compile Include="Api\GeoApi\PisApi.cs" />
|
||||
<Compile Include="Api\GeoApi\PssApi.cs" />
|
||||
<Compile Include="Api\GeoApi\SpsApi.cs" />
|
||||
<Compile Include="Api\Lecture\LectureApi.cs" />
|
||||
<Compile Include="Api\Person\PersonSearchApi.cs" />
|
||||
<Compile Include="App.xaml.cs">
|
||||
<DependentUpon>App.xaml</DependentUpon>
|
||||
@@ -183,12 +184,8 @@
|
||||
<Compile Include="LocalizedStrings.cs" />
|
||||
<Compile Include="Model\Campusmap\MapModel.cs" />
|
||||
<Compile Include="Model\Campusmap\MapPinModel.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\LectureModule.cs" />
|
||||
<Compile Include="Model\Lecture\LectureWp8Activity.cs" />
|
||||
<Compile Include="Model\Lecture\LectureWp8List.cs" />
|
||||
<Compile Include="Model\Lecture\LecturePageModel.cs" />
|
||||
<Compile Include="Model\MainModel.cs" />
|
||||
<Compile Include="Model\Openinghours\OpeninghoursInstitutionWp8Model.cs" />
|
||||
@@ -197,7 +194,6 @@
|
||||
<Compile Include="Pages\Campusmap\CampusMapPage.xaml.cs">
|
||||
<DependentUpon>CampusMapPage.xaml</DependentUpon>
|
||||
</Compile>
|
||||
<Compile Include="Api\Lecture\LectureApi.cs" />
|
||||
<Compile Include="Feed\Departments\DepartmentFeed.cs" />
|
||||
<Compile Include="Pages\Departments\DepartmentFavoritePage.xaml.cs">
|
||||
<DependentUpon>DepartmentFavoritePage.xaml</DependentUpon>
|
||||
|
||||
@@ -13,11 +13,11 @@ namespace CampusAppWP8.Pages.Lecture
|
||||
using System.Windows.Navigation;
|
||||
using CampusAppWP8.Api.Lecture;
|
||||
using CampusAppWP8.Model.Lecture;
|
||||
using CampusAppWP8.Model.Utility;
|
||||
using CampusAppWP8.Resources;
|
||||
using CampusAppWP8.Utility.Lui.MessageBoxes;
|
||||
using Microsoft.Phone.Controls;
|
||||
using CampusAppWPortalLib8.Model.Utility;
|
||||
using Microsoft.Phone.Controls;
|
||||
|
||||
|
||||
/// <summary>
|
||||
/// Class for the LecturePage
|
||||
@@ -73,7 +73,7 @@ namespace CampusAppWP8.Pages.Lecture
|
||||
{
|
||||
// delete all models
|
||||
App.SaveToIsolatedStorage<LecturePageModel>(Constants.IsolatedStorage_LecturePageModel, null);
|
||||
App.SaveToIsolatedStorage<LectureList>(Constants.IsolatedStorage_LectureModel, null);
|
||||
App.SaveToIsolatedStorage<LectureWp8List>(Constants.IsolatedStorage_LectureModel, null);
|
||||
}
|
||||
else
|
||||
{
|
||||
@@ -207,7 +207,7 @@ namespace CampusAppWP8.Pages.Lecture
|
||||
this.api.Model.FilterByCourseTitle(query);
|
||||
}
|
||||
|
||||
App.SaveToIsolatedStorage<LectureList>(Constants.IsolatedStorage_LectureModel, this.api.Model);
|
||||
App.SaveToIsolatedStorage<LectureWp8List>(Constants.IsolatedStorage_LectureModel, this.api.Model);
|
||||
this.ProgressBar.Visibility = System.Windows.Visibility.Collapsed;
|
||||
Uri url = new Uri(Constants.PathLecture_ResultPage, UriKind.Relative);
|
||||
NavigationService.Navigate(url);
|
||||
|
||||
@@ -40,7 +40,7 @@ namespace CampusAppWP8.Pages.Lecture
|
||||
if (NavigationContext.QueryString.ContainsKey(Constants.ParamModelLecture_ModulNumber))
|
||||
{
|
||||
string number = NavigationContext.QueryString[Constants.ParamModelLecture_ModulNumber];
|
||||
this.WebmailBrowser.Navigate(new Uri(Constants.UrlLecture_ModulBaseAddr + number, UriKind.Absolute));
|
||||
this.WebmailBrowser.Navigate(new Uri(CampusAppWPortalLib8.Resources.Constants.UrlLecture_ModulBaseAddr + number, UriKind.Absolute));
|
||||
}
|
||||
|
||||
base.OnNavigatedTo(e);
|
||||
|
||||
@@ -57,10 +57,10 @@ namespace CampusAppWP8.Pages.Lecture
|
||||
/// <param name="activityId">id of the activity</param>
|
||||
private void LoadActivity(int activityId)
|
||||
{
|
||||
LectureList list = App.LoadFromIsolatedStorage<LectureList>(Constants.IsolatedStorage_LectureModel);
|
||||
LectureWp8List list = App.LoadFromIsolatedStorage<LectureWp8List>(Constants.IsolatedStorage_LectureModel);
|
||||
if (list != null)
|
||||
{
|
||||
LectureActivity activity = list.GetActivity(activityId);
|
||||
LectureWp8Activity activity = list.GetActivity(activityId);
|
||||
activity.CreateLectureString();
|
||||
activity.CreateCourseString();
|
||||
this.ContentPanel.DataContext = activity;
|
||||
@@ -70,6 +70,5 @@ namespace CampusAppWP8.Pages.Lecture
|
||||
#endregion
|
||||
|
||||
#endregion
|
||||
|
||||
}
|
||||
}
|
||||
@@ -42,7 +42,7 @@ namespace CampusAppWP8.Pages.Lecture
|
||||
protected override void OnNavigatedTo(NavigationEventArgs e)
|
||||
{
|
||||
base.OnNavigatedTo(e);
|
||||
LectureList list = App.LoadFromIsolatedStorage<LectureList>(Constants.IsolatedStorage_LectureModel);
|
||||
LectureWp8List list = App.LoadFromIsolatedStorage<LectureWp8List>(Constants.IsolatedStorage_LectureModel);
|
||||
if (list == null)
|
||||
{
|
||||
Uri url = new Uri(Constants.PathLecture_LecturePage, UriKind.Relative);
|
||||
|
||||
@@ -135,9 +135,6 @@
|
||||
<data name="PathLecture_ResultDetailPage" xml:space="preserve">
|
||||
<value>/Pages/Lecture/ResultDetailPage.xaml</value>
|
||||
</data>
|
||||
<data name="UrlLecture_ModulBaseAddr" xml:space="preserve">
|
||||
<value>https://www.tu-cottbus.de/modul/</value>
|
||||
</data>
|
||||
<data name="UrlWebMail_Addr" xml:space="preserve">
|
||||
<value>https://webmail.tu-cottbus.de</value>
|
||||
</data>
|
||||
|
||||
@@ -1221,15 +1221,6 @@ namespace CampusAppWP8.Resources {
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Sucht eine lokalisierte Zeichenfolge, die https://www.tu-cottbus.de/modul/ ähnelt.
|
||||
/// </summary>
|
||||
public static string UrlLecture_ModulBaseAddr {
|
||||
get {
|
||||
return ResourceManager.GetString("UrlLecture_ModulBaseAddr", resourceCulture);
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Sucht eine lokalisierte Zeichenfolge, die http://www.tu-cottbus.de/campusapp-data/getdata.php?db=clubs&app=2&appversion=1 ähnelt.
|
||||
/// </summary>
|
||||
|
||||
@@ -39,6 +39,12 @@
|
||||
<Compile Include="Model\Exams\ExamListModel.cs" />
|
||||
<Compile Include="Model\Exams\ExamModel.cs" />
|
||||
<Compile Include="Model\ForcesTypes.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\LectureModule.cs" />
|
||||
<Compile Include="Model\Link\LinkListModel.cs" />
|
||||
<Compile Include="Model\Link\LinkModel.cs" />
|
||||
<Compile Include="Model\Mensa\MealModel.cs" />
|
||||
|
||||
@@ -5,12 +5,12 @@
|
||||
// <author>stubbfel</author>
|
||||
// <sience>13.06.2013</sience>
|
||||
//----------------------------------------------------------------------
|
||||
namespace CampusAppWP8.Model.Lecture
|
||||
namespace CampusAppWPortalLib8.Model.Lecture
|
||||
{
|
||||
using System.Collections.ObjectModel;
|
||||
using System.Xml.Serialization;
|
||||
using CampusAppWP8.Resources;
|
||||
using CampusAppWP8.Utility;
|
||||
using CampusAppWPortalLib8.Resources;
|
||||
using CampusAppWPortalLib8.Utility;
|
||||
|
||||
/// <summary>
|
||||
/// Model for a Activity
|
||||
@@ -20,19 +20,19 @@ namespace CampusAppWP8.Model.Lecture
|
||||
#region Members
|
||||
|
||||
/// <summary>The activity icon name lecture.</summary>
|
||||
private const string ActivityIconNameLecture = "Vorlesung";
|
||||
public const string ActivityTypeLecture = "Vorlesung";
|
||||
|
||||
/// <summary>The activity icon name seminar.</summary>
|
||||
private const string ActivityIconNameSeminar = "Seminar";
|
||||
public const string ActivityTypeSeminar = "Seminar";
|
||||
|
||||
/// <summary>The activity icon name practice.</summary>
|
||||
private const string ActivityIconNamePract = "Übung";
|
||||
public const string ActivityTypePract = "Übung";
|
||||
|
||||
/// <summary>The activity icon name lab.</summary>
|
||||
private const string ActivityIconNameLab = "Labor";
|
||||
public const string ActivityTypeLab = "Labor";
|
||||
|
||||
/// <summary>The activity icon name exam.</summary>
|
||||
private const string ActivityIconNameExam = "Prüfung";
|
||||
public const string ActivityTypeExam = "Prüfung";
|
||||
|
||||
/// <summary>
|
||||
/// List of lecturer
|
||||
@@ -54,9 +54,6 @@ namespace CampusAppWP8.Model.Lecture
|
||||
/// </summary>
|
||||
private string topic;
|
||||
|
||||
/// <summary>URL of the icon.</summary>
|
||||
private string iconUrl;
|
||||
|
||||
#endregion
|
||||
|
||||
#region Constructor
|
||||
@@ -199,21 +196,10 @@ namespace CampusAppWP8.Model.Lecture
|
||||
{
|
||||
if (value != this.topic)
|
||||
{
|
||||
this.topic = Wp8StringManager.StripAndDecodeHTML(value);
|
||||
this.topic = value;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>Gets URL of the icon.</summary>
|
||||
/// <value>The icon URL.</value>
|
||||
public string IconUrl
|
||||
{
|
||||
get
|
||||
{
|
||||
this.CreateIconUrl();
|
||||
return this.iconUrl;
|
||||
}
|
||||
}
|
||||
#endregion
|
||||
|
||||
#region Methods
|
||||
@@ -228,10 +214,10 @@ namespace CampusAppWP8.Model.Lecture
|
||||
string result = string.Empty;
|
||||
foreach (LectureLecturer tmpLecturer in this.Lecturer)
|
||||
{
|
||||
result += Wp8StringManager.AddNewLine(tmpLecturer.ToString());
|
||||
result += DefaultStringManager.AddNewLine(tmpLecturer.ToString());
|
||||
}
|
||||
|
||||
this.LecturerString = Wp8StringManager.RemoveNewLine(result);
|
||||
this.LecturerString = DefaultStringManager.RemoveNewLine(result);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
@@ -242,46 +228,10 @@ namespace CampusAppWP8.Model.Lecture
|
||||
string result = string.Empty;
|
||||
foreach (LectureCourse course in this.Course)
|
||||
{
|
||||
result += Wp8StringManager.AddNewLine(course.Title);
|
||||
result += DefaultStringManager.AddNewLine(course.Title);
|
||||
}
|
||||
|
||||
this.CourseString = Wp8StringManager.RemoveNewLine(result);
|
||||
}
|
||||
|
||||
#endregion
|
||||
|
||||
#region private
|
||||
|
||||
/// <summary>Creates icon URL.</summary>
|
||||
/// <remarks>Stubbfel, 12.09.2013.</remarks>
|
||||
private void CreateIconUrl()
|
||||
{
|
||||
string typeStr = this.Type;
|
||||
|
||||
if (typeStr.Contains(LectureActivity.ActivityIconNameLecture))
|
||||
{
|
||||
this.iconUrl = Icons.Lecture;
|
||||
}
|
||||
else if (typeStr.Contains(LectureActivity.ActivityIconNameExam))
|
||||
{
|
||||
this.iconUrl = Icons.Exams;
|
||||
}
|
||||
else if (typeStr.Contains(LectureActivity.ActivityIconNamePract))
|
||||
{
|
||||
this.iconUrl = Icons.Practise;
|
||||
}
|
||||
else if (typeStr.Contains(LectureActivity.ActivityIconNameSeminar))
|
||||
{
|
||||
this.iconUrl = Icons.Seminar;
|
||||
}
|
||||
else if (typeStr.Contains(LectureActivity.ActivityIconNameLab))
|
||||
{
|
||||
this.iconUrl = Icons.Lab;
|
||||
}
|
||||
else
|
||||
{
|
||||
this.iconUrl = Icons.Info;
|
||||
}
|
||||
this.CourseString = DefaultStringManager.RemoveNewLine(result);
|
||||
}
|
||||
|
||||
#endregion
|
||||
@@ -4,7 +4,7 @@
|
||||
// <author>stubbfel</author>
|
||||
// <sience>10.06.2013</sience>
|
||||
//----------------------------------------------------------------------
|
||||
namespace CampusAppWP8.Model.Lecture
|
||||
namespace CampusAppWPortalLib8.Model.Lecture
|
||||
{
|
||||
using System.Xml.Serialization;
|
||||
|
||||
@@ -5,7 +5,7 @@
|
||||
// <author>stubbfel</author>
|
||||
// <sience>10.06.2013</sience>
|
||||
//----------------------------------------------------------------------
|
||||
namespace CampusAppWP8.Model.Lecture
|
||||
namespace CampusAppWPortalLib8.Model.Lecture
|
||||
{
|
||||
using System.Xml.Serialization;
|
||||
|
||||
@@ -5,7 +5,7 @@
|
||||
// <author>stubbfel</author>
|
||||
// <sience>10.06.2013</sience>
|
||||
//----------------------------------------------------------------------
|
||||
namespace CampusAppWP8.Model.Lecture
|
||||
namespace CampusAppWPortalLib8.Model.Lecture
|
||||
{
|
||||
using System.Xml.Serialization;
|
||||
|
||||
@@ -5,7 +5,7 @@
|
||||
// <author>stubbfel</author>
|
||||
// <sience>10.06.2013</sience>
|
||||
//----------------------------------------------------------------------
|
||||
namespace CampusAppWP8.Model.Lecture
|
||||
namespace CampusAppWPortalLib8.Model.Lecture
|
||||
{
|
||||
using System.Collections.ObjectModel;
|
||||
using System.Linq;
|
||||
@@ -14,13 +14,14 @@ namespace CampusAppWP8.Model.Lecture
|
||||
/// <summary>
|
||||
/// Model for a List of LectureActivity
|
||||
/// </summary>
|
||||
/// <typeparam name="T">T : LectureActivity</typeparam>
|
||||
[XmlRoot("lsf_auszug")]
|
||||
public class LectureList
|
||||
public class LectureList<T> where T : LectureActivity
|
||||
{
|
||||
#region Constructor
|
||||
|
||||
/// <summary>
|
||||
/// Initializes a new instance of the <see cref="LectureList" /> class.
|
||||
/// Initializes a new instance of the <see cref="LectureList {T}" /> class.
|
||||
/// </summary>
|
||||
public LectureList()
|
||||
{
|
||||
@@ -35,7 +36,7 @@ namespace CampusAppWP8.Model.Lecture
|
||||
/// </summary>
|
||||
[XmlArray("veranstaltungsliste")]
|
||||
[XmlArrayItem("veranstaltung")]
|
||||
public ObservableCollection<LectureActivity> Activities { get; set; }
|
||||
public ObservableCollection<T> Activities { get; set; }
|
||||
|
||||
#endregion
|
||||
|
||||
@@ -46,9 +47,9 @@ namespace CampusAppWP8.Model.Lecture
|
||||
/// </summary>
|
||||
/// <param name="id"> id of the activity</param>
|
||||
/// <returns> the activity (FirstOrDefault)</returns>
|
||||
public LectureActivity GetActivity(int id)
|
||||
public T GetActivity(int id)
|
||||
{
|
||||
LectureActivity activity = this.Activities.Where(p => p.Id == id).FirstOrDefault();
|
||||
T activity = this.Activities.Where(p => p.Id == id).FirstOrDefault();
|
||||
return activity;
|
||||
}
|
||||
|
||||
@@ -57,12 +58,12 @@ namespace CampusAppWP8.Model.Lecture
|
||||
/// <param name="filter">Specifies the filter.</param>
|
||||
public void FilterByCourseTitle(string filter)
|
||||
{
|
||||
ObservableCollection<LectureActivity> filteredCollection = new ObservableCollection<LectureActivity>();
|
||||
ObservableCollection<T> filteredCollection = new ObservableCollection<T>();
|
||||
filter = filter.Trim().ToLower();
|
||||
foreach (LectureActivity activity in this.Activities)
|
||||
foreach (T activity in this.Activities)
|
||||
{
|
||||
activity.CreateCourseString();
|
||||
if (activity.Title.ToLower().Contains(filter))
|
||||
if (activity.Title.ToLower().Contains(filter))
|
||||
{
|
||||
filteredCollection.Add(activity);
|
||||
}
|
||||
@@ -5,11 +5,11 @@
|
||||
// <author>stubbfel</author>
|
||||
// <sience>10.06.2013</sience>
|
||||
//----------------------------------------------------------------------
|
||||
namespace CampusAppWP8.Model.Lecture
|
||||
namespace CampusAppWPortalLib8.Model.Lecture
|
||||
{
|
||||
using System;
|
||||
using System.Xml.Serialization;
|
||||
using CampusAppWP8.Resources;
|
||||
using CampusAppWPortalLib8.Resources;
|
||||
|
||||
/// <summary>
|
||||
/// Model for the module of an lecture
|
||||
@@ -135,6 +135,9 @@
|
||||
<data name="UrlEvents_Addr" xml:space="preserve">
|
||||
<value>http://www.tu-cottbus.de/oracle-gateway/php/rss2feed_veranstaltungen.php</value>
|
||||
</data>
|
||||
<data name="UrlLecture_ModulBaseAddr" xml:space="preserve">
|
||||
<value>https://www.tu-cottbus.de/modul/</value>
|
||||
</data>
|
||||
<data name="UrlMensa_Week_CBMain" xml:space="preserve">
|
||||
<value>http://www.studentenwerk-frankfurt.de/2011/ClassPackage/App_IKMZ_BTU/index.php?mensa=CottbusBTU&v=1</value>
|
||||
</data>
|
||||
|
||||
@@ -115,6 +115,15 @@ namespace CampusAppWPortalLib8.Resources {
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Sucht eine lokalisierte Zeichenfolge, die https://www.tu-cottbus.de/modul/ ähnelt.
|
||||
/// </summary>
|
||||
public static string UrlLecture_ModulBaseAddr {
|
||||
get {
|
||||
return ResourceManager.GetString("UrlLecture_ModulBaseAddr", resourceCulture);
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Sucht eine lokalisierte Zeichenfolge, die http://www.studentenwerk-frankfurt.de/2011/ClassPackage/App_IKMZ_BTU/index.php?mensa=CottbusBTU&v=1 ähnelt.
|
||||
/// </summary>
|
||||
|
||||
Reference in New Issue
Block a user