Merge branch 'release/#r133' into develmaster
This commit is contained in:
@@ -1,12 +1,15 @@
|
||||
using CampusAppWP8.Resources;
|
||||
using Microsoft.Phone.Controls;
|
||||
using Microsoft.Phone.Shell;
|
||||
using System;
|
||||
using System;
|
||||
using System.Diagnostics;
|
||||
using System.IO.IsolatedStorage;
|
||||
using System.Resources;
|
||||
using System.Windows;
|
||||
using System.Windows.Markup;
|
||||
using System.Windows.Navigation;
|
||||
using Microsoft.Phone.Controls;
|
||||
using Microsoft.Phone.Shell;
|
||||
using CampusAppWP8.Resources;
|
||||
using System.IO.IsolatedStorage;
|
||||
using CampusAppWP8.File.Setting;
|
||||
using CampusAppWP8.Model.Setting;
|
||||
|
||||
|
||||
namespace CampusAppWP8
|
||||
@@ -128,13 +131,36 @@ namespace CampusAppWP8
|
||||
// Dieser Code wird beim Reaktivieren der Anwendung nicht ausgeführt
|
||||
private void Application_Launching(object sender, LaunchingEventArgs e)
|
||||
{
|
||||
this.LoadSettings();
|
||||
}
|
||||
|
||||
private void LoadSettings()
|
||||
{
|
||||
UserProfilFile userFile;
|
||||
userFile = Settings.UserProfil;
|
||||
if (userFile.Model == null)
|
||||
{
|
||||
userFile.onLoaded += new UserProfilFile.OnLoaded(this.UserSettingsLoaded);
|
||||
userFile.LoadData();
|
||||
}
|
||||
else
|
||||
{
|
||||
this.UserSettingsLoaded();
|
||||
}
|
||||
}
|
||||
private void UserSettingsLoaded()
|
||||
{
|
||||
if (Settings.UserProfil.Model == null)
|
||||
{
|
||||
Settings.UserProfil.Model = new UserProfilModel();
|
||||
}
|
||||
}
|
||||
|
||||
// Code, der ausgeführt werden soll, wenn die Anwendung aktiviert wird (in den Vordergrund gebracht wird)
|
||||
// Dieser Code wird beim ersten Starten der Anwendung nicht ausgeführt
|
||||
private void Application_Activated(object sender, ActivatedEventArgs e)
|
||||
{
|
||||
|
||||
this.LoadSettings();
|
||||
}
|
||||
|
||||
// Code, der ausgeführt werden soll, wenn die Anwendung deaktiviert wird (in den Hintergrund gebracht wird)
|
||||
|
||||
@@ -98,7 +98,18 @@
|
||||
</Compile>
|
||||
<Compile Include="Feed\Departments\DepartmentFavoriteFeed.cs" />
|
||||
<Compile Include="Const.cs" />
|
||||
<Compile Include="File\Setting\UserProfilFile.cs" />
|
||||
<Compile Include="Model\Setting\UserProfilModel.cs" />
|
||||
<Compile Include="Model\Utility\CourseListPickerItemListModel.cs" />
|
||||
<Compile Include="Model\Utility\DegreeListPickerItemListModel.cs" />
|
||||
<Compile Include="Model\Utility\RoleListPickerItemListModel.cs" />
|
||||
<Compile Include="Model\Utility\SemesterListPickerItemListModel.cs" />
|
||||
<Compile Include="Model\Utility\ListPickerItemListModel.cs" />
|
||||
<Compile Include="Pages\Setting\UserProfil.xaml.cs">
|
||||
<DependentUpon>UserProfil.xaml</DependentUpon>
|
||||
</Compile>
|
||||
<Compile Include="Resources\Icons.Designer.cs" />
|
||||
<Compile Include="Settings.cs" />
|
||||
<Compile Include="Utility\Lui\Button\EmailButton.cs" />
|
||||
<Compile Include="Feed\Link\CommonLinkFeed.cs" />
|
||||
<Compile Include="Feed\Link\ClubLinkFeed.cs" />
|
||||
@@ -290,6 +301,10 @@
|
||||
<SubType>Designer</SubType>
|
||||
<Generator>MSBuild:Compile</Generator>
|
||||
</Page>
|
||||
<Page Include="Pages\Setting\UserProfil.xaml">
|
||||
<SubType>Designer</SubType>
|
||||
<Generator>MSBuild:Compile</Generator>
|
||||
</Page>
|
||||
<Page Include="pages\StartPage.xaml">
|
||||
<SubType>Designer</SubType>
|
||||
<Generator>MSBuild:Compile</Generator>
|
||||
|
||||
67
CampusAppWP8/CampusAppWP8/File/Setting/UserProfilFile.cs
Normal file
67
CampusAppWP8/CampusAppWP8/File/Setting/UserProfilFile.cs
Normal file
@@ -0,0 +1,67 @@
|
||||
//-----------------------------------------------------------------------
|
||||
// <copyright file="UserProfilFile.cs" company="BTU/IIT">
|
||||
// Company copyright tag.
|
||||
// </copyright>
|
||||
// <author>stubbfel</author>
|
||||
// <sience>23.07.2013</sience>
|
||||
//----------------------------------------------------------------------
|
||||
namespace CampusAppWP8.File.Setting
|
||||
{
|
||||
using System.IO;
|
||||
using CampusAppWP8.Model;
|
||||
using CampusAppWP8.Model.Setting;
|
||||
using CampusAppWP8.Resources;
|
||||
|
||||
/// <summary>
|
||||
/// Class for handle the user-profile-file
|
||||
/// </summary>
|
||||
public class UserProfilFile : XmlModel<UserProfilModel>
|
||||
{
|
||||
#region Constructor
|
||||
|
||||
/// <summary>
|
||||
/// Initializes a new instance of the <see cref="UserProfilFile" /> class.
|
||||
/// </summary>
|
||||
public UserProfilFile()
|
||||
: base(ModelType.File, Constants.FileProfil_User)
|
||||
{
|
||||
this.isFileUpToDateOnLoad += new IsFileUpToDate(this.CheckIsFileUpToDateOnLoad);
|
||||
this.isFileUpToDateOnSave += new IsFileUpToDate(this.CheckIsFileUpToDateOnSave);
|
||||
}
|
||||
|
||||
// Constructor
|
||||
#endregion
|
||||
|
||||
/// <summary>
|
||||
/// Method implement CheckIsFileUpToDate()-Method <see cref="Pages"/>.
|
||||
/// </summary>
|
||||
/// <param name="model">model object</param>
|
||||
/// <param name="info">file info object</param>
|
||||
/// <returns>true, if file is up-to-date, otherwise false</returns>
|
||||
private bool CheckIsFileUpToDateOnLoad(UserProfilModel model, FileInfo info)
|
||||
{
|
||||
if (model == null)
|
||||
{
|
||||
return true;
|
||||
}
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Method implement CheckIsFileUpToDate()-Method <see cref="Pages"/>.
|
||||
/// </summary>
|
||||
/// <param name="model">model object</param>
|
||||
/// <param name="info">file info object</param>
|
||||
/// <returns>true, if file is up-to-date, otherwise false</returns>
|
||||
private bool CheckIsFileUpToDateOnSave(UserProfilModel model, FileInfo info)
|
||||
{
|
||||
if (model != null && !model.HasChanged())
|
||||
{
|
||||
return true;
|
||||
}
|
||||
|
||||
return false;
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -7,11 +7,9 @@
|
||||
//----------------------------------------------------------------------
|
||||
namespace CampusAppWP8.Model.Lecture
|
||||
{
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Runtime.Serialization;
|
||||
using CampusAppWP8.Model.Setting;
|
||||
using CampusAppWP8.Model.Utility;
|
||||
using CampusAppWP8.Resources;
|
||||
|
||||
/// <summary>
|
||||
/// Model for the LecturePage
|
||||
@@ -57,27 +55,27 @@ namespace CampusAppWP8.Model.Lecture
|
||||
/// <remarks>
|
||||
/// need to be extend to full list
|
||||
/// </remarks>
|
||||
private List<ListPickerItemModel> courseList;
|
||||
private ListPickerItemListModel courseList;
|
||||
|
||||
/// <summary>
|
||||
/// List of the degrees
|
||||
/// </summary>
|
||||
private List<ListPickerItemModel> degreeList;
|
||||
private ListPickerItemListModel degreeList;
|
||||
|
||||
/// <summary>
|
||||
/// List of the semester
|
||||
/// </summary>
|
||||
private List<ListPickerItemModel> semesterList;
|
||||
private ListPickerItemListModel semesterList;
|
||||
|
||||
/// <summary>
|
||||
/// List for the number of semester (from)
|
||||
/// </summary>
|
||||
private List<ListPickerItemModel> fromNumberList;
|
||||
private ListPickerItemListModel fromNumberList;
|
||||
|
||||
/// <summary>
|
||||
/// List for the number of semester (to)
|
||||
/// </summary>
|
||||
private List<ListPickerItemModel> toNumberList;
|
||||
private ListPickerItemListModel toNumberList;
|
||||
|
||||
#endregion
|
||||
|
||||
@@ -88,6 +86,9 @@ namespace CampusAppWP8.Model.Lecture
|
||||
/// </summary>
|
||||
public LecturePageModel()
|
||||
{
|
||||
this.courseList = new CourseListPickerItemListModel();
|
||||
this.degreeList = new DegreeListPickerItemListModel();
|
||||
this.semesterList = new SemesterListPickerItemListModel();
|
||||
}
|
||||
#endregion
|
||||
|
||||
@@ -105,7 +106,7 @@ namespace CampusAppWP8.Model.Lecture
|
||||
|
||||
set
|
||||
{
|
||||
if (value != this.selectCourseIndex && this.courseList != null && value < this.courseList.Count)
|
||||
if (value != this.selectCourseIndex && this.courseList != null && value < this.courseList.List.Count)
|
||||
{
|
||||
this.selectCourseIndex = value;
|
||||
}
|
||||
@@ -124,7 +125,7 @@ namespace CampusAppWP8.Model.Lecture
|
||||
|
||||
set
|
||||
{
|
||||
if (value != this.selectDegreeIndex && this.degreeList != null && value < this.degreeList.Count)
|
||||
if (value != this.selectDegreeIndex && this.degreeList != null && value < this.degreeList.List.Count)
|
||||
{
|
||||
this.selectDegreeIndex = value;
|
||||
}
|
||||
@@ -143,7 +144,7 @@ namespace CampusAppWP8.Model.Lecture
|
||||
|
||||
set
|
||||
{
|
||||
if (value != this.selectSemesterIndex && this.semesterList != null && value < this.semesterList.Count)
|
||||
if (value != this.selectSemesterIndex && this.semesterList != null && value < this.semesterList.List.Count)
|
||||
{
|
||||
this.selectSemesterIndex = value;
|
||||
}
|
||||
@@ -162,7 +163,7 @@ namespace CampusAppWP8.Model.Lecture
|
||||
|
||||
set
|
||||
{
|
||||
if (value != this.selectFromIndex && this.fromNumberList != null && value < this.fromNumberList.Count)
|
||||
if (value != this.selectFromIndex && this.fromNumberList != null && value < this.fromNumberList.List.Count)
|
||||
{
|
||||
this.selectFromIndex = value;
|
||||
}
|
||||
@@ -181,7 +182,7 @@ namespace CampusAppWP8.Model.Lecture
|
||||
|
||||
set
|
||||
{
|
||||
if (value != this.selectToIndex && this.toNumberList != null && value < this.toNumberList.Count)
|
||||
if (value != this.selectToIndex && this.toNumberList != null && value < this.toNumberList.List.Count)
|
||||
{
|
||||
this.selectToIndex = value;
|
||||
}
|
||||
@@ -191,7 +192,7 @@ namespace CampusAppWP8.Model.Lecture
|
||||
/// <summary>
|
||||
/// Gets List for the courses of the BTU
|
||||
/// </summary>
|
||||
public List<ListPickerItemModel> CourseList
|
||||
public ListPickerItemListModel CourseList
|
||||
{
|
||||
get
|
||||
{
|
||||
@@ -202,7 +203,7 @@ namespace CampusAppWP8.Model.Lecture
|
||||
/// <summary>
|
||||
/// Gets List of the degrees
|
||||
/// </summary>
|
||||
public List<ListPickerItemModel> DegreeList
|
||||
public ListPickerItemListModel DegreeList
|
||||
{
|
||||
get
|
||||
{
|
||||
@@ -213,7 +214,7 @@ namespace CampusAppWP8.Model.Lecture
|
||||
/// <summary>
|
||||
/// Gets List of the semester
|
||||
/// </summary>
|
||||
public List<ListPickerItemModel> SemesterList
|
||||
public ListPickerItemListModel SemesterList
|
||||
{
|
||||
get
|
||||
{
|
||||
@@ -224,7 +225,7 @@ namespace CampusAppWP8.Model.Lecture
|
||||
/// <summary>
|
||||
/// Gets List for the number of semester
|
||||
/// </summary>
|
||||
public List<ListPickerItemModel> FromNumberList
|
||||
public ListPickerItemListModel FromNumberList
|
||||
{
|
||||
get
|
||||
{
|
||||
@@ -235,7 +236,7 @@ namespace CampusAppWP8.Model.Lecture
|
||||
/// <summary>
|
||||
/// Gets the NumberList
|
||||
/// </summary>
|
||||
public List<ListPickerItemModel> ToNumberList
|
||||
public ListPickerItemListModel ToNumberList
|
||||
{
|
||||
get
|
||||
{
|
||||
@@ -253,11 +254,12 @@ namespace CampusAppWP8.Model.Lecture
|
||||
/// </summary>
|
||||
public void LoadLists()
|
||||
{
|
||||
this.LoadCourseList();
|
||||
this.LoadDegreeList();
|
||||
this.LoadFromNumberList();
|
||||
this.LoadToNumberList();
|
||||
this.LoadSemesterList();
|
||||
UserProfilModel userModel = Settings.UserProfil.Model;
|
||||
this.selectCourseIndex = this.courseList.GetIndexOrDefault(((int)userModel.Course).ToString().PadLeft(3, '0'));
|
||||
this.selectDegreeIndex = this.degreeList.GetIndexOrDefault(((int)userModel.Degree).ToString());
|
||||
this.selectSemesterIndex = this.semesterList.GetIndexOrDefault(((int)userModel.Semester).ToString());
|
||||
}
|
||||
|
||||
#endregion
|
||||
@@ -270,13 +272,13 @@ namespace CampusAppWP8.Model.Lecture
|
||||
public void LoadFromNumberList()
|
||||
{
|
||||
string selectValue = null;
|
||||
if (this.fromNumberList != null)
|
||||
if (this.fromNumberList != null && this.fromNumberList.List.Count > 0)
|
||||
{
|
||||
selectValue = this.fromNumberList[this.SelectFromIndex].Value;
|
||||
selectValue = this.fromNumberList.List[this.SelectFromIndex].Value;
|
||||
}
|
||||
|
||||
this.fromNumberList = this.CreateNumberList(1, 10);
|
||||
this.SelectFromIndex = this.GetIndexOrDefault(this.fromNumberList, selectValue);
|
||||
this.SelectFromIndex = this.fromNumberList.GetIndexOrDefault(selectValue);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
@@ -285,13 +287,13 @@ namespace CampusAppWP8.Model.Lecture
|
||||
public void LoadToNumberList()
|
||||
{
|
||||
string selectValue = null;
|
||||
if (this.toNumberList != null)
|
||||
if (this.toNumberList != null && this.toNumberList.List.Count > 0)
|
||||
{
|
||||
selectValue = this.toNumberList[this.SelectToIndex].Value;
|
||||
selectValue = this.toNumberList.List[this.SelectToIndex].Value;
|
||||
}
|
||||
|
||||
this.toNumberList = this.CreateNumberList(this.SelectFromIndex + 1, 10);
|
||||
this.SelectToIndex = this.GetIndexOrDefault(this.toNumberList, selectValue);
|
||||
this.SelectToIndex = this.toNumberList.GetIndexOrDefault(selectValue);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
@@ -300,10 +302,10 @@ namespace CampusAppWP8.Model.Lecture
|
||||
/// <param name="startvalue">startValue of the list</param>
|
||||
/// <param name="endvalue">endValue of the list</param>
|
||||
/// <returns>return list</returns>
|
||||
private List<ListPickerItemModel> CreateNumberList(int startvalue, int endvalue)
|
||||
private ListPickerItemListModel CreateNumberList(int startvalue, int endvalue)
|
||||
{
|
||||
List<ListPickerItemModel> list = new List<ListPickerItemModel>();
|
||||
string degree = this.DegreeList[this.SelectDegreeIndex].Value;
|
||||
ListPickerItemListModel list = new ListPickerItemListModel();
|
||||
string degree = this.DegreeList.List[this.SelectDegreeIndex].Value;
|
||||
|
||||
for (int i = startvalue; i <= endvalue; i++)
|
||||
{
|
||||
@@ -312,108 +314,11 @@ namespace CampusAppWP8.Model.Lecture
|
||||
break;
|
||||
}
|
||||
|
||||
list.Add(new ListPickerItemModel() { Text = i.ToString(), Value = i.ToString() });
|
||||
list.AddItem(i.ToString(), i.ToString());
|
||||
}
|
||||
|
||||
return list;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Load the SemesterList
|
||||
/// </summary>
|
||||
private void LoadSemesterList()
|
||||
{
|
||||
this.semesterList = new List<ListPickerItemModel>();
|
||||
this.semesterList.Add(new ListPickerItemModel() { Text = "SoSe 13", Value = "20131" });
|
||||
this.semesterList.Add(new ListPickerItemModel() { Text = "WiSe 13/14", Value = "20132" });
|
||||
this.semesterList.Add(new ListPickerItemModel() { Text = "SoSe 14", Value = "20131" });
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Load the DegreeList
|
||||
/// </summary>
|
||||
private void LoadDegreeList()
|
||||
{
|
||||
this.degreeList = new List<ListPickerItemModel>();
|
||||
this.degreeList.Add(new ListPickerItemModel() { Text = AppResources.Degree_Bachelor, Value = "82" });
|
||||
this.degreeList.Add(new ListPickerItemModel() { Text = AppResources.Degree_Master, Value = "88" });
|
||||
this.degreeList.Add(new ListPickerItemModel() { Text = AppResources.Degree_Diploma, Value = "11" });
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Load the DegreeList
|
||||
/// </summary>
|
||||
private void LoadCourseList()
|
||||
{
|
||||
this.courseList = new List<ListPickerItemModel>();
|
||||
this.courseList.Add(new ListPickerItemModel() { Text = "Architektur", Value = "013" });
|
||||
this.courseList.Add(new ListPickerItemModel() { Text = "Bauingenieurwesen", Value = "017" });
|
||||
this.courseList.Add(new ListPickerItemModel() { Text = "Betriebswirtschaftslehre", Value = "021" });
|
||||
this.courseList.Add(new ListPickerItemModel() { Text = "Wirtschaftsrecht für Technologieunternehmen", Value = "042" });
|
||||
this.courseList.Add(new ListPickerItemModel() { Text = "Elektrotechnik", Value = "048" });
|
||||
this.courseList.Add(new ListPickerItemModel() { Text = "Informatik ", Value = "079" });
|
||||
this.courseList.Add(new ListPickerItemModel() { Text = "Maschinenbau", Value = "104" });
|
||||
this.courseList.Add(new ListPickerItemModel() { Text = "Mathematik", Value = "105" });
|
||||
this.courseList.Add(new ListPickerItemModel() { Text = "Physik ", Value = "128" });
|
||||
this.courseList.Add(new ListPickerItemModel() { Text = "Wirtschaftsingenieurwesen", Value = "179" });
|
||||
this.courseList.Add(new ListPickerItemModel() { Text = "Wirtschaftswissenschaften ", Value = "184" });
|
||||
this.courseList.Add(new ListPickerItemModel() { Text = "Biomedizinische Gerätetechnik ", Value = "215" });
|
||||
this.courseList.Add(new ListPickerItemModel() { Text = "Verfahrenstechnik", Value = "226" });
|
||||
this.courseList.Add(new ListPickerItemModel() { Text = "Wirtschaftsmathematik ", Value = "276" });
|
||||
this.courseList.Add(new ListPickerItemModel() { Text = "Kultur und Technik ", Value = "711" });
|
||||
this.courseList.Add(new ListPickerItemModel() { Text = "Physik der Halbleiter-Technologie", Value = "744" });
|
||||
this.courseList.Add(new ListPickerItemModel() { Text = "Angewandte Mathematik ", Value = "749" });
|
||||
this.courseList.Add(new ListPickerItemModel() { Text = "Technologie- und Innovationsmanagement", Value = "764" });
|
||||
this.courseList.Add(new ListPickerItemModel() { Text = "Stadt- und Regionalplanung", Value = "766" });
|
||||
this.courseList.Add(new ListPickerItemModel() { Text = "Informations- und Medientechnik ", Value = "767" });
|
||||
this.courseList.Add(new ListPickerItemModel() { Text = "World Heritage Studies", Value = "768" });
|
||||
this.courseList.Add(new ListPickerItemModel() { Text = "Umweltingenieurwesen und Verfahrenstechnik", Value = "770" });
|
||||
this.courseList.Add(new ListPickerItemModel() { Text = "Environmental and Resource Management", Value = "771" });
|
||||
this.courseList.Add(new ListPickerItemModel() { Text = "Landnutzung und Wasserbewirtschaftung", Value = "772" });
|
||||
this.courseList.Add(new ListPickerItemModel() { Text = "Bauen und Erhalten", Value = "773" });
|
||||
this.courseList.Add(new ListPickerItemModel() { Text = "Umweltingenieurwesen", Value = "774" });
|
||||
this.courseList.Add(new ListPickerItemModel() { Text = "eBusiness", Value = "794" });
|
||||
this.courseList.Add(new ListPickerItemModel() { Text = "Civil Engineering", Value = "798" });
|
||||
this.courseList.Add(new ListPickerItemModel() { Text = "Structural Engineering", Value = "799" });
|
||||
this.courseList.Add(new ListPickerItemModel() { Text = "Electrical Power Engineering ", Value = "800" });
|
||||
this.courseList.Add(new ListPickerItemModel() { Text = "Euro Hydroinformatics and Water Management", Value = "841" });
|
||||
this.courseList.Add(new ListPickerItemModel() { Text = "Technologien Biogener Rohstoffe", Value = "842" });
|
||||
this.courseList.Add(new ListPickerItemModel() { Text = "Environmental Technologies", Value = "843" });
|
||||
this.courseList.Add(new ListPickerItemModel() { Text = "Process Engineering and Plant Design", Value = "844" });
|
||||
this.courseList.Add(new ListPickerItemModel() { Text = "Architekturvermittlung", Value = "845" });
|
||||
this.courseList.Add(new ListPickerItemModel() { Text = "Nachwachsende Rohstoffe und Erneuerbare Energien", Value = "851" });
|
||||
this.courseList.Add(new ListPickerItemModel() { Text = "Energieträger aus Biomasse und Abfällen", Value = "852" });
|
||||
this.courseList.Add(new ListPickerItemModel() { Text = "Power Engineering", Value = "853" });
|
||||
this.courseList.Add(new ListPickerItemModel() { Text = "Verfahrenstechnik - Prozess- und Anlagentechnik", Value = "857" });
|
||||
this.courseList.Add(new ListPickerItemModel() { Text = "Architektur.Studium.Generale", Value = "858" });
|
||||
this.courseList.Add(new ListPickerItemModel() { Text = "Verarbeitungstechnologien der Werkstoffe", Value = "860" });
|
||||
this.courseList.Add(new ListPickerItemModel() { Text = "Forensic Sciences and Engineering", Value = "871" });
|
||||
this.courseList = this.courseList.OrderBy(o => o.Text).ToList();
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Method return a the Index of an item which has a certain value
|
||||
/// </summary>
|
||||
/// <param name="list">list for items</param>
|
||||
/// <param name="value">a certain value</param>
|
||||
/// <returns>return index of value or default(0)</returns>
|
||||
private int GetIndexOrDefault(List<ListPickerItemModel> list, string value)
|
||||
{
|
||||
int index = 0;
|
||||
int i = 0;
|
||||
foreach (ListPickerItemModel item in list)
|
||||
{
|
||||
if (item.Value.Equals(value))
|
||||
{
|
||||
index = i;
|
||||
break;
|
||||
}
|
||||
|
||||
i++;
|
||||
}
|
||||
|
||||
return index;
|
||||
}
|
||||
#endregion
|
||||
|
||||
#endregion
|
||||
|
||||
258
CampusAppWP8/CampusAppWP8/Model/Setting/UserProfilModel.cs
Normal file
258
CampusAppWP8/CampusAppWP8/Model/Setting/UserProfilModel.cs
Normal file
@@ -0,0 +1,258 @@
|
||||
//-----------------------------------------------------------------------
|
||||
// <copyright file="UserProfilModel.cs" company="BTU/IIT">
|
||||
// Company copyright tag.
|
||||
// </copyright>
|
||||
// <author>stubbfel</author>
|
||||
// <sience>23.07.2013</sience>
|
||||
//----------------------------------------------------------------------
|
||||
namespace CampusAppWP8.Model.Setting
|
||||
{
|
||||
using System.Xml.Serialization;
|
||||
using CampusAppWP8.Resources;
|
||||
|
||||
/// <summary>
|
||||
/// Model for the profile of an user
|
||||
/// </summary>
|
||||
[XmlRoot("root")]
|
||||
public class UserProfilModel
|
||||
{
|
||||
#region Members
|
||||
|
||||
/// <summary>
|
||||
/// constant for the first validate semester
|
||||
/// </summary>
|
||||
private static readonly int FirstSemester = int.Parse(Constants.Valid_FirstSemseter);
|
||||
|
||||
/// <summary>
|
||||
/// constant for the last validate semester
|
||||
/// </summary>
|
||||
private static readonly int LastSemester = int.Parse(Constants.Valid_LastSemseter);
|
||||
|
||||
/// <summary>
|
||||
/// constant for the max. number of a validate course
|
||||
/// </summary>
|
||||
private static readonly int MaxCourseNumber = int.Parse(Constants.Valid_MaxCourseNumber);
|
||||
|
||||
/// <summary>
|
||||
/// constant for the default value of a semester
|
||||
/// </summary>
|
||||
private static readonly int DefaultSemester = int.Parse(Constants.Setting_DefaultSemester);
|
||||
|
||||
/// <summary>
|
||||
/// constant for the default value of a courseNumber
|
||||
/// </summary>
|
||||
private static readonly int DefaultCourseNumber = int.Parse(Constants.Setting_DefaultCourseNumber);
|
||||
|
||||
/// <summary>
|
||||
/// Flag which indicates that any properties has been changed
|
||||
/// </summary>
|
||||
private bool changed = false;
|
||||
|
||||
/// <summary>
|
||||
/// Gets or Sets the course of the user
|
||||
/// </summary>
|
||||
private int course = UserProfilModel.DefaultCourseNumber;
|
||||
|
||||
/// <summary>
|
||||
/// Gets or Sets the role of the user
|
||||
/// </summary>
|
||||
private RoleType role = RoleType.STUDENT;
|
||||
|
||||
/// <summary>
|
||||
/// Gets or Sets the degree of the user
|
||||
/// </summary>
|
||||
private DegreeType degree = DegreeType.BACHELOR;
|
||||
|
||||
/// <summary>
|
||||
/// Gets or Sets the semester of the user
|
||||
/// </summary>
|
||||
private int semester = UserProfilModel.DefaultSemester;
|
||||
|
||||
#endregion
|
||||
|
||||
#region Enums
|
||||
/// <summary>
|
||||
/// Specifies the degrees.
|
||||
/// </summary>
|
||||
public enum DegreeType
|
||||
{
|
||||
/// <summary>
|
||||
/// bachelor degree
|
||||
/// </summary>
|
||||
BACHELOR = 82,
|
||||
|
||||
/// <summary>
|
||||
/// master degree
|
||||
/// </summary>
|
||||
MASTER = 88,
|
||||
|
||||
/// <summary>
|
||||
/// diploma degree
|
||||
/// </summary>
|
||||
DIPLOM = 11
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Specifies the role of the user.
|
||||
/// </summary>
|
||||
public enum RoleType
|
||||
{
|
||||
/// <summary>
|
||||
/// for students (01).
|
||||
/// </summary>
|
||||
STUDENT = 1,
|
||||
|
||||
/// <summary>
|
||||
/// for staffs (10).
|
||||
/// </summary>
|
||||
STAFF = 2,
|
||||
}
|
||||
|
||||
#endregion
|
||||
|
||||
#region Proberties
|
||||
/// <summary>
|
||||
/// Gets or sets the course of the user
|
||||
/// </summary>
|
||||
[XmlElement("Course")]
|
||||
public int Course
|
||||
{
|
||||
get
|
||||
{
|
||||
return this.course;
|
||||
}
|
||||
|
||||
set
|
||||
{
|
||||
if (value != this.course && this.ValditateCourse(value))
|
||||
{
|
||||
this.course = value;
|
||||
this.changed = true;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Gets or sets the role of the user
|
||||
/// </summary>
|
||||
[XmlElement("Role")]
|
||||
public RoleType Role
|
||||
{
|
||||
get
|
||||
{
|
||||
return this.role;
|
||||
}
|
||||
|
||||
set
|
||||
{
|
||||
if (value != this.role)
|
||||
{
|
||||
this.role = value;
|
||||
this.changed = true;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Gets or sets the degree of the user
|
||||
/// </summary>
|
||||
[XmlElement("Degere")]
|
||||
public DegreeType Degree
|
||||
{
|
||||
get
|
||||
{
|
||||
return this.degree;
|
||||
}
|
||||
|
||||
set
|
||||
{
|
||||
if (value != this.degree)
|
||||
{
|
||||
this.degree = value;
|
||||
this.changed = true;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Gets or sets the semester of the user
|
||||
/// </summary>
|
||||
[XmlElement("Semseter")]
|
||||
public int Semester
|
||||
{
|
||||
get
|
||||
{
|
||||
return this.semester;
|
||||
}
|
||||
|
||||
set
|
||||
{
|
||||
if (value != this.semester && this.ValditateSemester(value))
|
||||
{
|
||||
this.semester = value;
|
||||
this.changed = true;
|
||||
}
|
||||
}
|
||||
}
|
||||
#endregion
|
||||
|
||||
#region Methods
|
||||
|
||||
#region public
|
||||
|
||||
/// <summary>
|
||||
/// Method return the changed flag
|
||||
/// </summary>
|
||||
/// <param name="reset"> if is true, set changed flag to false, otherwise do nothing (bypass)</param>
|
||||
/// <returns>return true, if any properties has changed, otherwise false</returns>
|
||||
public bool HasChanged(bool reset = true)
|
||||
{
|
||||
bool result = this.changed;
|
||||
|
||||
if (reset)
|
||||
{
|
||||
this.changed = false;
|
||||
}
|
||||
|
||||
return result;
|
||||
}
|
||||
|
||||
#endregion
|
||||
|
||||
#region private
|
||||
|
||||
/// <summary>
|
||||
/// Methods check if a value could be a valid semester
|
||||
/// </summary>
|
||||
/// <param name="possibleSemester">value which has to be checked</param>
|
||||
/// <returns>true if it is an valid semester, otherwise false</returns>
|
||||
private bool ValditateSemester(int possibleSemester)
|
||||
{
|
||||
if (possibleSemester < UserProfilModel.FirstSemester || possibleSemester > UserProfilModel.LastSemester)
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Methods check if a value could be a valid course
|
||||
/// </summary>
|
||||
/// <param name="possibleCourse">value which has to be checked</param>
|
||||
/// <returns>true if it is an valid course, otherwise false</returns>
|
||||
private bool ValditateCourse(int possibleCourse)
|
||||
{
|
||||
if (possibleCourse > UserProfilModel.MaxCourseNumber)
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
#endregion
|
||||
|
||||
#endregion
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,86 @@
|
||||
// <copyright file="CourseListPickerItemListModel.cs" company="BTU/IIT">
|
||||
// Company copyright tag.List
|
||||
// </copyright>
|
||||
// <author>stubbfel</author>
|
||||
// <sience>25.07.2013</sience>
|
||||
//----------------------------------------------------------------------
|
||||
namespace CampusAppWP8.Model.Utility
|
||||
{
|
||||
using System.Linq;
|
||||
|
||||
/// <summary>
|
||||
/// This is a class for the courseList
|
||||
/// </summary>
|
||||
public class CourseListPickerItemListModel : ListPickerItemListModel
|
||||
{
|
||||
#region Constructor
|
||||
|
||||
/// <summary>
|
||||
/// Initializes a new instance of the <see cref="CourseListPickerItemListModel" /> class.
|
||||
/// </summary>
|
||||
public CourseListPickerItemListModel()
|
||||
: base()
|
||||
{
|
||||
}
|
||||
|
||||
#endregion
|
||||
|
||||
#region Method
|
||||
|
||||
#region private
|
||||
|
||||
/// <summary>
|
||||
/// Overrides the LoadList-Method <see cref="ListPickerItemListModel"/>
|
||||
/// </summary>
|
||||
protected override void LoadList()
|
||||
{
|
||||
this.AddItem(new ListPickerItemModel("013", "Architektur"));
|
||||
this.AddItem(new ListPickerItemModel("017", "Bauingenieurwesen"));
|
||||
this.AddItem(new ListPickerItemModel("021", "Betriebswirtschaftslehre"));
|
||||
this.AddItem(new ListPickerItemModel("042", "Wirtschaftsrecht für Technologieunternehmen"));
|
||||
this.AddItem(new ListPickerItemModel("048", "Elektrotechnik"));
|
||||
this.AddItem(new ListPickerItemModel("079", "Informatik "));
|
||||
this.AddItem(new ListPickerItemModel("104", "Maschinenbau"));
|
||||
this.AddItem(new ListPickerItemModel("105", "Mathematik"));
|
||||
this.AddItem(new ListPickerItemModel("128", "Physik "));
|
||||
this.AddItem(new ListPickerItemModel("179", "Wirtschaftsingenieurwesen"));
|
||||
this.AddItem(new ListPickerItemModel("184", "Wirtschaftswissenschaften "));
|
||||
this.AddItem(new ListPickerItemModel("215", "Biomedizinische Gerätetechnik "));
|
||||
this.AddItem(new ListPickerItemModel("226", "Verfahrenstechnik"));
|
||||
this.AddItem(new ListPickerItemModel("276", "Wirtschaftsmathematik "));
|
||||
this.AddItem(new ListPickerItemModel("711", "Kultur und Technik "));
|
||||
this.AddItem(new ListPickerItemModel("744", "Physik der Halbleiter-Technologie"));
|
||||
this.AddItem(new ListPickerItemModel("749", "Angewandte Mathematik "));
|
||||
this.AddItem(new ListPickerItemModel("764", "Technologie- und Innovationsmanagement"));
|
||||
this.AddItem(new ListPickerItemModel("766", "Stadt- und Regionalplanung"));
|
||||
this.AddItem(new ListPickerItemModel("767", "Informations- und Medientechnik "));
|
||||
this.AddItem(new ListPickerItemModel("768", "World Heritage Studies"));
|
||||
this.AddItem(new ListPickerItemModel("770", "Umweltingenieurwesen und Verfahrenstechnik"));
|
||||
this.AddItem(new ListPickerItemModel("771", "Environmental and Resource Management"));
|
||||
this.AddItem(new ListPickerItemModel("772", "Landnutzung und Wasserbewirtschaftung"));
|
||||
this.AddItem(new ListPickerItemModel("773", "Bauen und Erhalten"));
|
||||
this.AddItem(new ListPickerItemModel("774", "Umweltingenieurwesen"));
|
||||
this.AddItem(new ListPickerItemModel("794", "eBusiness"));
|
||||
this.AddItem(new ListPickerItemModel("798", "Civil Engineering"));
|
||||
this.AddItem(new ListPickerItemModel("799", "Structural Engineering"));
|
||||
this.AddItem(new ListPickerItemModel("800", "Electrical Power Engineering "));
|
||||
this.AddItem(new ListPickerItemModel("841", "Euro Hydroinformatics and Water Management"));
|
||||
this.AddItem(new ListPickerItemModel("842", "Technologien Biogener Rohstoffe"));
|
||||
this.AddItem(new ListPickerItemModel("843", "Environmental Technologies"));
|
||||
this.AddItem(new ListPickerItemModel("844", "Process Engineering and Plant Design"));
|
||||
this.AddItem(new ListPickerItemModel("845", "Architekturvermittlung"));
|
||||
this.AddItem(new ListPickerItemModel("851", "Nachwachsende Rohstoffe und Erneuerbare Energien"));
|
||||
this.AddItem(new ListPickerItemModel("852", "Energieträger aus Biomasse und Abfällen"));
|
||||
this.AddItem(new ListPickerItemModel("853", "Power Engineering"));
|
||||
this.AddItem(new ListPickerItemModel("857", "Verfahrenstechnik - Prozess- und Anlagentechnik"));
|
||||
this.AddItem(new ListPickerItemModel("858", "Architektur.Studium.Generale"));
|
||||
this.AddItem(new ListPickerItemModel("860", "Verarbeitungstechnologien der Werkstoffe"));
|
||||
this.AddItem(new ListPickerItemModel("871", "Forensic Sciences and Engineering"));
|
||||
this.List = this.List.OrderBy(o => o.Text).ToList();
|
||||
}
|
||||
|
||||
#endregion
|
||||
|
||||
#endregion
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,46 @@
|
||||
// <copyright file="DegreeListPickerItemListModel.cs" company="BTU/IIT">
|
||||
// Company copyright tag.List
|
||||
// </copyright>
|
||||
// <author>stubbfel</author>
|
||||
// <sience>25.07.2013</sience>
|
||||
//----------------------------------------------------------------------
|
||||
namespace CampusAppWP8.Model.Utility
|
||||
{
|
||||
using CampusAppWP8.Resources;
|
||||
|
||||
/// <summary>
|
||||
/// This Class creates a list of degrees
|
||||
/// </summary>
|
||||
public class DegreeListPickerItemListModel : ListPickerItemListModel
|
||||
{
|
||||
#region Constructor
|
||||
|
||||
/// <summary>
|
||||
/// Initializes a new instance of the <see cref="DegreeListPickerItemListModel" /> class.
|
||||
/// </summary>
|
||||
public DegreeListPickerItemListModel()
|
||||
: base()
|
||||
{
|
||||
}
|
||||
|
||||
#endregion
|
||||
|
||||
#region Method
|
||||
|
||||
#region private
|
||||
|
||||
/// <summary>
|
||||
/// Overrides the LoadList-Method <see cref="ListPickerItemListModel"/>
|
||||
/// </summary>
|
||||
protected override void LoadList()
|
||||
{
|
||||
this.AddItem(new ListPickerItemModel(((int)CampusAppWP8.Model.Setting.UserProfilModel.DegreeType.BACHELOR).ToString(), AppResources.Degree_Bachelor));
|
||||
this.AddItem(new ListPickerItemModel(((int)CampusAppWP8.Model.Setting.UserProfilModel.DegreeType.MASTER).ToString(), AppResources.Degree_Master));
|
||||
this.AddItem(new ListPickerItemModel(((int)CampusAppWP8.Model.Setting.UserProfilModel.DegreeType.DIPLOM).ToString(), AppResources.Degree_Diploma));
|
||||
}
|
||||
|
||||
#endregion
|
||||
|
||||
#endregion
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,148 @@
|
||||
//-----------------------------------------------------------------------
|
||||
// <copyright file="ListPickerItemListModel.cs" company="BTU/IIT">
|
||||
// Company copyright tag.List
|
||||
// </copyright>
|
||||
// <author>stubbfel</author>
|
||||
// <sience>25.07.2013</sience>
|
||||
//----------------------------------------------------------------------
|
||||
namespace CampusAppWP8.Model.Utility
|
||||
{
|
||||
using System.Collections.Generic;
|
||||
|
||||
/// <summary>
|
||||
/// Class for a List of ListPickerItems
|
||||
/// </summary>
|
||||
public class ListPickerItemListModel
|
||||
{
|
||||
#region Members
|
||||
|
||||
/// <summary>
|
||||
/// reference of the itemList
|
||||
/// </summary>
|
||||
private List<ListPickerItemModel> list;
|
||||
|
||||
#endregion
|
||||
|
||||
#region Constructor
|
||||
|
||||
/// <summary>
|
||||
/// Initializes a new instance of the <see cref="ListPickerItemListModel" /> class.
|
||||
/// </summary>
|
||||
public ListPickerItemListModel()
|
||||
{
|
||||
this.list = new List<ListPickerItemModel>();
|
||||
this.LoadList();
|
||||
}
|
||||
|
||||
#endregion
|
||||
|
||||
#region Property
|
||||
|
||||
/// <summary>
|
||||
/// Gets or sets the ItemList
|
||||
/// </summary>
|
||||
public List<ListPickerItemModel> List
|
||||
{
|
||||
get
|
||||
{
|
||||
return this.list;
|
||||
}
|
||||
|
||||
set
|
||||
{
|
||||
if (value != this.list)
|
||||
{
|
||||
this.list = value;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
#endregion
|
||||
|
||||
#region Method
|
||||
|
||||
#region public
|
||||
|
||||
/// <summary>
|
||||
/// Method return a the Index of an item which has a certain value
|
||||
/// </summary>
|
||||
/// <param name="value">a certain value</param>
|
||||
/// <returns>return index of value or default(0)</returns>
|
||||
public virtual int GetIndexOrDefault(string value)
|
||||
{
|
||||
int index = 0;
|
||||
int i = 0;
|
||||
foreach (ListPickerItemModel item in this.list)
|
||||
{
|
||||
if (item.Value.Equals(value))
|
||||
{
|
||||
index = i;
|
||||
break;
|
||||
}
|
||||
|
||||
i++;
|
||||
}
|
||||
|
||||
return index;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// add an new item to the list
|
||||
/// </summary>
|
||||
/// <param name="value">value of the item</param>
|
||||
/// <param name="text">text of the item</param>
|
||||
public void AddItem(string value, string text)
|
||||
{
|
||||
this.AddItem(new ListPickerItemModel(value, text));
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// add an new item to the list
|
||||
/// </summary>
|
||||
/// <param name="item">new item of the list</param>
|
||||
public void AddItem(ListPickerItemModel item)
|
||||
{
|
||||
this.list.Add(item);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// remove an item
|
||||
/// </summary>
|
||||
/// <param name="value">value of the item</param>
|
||||
/// <param name="text">text of the item</param>
|
||||
/// <returns>true if removing was successful, otherwise false</returns>
|
||||
public bool RemoveItem(string value, string text)
|
||||
{
|
||||
return this.RemoveItem(new ListPickerItemModel(value, text));
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// remove an item
|
||||
/// </summary>
|
||||
/// <param name="item">item which has to be remove</param>
|
||||
/// <returns>true if removing was successful, otherwise false</returns>
|
||||
public bool RemoveItem(ListPickerItemModel item)
|
||||
{
|
||||
return this.list.Remove(item);
|
||||
}
|
||||
|
||||
#endregion
|
||||
|
||||
#region private
|
||||
|
||||
/// <summary>
|
||||
/// Method load an default list
|
||||
/// </summary>
|
||||
/// <remarks>
|
||||
/// load an empty list
|
||||
/// </remarks>
|
||||
protected virtual void LoadList()
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
#endregion
|
||||
|
||||
#endregion
|
||||
}
|
||||
}
|
||||
@@ -12,6 +12,24 @@ namespace CampusAppWP8.Model.Utility
|
||||
/// </summary>
|
||||
public class ListPickerItemModel
|
||||
{
|
||||
/// <summary>
|
||||
/// Initializes a new instance of the <see cref="ListPickerItemModel" /> class.
|
||||
/// </summary>
|
||||
public ListPickerItemModel()
|
||||
{
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Initializes a new instance of the <see cref="ListPickerItemModel" /> class.
|
||||
/// </summary>
|
||||
/// <param name="value">string for the value property of an item</param>
|
||||
/// <param name="text">string for the text property of an item</param>
|
||||
public ListPickerItemModel(string value, string text)
|
||||
{
|
||||
this.Value = value;
|
||||
this.Text = text;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Gets or sets the Value of an Item
|
||||
/// </summary>
|
||||
|
||||
@@ -0,0 +1,45 @@
|
||||
// <copyright file="RoleListPickerItemListModel.cs" company="BTU/IIT">
|
||||
// Company copyright tag.List
|
||||
// </copyright>
|
||||
// <author>stubbfel</author>
|
||||
// <sience>25.07.2013</sience>
|
||||
//----------------------------------------------------------------------
|
||||
namespace CampusAppWP8.Model.Utility
|
||||
{
|
||||
using CampusAppWP8.Resources;
|
||||
|
||||
/// <summary>
|
||||
/// Class for the RoleList
|
||||
/// </summary>
|
||||
public class RoleListPickerItemListModel : ListPickerItemListModel
|
||||
{
|
||||
#region Constructor
|
||||
|
||||
/// <summary>
|
||||
/// Initializes a new instance of the <see cref="RoleListPickerItemListModel" /> class.
|
||||
/// </summary>
|
||||
public RoleListPickerItemListModel()
|
||||
: base()
|
||||
{
|
||||
}
|
||||
|
||||
#endregion
|
||||
|
||||
#region Method
|
||||
|
||||
#region private
|
||||
|
||||
/// <summary>
|
||||
/// Overrides the LoadList-Method <see cref="ListPickerItemListModel"/>
|
||||
/// </summary>
|
||||
protected override void LoadList()
|
||||
{
|
||||
this.AddItem(new ListPickerItemModel(CampusAppWP8.Model.Setting.UserProfilModel.RoleType.STUDENT.ToString(), AppResources.Setting_RoleStudent));
|
||||
this.AddItem(new ListPickerItemModel(CampusAppWP8.Model.Setting.UserProfilModel.RoleType.STAFF.ToString(), AppResources.Setting_RoleStaff));
|
||||
}
|
||||
|
||||
#endregion
|
||||
|
||||
#endregion
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,46 @@
|
||||
// <copyright file="SemesterListPickerItemListModel.cs" company="BTU/IIT">
|
||||
// Company copyright tag.List
|
||||
// </copyright>
|
||||
// <author>stubbfel</author>
|
||||
// <sience>25.07.2013</sience>
|
||||
//----------------------------------------------------------------------
|
||||
namespace CampusAppWP8.Model.Utility
|
||||
{
|
||||
using CampusAppWP8.Resources;
|
||||
|
||||
/// <summary>
|
||||
/// Class for the SemesterList
|
||||
/// </summary>
|
||||
public class SemesterListPickerItemListModel : ListPickerItemListModel
|
||||
{
|
||||
#region Constructor
|
||||
|
||||
/// <summary>
|
||||
/// Initializes a new instance of the <see cref="SemesterListPickerItemListModel" /> class.
|
||||
/// </summary>
|
||||
public SemesterListPickerItemListModel()
|
||||
: base()
|
||||
{
|
||||
}
|
||||
|
||||
#endregion
|
||||
|
||||
#region Method
|
||||
|
||||
#region private
|
||||
|
||||
/// <summary>
|
||||
/// Overrides the LoadList-Method <see cref="ListPickerItemListModel"/>
|
||||
/// </summary>
|
||||
protected override void LoadList()
|
||||
{
|
||||
this.AddItem(new ListPickerItemModel("20131", "SoSe 13"));
|
||||
this.AddItem(new ListPickerItemModel("20132", "WiSe 13/14"));
|
||||
this.AddItem(new ListPickerItemModel("20141", "SoSe 14"));
|
||||
}
|
||||
|
||||
#endregion
|
||||
|
||||
#endregion
|
||||
}
|
||||
}
|
||||
@@ -38,6 +38,7 @@ namespace CampusAppWP8.Model
|
||||
public XmlModel(ModelType modelType, string sourceName)
|
||||
: base(modelType, sourceName)
|
||||
{
|
||||
this.ValidRootName = Constants.XMLRootElementName;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
|
||||
@@ -101,11 +101,11 @@ namespace CampusAppWP8.Pages.Lecture
|
||||
/// </summary>
|
||||
private void SetupListPickers()
|
||||
{
|
||||
this.Course.ItemsSource = this.pageModel.CourseList;
|
||||
this.Degree.ItemsSource = this.pageModel.DegreeList;
|
||||
this.From.ItemsSource = this.pageModel.FromNumberList;
|
||||
this.To.ItemsSource = this.pageModel.ToNumberList;
|
||||
this.Semester.ItemsSource = this.pageModel.SemesterList;
|
||||
this.Course.ItemsSource = this.pageModel.CourseList.List;
|
||||
this.Degree.ItemsSource = this.pageModel.DegreeList.List;
|
||||
this.From.ItemsSource = this.pageModel.FromNumberList.List;
|
||||
this.To.ItemsSource = this.pageModel.ToNumberList.List;
|
||||
this.Semester.ItemsSource = this.pageModel.SemesterList.List;
|
||||
|
||||
// load values from last request
|
||||
LecturePageModel lastPageModel = App.LoadFromIsolatedStorage<LecturePageModel>(Constants.IsolatedStorage_LecturePageModel);
|
||||
@@ -218,7 +218,7 @@ namespace CampusAppWP8.Pages.Lecture
|
||||
|
||||
this.pageModel.SelectDegreeIndex = this.Degree.SelectedIndex;
|
||||
this.pageModel.LoadFromNumberList();
|
||||
this.From.ItemsSource = this.pageModel.FromNumberList;
|
||||
this.From.ItemsSource = this.pageModel.FromNumberList.List;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
@@ -236,7 +236,7 @@ namespace CampusAppWP8.Pages.Lecture
|
||||
this.pageModel.SelectDegreeIndex = this.Degree.SelectedIndex;
|
||||
this.pageModel.SelectFromIndex = this.From.SelectedIndex;
|
||||
this.pageModel.LoadToNumberList();
|
||||
this.To.ItemsSource = this.pageModel.ToNumberList;
|
||||
this.To.ItemsSource = this.pageModel.ToNumberList.List;
|
||||
}
|
||||
|
||||
#endregion
|
||||
|
||||
134
CampusAppWP8/CampusAppWP8/Pages/Setting/UserProfil.xaml
Normal file
134
CampusAppWP8/CampusAppWP8/Pages/Setting/UserProfil.xaml
Normal file
@@ -0,0 +1,134 @@
|
||||
<phone:PhoneApplicationPage
|
||||
x:Class="CampusAppWP8.Pages.Setting.UserProfil"
|
||||
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:toolkit="clr-namespace:Microsoft.Phone.Controls;assembly=Microsoft.Phone.Controls.Toolkit"
|
||||
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-->
|
||||
<ProgressBar Name="ProgressBar" Grid.Row="1" Visibility="Collapsed" IsIndeterminate="True"/>
|
||||
|
||||
<StackPanel Grid.Row="0" Margin="12,17,0,28">
|
||||
<TextBlock Text="{Binding Path=LocalizedResources.ApplicationTitle, Source={StaticResource LocalizedStrings}}" Style="{StaticResource PhoneTextNormalStyle}"/>
|
||||
<TextBlock Text="{Binding Path=LocalizedResources.Setting_User, Source={StaticResource LocalizedStrings}}" Style="{StaticResource PhoneTextTitle2Style}"/>
|
||||
</StackPanel>
|
||||
|
||||
<!--ContentPanel - zusätzliche Inhalte hier platzieren-->
|
||||
<Grid x:Name="ContentPanel" Grid.Row="1" Margin="12,0,12,0">
|
||||
<Grid.RowDefinitions>
|
||||
<RowDefinition Height="Auto"/>
|
||||
<RowDefinition Height="Auto"/>
|
||||
<RowDefinition Height="Auto"/>
|
||||
<RowDefinition Height="*"/>
|
||||
</Grid.RowDefinitions>
|
||||
<Grid.ColumnDefinitions>
|
||||
<ColumnDefinition Width="*"/>
|
||||
</Grid.ColumnDefinitions>
|
||||
|
||||
<Border BorderBrush="{StaticResource PhoneBorderBrush}" BorderThickness="0,2,0,0" Grid.Row="0">
|
||||
<StackPanel >
|
||||
<TextBlock Text="{Binding Path=LocalizedResources.Setting_UserCourse, Source={StaticResource LocalizedStrings}}"/>
|
||||
<!-- Listpicket of courses -->
|
||||
<toolkit:ListPicker Name="Course" ExpansionMode="FullScreenOnly" FullModeHeader="{Binding Path=LocalizedResources.LectureApp_ListPickerHeaderCourse, Source={StaticResource LocalizedStrings}}" >
|
||||
<toolkit:ListPicker.ItemTemplate>
|
||||
<DataTemplate>
|
||||
<StackPanel>
|
||||
<TextBlock Text="{Binding Text}"/>
|
||||
</StackPanel>
|
||||
</DataTemplate>
|
||||
</toolkit:ListPicker.ItemTemplate>
|
||||
<toolkit:ListPicker.FullModeItemTemplate>
|
||||
<DataTemplate>
|
||||
<Border BorderBrush="{StaticResource PhoneAccentBrush}" BorderThickness="12,0,0,0" Margin="0,0,0,6">
|
||||
<TextBlock Text="{Binding Text}" Style="{StaticResource PhoneTextGroupHeaderStyle}" TextWrapping="Wrap"/>
|
||||
</Border>
|
||||
</DataTemplate>
|
||||
</toolkit:ListPicker.FullModeItemTemplate>
|
||||
</toolkit:ListPicker>
|
||||
</StackPanel>
|
||||
</Border>
|
||||
<Border BorderBrush="{StaticResource PhoneBorderBrush}" BorderThickness="0,2,0,0" Grid.Row="1">
|
||||
<StackPanel >
|
||||
<!-- Listpicket of degree-->
|
||||
<TextBlock Text="{Binding Path=LocalizedResources.Setting_UserDegree, Source={StaticResource LocalizedStrings}}"/>
|
||||
<toolkit:ListPicker Name="Degree" ExpansionMode="FullScreenOnly">
|
||||
<toolkit:ListPicker.ItemTemplate>
|
||||
<DataTemplate>
|
||||
<StackPanel>
|
||||
<TextBlock Text="{Binding Text}"/>
|
||||
</StackPanel>
|
||||
</DataTemplate>
|
||||
</toolkit:ListPicker.ItemTemplate>
|
||||
<toolkit:ListPicker.FullModeItemTemplate>
|
||||
<DataTemplate>
|
||||
<Border BorderBrush="{StaticResource PhoneAccentBrush}" BorderThickness="12,0,0,0" Margin="0,0,0,6">
|
||||
<TextBlock Text="{Binding Text}" Style="{StaticResource PhoneTextGroupHeaderStyle}" TextWrapping="Wrap"/>
|
||||
</Border>
|
||||
</DataTemplate>
|
||||
</toolkit:ListPicker.FullModeItemTemplate>
|
||||
</toolkit:ListPicker>
|
||||
</StackPanel>
|
||||
</Border>
|
||||
<Border BorderBrush="{StaticResource PhoneBorderBrush}" BorderThickness="0,2,0,0" Grid.Row="2">
|
||||
<StackPanel >
|
||||
<TextBlock Text="{Binding Path=LocalizedResources.Setting_UserSemester, Source={StaticResource LocalizedStrings}}"/>
|
||||
<!-- Listpicket of courses -->
|
||||
<toolkit:ListPicker Name="Semster" ExpansionMode="FullScreenOnly" FullModeHeader="{Binding Path=LocalizedResources.LectureApp_ListPickerHeaderCourse, Source={StaticResource LocalizedStrings}}" >
|
||||
<toolkit:ListPicker.ItemTemplate>
|
||||
<DataTemplate>
|
||||
<StackPanel>
|
||||
<TextBlock Text="{Binding Text}"/>
|
||||
</StackPanel>
|
||||
</DataTemplate>
|
||||
</toolkit:ListPicker.ItemTemplate>
|
||||
<toolkit:ListPicker.FullModeItemTemplate>
|
||||
<DataTemplate>
|
||||
<Border BorderBrush="{StaticResource PhoneAccentBrush}" BorderThickness="12,0,0,0" Margin="0,0,0,6">
|
||||
<TextBlock Text="{Binding Text}" Style="{StaticResource PhoneTextGroupHeaderStyle}" TextWrapping="Wrap"/>
|
||||
</Border>
|
||||
</DataTemplate>
|
||||
</toolkit:ListPicker.FullModeItemTemplate>
|
||||
</toolkit:ListPicker>
|
||||
</StackPanel>
|
||||
</Border>
|
||||
<Border BorderBrush="{StaticResource PhoneBorderBrush}" BorderThickness="0,2,0,0" Grid.Row="3">
|
||||
<StackPanel >
|
||||
<TextBlock Text="{Binding Path=LocalizedResources.Setting_UserRole, Source={StaticResource LocalizedStrings}}"/>
|
||||
<!-- Listpicket of courses -->
|
||||
<toolkit:ListPicker Name="Role" ExpansionMode="FullScreenOnly" FullModeHeader="{Binding Path=LocalizedResources.LectureApp_ListPickerHeaderCourse, Source={StaticResource LocalizedStrings}}" >
|
||||
<toolkit:ListPicker.ItemTemplate>
|
||||
<DataTemplate>
|
||||
<StackPanel>
|
||||
<TextBlock Text="{Binding Text}"/>
|
||||
</StackPanel>
|
||||
</DataTemplate>
|
||||
</toolkit:ListPicker.ItemTemplate>
|
||||
<toolkit:ListPicker.FullModeItemTemplate>
|
||||
<DataTemplate>
|
||||
<Border BorderBrush="{StaticResource PhoneAccentBrush}" BorderThickness="12,0,0,0" Margin="0,0,0,6">
|
||||
<TextBlock Text="{Binding Text}" Style="{StaticResource PhoneTextGroupHeaderStyle}" TextWrapping="Wrap"/>
|
||||
</Border>
|
||||
</DataTemplate>
|
||||
</toolkit:ListPicker.FullModeItemTemplate>
|
||||
</toolkit:ListPicker>
|
||||
</StackPanel>
|
||||
</Border>
|
||||
</Grid>
|
||||
</Grid>
|
||||
</phone:PhoneApplicationPage>
|
||||
90
CampusAppWP8/CampusAppWP8/Pages/Setting/UserProfil.xaml.cs
Normal file
90
CampusAppWP8/CampusAppWP8/Pages/Setting/UserProfil.xaml.cs
Normal file
@@ -0,0 +1,90 @@
|
||||
//-----------------------------------------------------------------------
|
||||
// <copyright file="UserProfil.xaml.cs" company="BTU/IIT">
|
||||
// Company copyright tag.
|
||||
// </copyright>
|
||||
// <author>stubbfel</author>
|
||||
// <sience>23.07.2013</sience>
|
||||
//----------------------------------------------------------------------
|
||||
namespace CampusAppWP8.Pages.Setting
|
||||
{
|
||||
using System;
|
||||
using System.Windows.Navigation;
|
||||
using CampusAppWP8.File.Setting;
|
||||
using CampusAppWP8.Model.Utility;
|
||||
using CampusAppWP8.Utility;
|
||||
using Microsoft.Phone.Controls;
|
||||
|
||||
/// <summary>
|
||||
/// Class for the UserProfilePage
|
||||
/// </summary>
|
||||
public partial class UserProfil : PhoneApplicationPage
|
||||
{
|
||||
/// <summary>
|
||||
/// Reference of the profileFile
|
||||
/// </summary>
|
||||
private UserProfilFile userFile;
|
||||
|
||||
/// <summary>
|
||||
/// Initializes a new instance of the <see cref="UserProfil" /> class.
|
||||
/// </summary>
|
||||
public UserProfil()
|
||||
{
|
||||
this.InitializeComponent();
|
||||
this.userFile = Settings.UserProfil;
|
||||
|
||||
this.SetupListPickers();
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Override the OnNavigatedFrom method
|
||||
/// </summary>
|
||||
/// <param name="e">Arguments of navigation</param>
|
||||
protected override void OnNavigatedFrom(NavigationEventArgs e)
|
||||
{
|
||||
if (NavigationMode.Back == e.NavigationMode)
|
||||
{
|
||||
this.SaveProfile();
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Method sets the ItemSource of the ListPickers
|
||||
/// </summary>
|
||||
private void SetupListPickers()
|
||||
{
|
||||
CourseListPickerItemListModel courseList = new CourseListPickerItemListModel();
|
||||
DegreeListPickerItemListModel degreeList = new DegreeListPickerItemListModel();
|
||||
SemesterListPickerItemListModel semesterList = new SemesterListPickerItemListModel();
|
||||
RoleListPickerItemListModel roleList = new RoleListPickerItemListModel();
|
||||
|
||||
this.Course.ItemsSource = courseList.List;
|
||||
this.Degree.ItemsSource = degreeList.List;
|
||||
this.Semster.ItemsSource = semesterList.List;
|
||||
this.Role.ItemsSource = roleList.List;
|
||||
|
||||
this.Course.SelectedIndex = courseList.GetIndexOrDefault(this.userFile.Model.Course.ToString().PadLeft(3, '0'));
|
||||
this.Degree.SelectedIndex = degreeList.GetIndexOrDefault(((int)this.userFile.Model.Degree).ToString());
|
||||
this.Semster.SelectedIndex = semesterList.GetIndexOrDefault(this.userFile.Model.Semester.ToString());
|
||||
this.Role.SelectedIndex = roleList.GetIndexOrDefault(this.userFile.Model.Role.ToString());
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Method save the current profile
|
||||
/// </summary>
|
||||
private void SaveProfile()
|
||||
{
|
||||
try
|
||||
{
|
||||
this.userFile.Model.Course = int.Parse(((ListPickerItemModel)this.Course.SelectedItem).Value);
|
||||
this.userFile.Model.Degree = (CampusAppWP8.Model.Setting.UserProfilModel.DegreeType)Enum.Parse(typeof(CampusAppWP8.Model.Setting.UserProfilModel.DegreeType), ((ListPickerItemModel)this.Degree.SelectedItem).Value);
|
||||
this.userFile.Model.Semester = int.Parse(((ListPickerItemModel)this.Semster.SelectedItem).Value);
|
||||
this.userFile.Model.Role = (CampusAppWP8.Model.Setting.UserProfilModel.RoleType)Enum.Parse(typeof(CampusAppWP8.Model.Setting.UserProfilModel.RoleType), ((ListPickerItemModel)this.Role.SelectedItem).Value);
|
||||
this.userFile.SaveData();
|
||||
}
|
||||
catch (Exception e)
|
||||
{
|
||||
Logger.LogException(e);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -137,5 +137,11 @@
|
||||
|
||||
<!-- <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>
|
||||
|
||||
<phone:PhoneApplicationPage.ApplicationBar>
|
||||
<shell:ApplicationBar IsVisible="True" IsMenuEnabled="True" Mode="Minimized" StateChanged="ApplicationBar_StateChanged" Opacity="0.5" >
|
||||
<shell:ApplicationBar.MenuItems>
|
||||
<shell:ApplicationBarMenuItem Text="Setting" Click="ApplicationBarMenuItem_Click"/>
|
||||
</shell:ApplicationBar.MenuItems>
|
||||
</shell:ApplicationBar>
|
||||
</phone:PhoneApplicationPage.ApplicationBar>
|
||||
</phone:PhoneApplicationPage>
|
||||
@@ -13,6 +13,7 @@ namespace CampusAppWP8.Pages
|
||||
using System.Windows.Navigation;
|
||||
using CampusAppWP8.Resources;
|
||||
using Microsoft.Phone.Controls;
|
||||
using Microsoft.Phone.Shell;
|
||||
|
||||
/// <summary>
|
||||
/// Class for the StartPage
|
||||
@@ -25,6 +26,11 @@ namespace CampusAppWP8.Pages
|
||||
public StartPage()
|
||||
{
|
||||
this.InitializeComponent();
|
||||
ApplicationBarMenuItem menuItem1 = ApplicationBar.MenuItems[0] as ApplicationBarMenuItem;
|
||||
if (menuItem1 != null)
|
||||
{
|
||||
menuItem1.Text = AppResources.Setting_UserProfilAppBarTitle;
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
@@ -74,10 +80,22 @@ namespace CampusAppWP8.Pages
|
||||
}
|
||||
}
|
||||
|
||||
private void OpenDepartmentApp(object sender, RoutedEventArgs e)
|
||||
private void ApplicationBarMenuItem_Click(object sender, EventArgs e)
|
||||
{
|
||||
Uri url = new Uri(Constants.PathDepartment_DepartmentIndexPage, UriKind.Relative);
|
||||
Uri url = new Uri(Constants.PathSetting_User, UriKind.Relative);
|
||||
NavigationService.Navigate(url);
|
||||
}
|
||||
|
||||
private void ApplicationBar_StateChanged(object sender, ApplicationBarStateChangedEventArgs e)
|
||||
{
|
||||
if (e.IsMenuVisible)
|
||||
{
|
||||
ApplicationBar.Opacity = 0.99;
|
||||
}
|
||||
else
|
||||
{
|
||||
ApplicationBar.Opacity = 0.5;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -573,6 +573,78 @@ namespace CampusAppWP8.Resources {
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Sucht eine lokalisierte Zeichenfolge, die Mitarbeiter ähnelt.
|
||||
/// </summary>
|
||||
public static string Setting_RoleStaff {
|
||||
get {
|
||||
return ResourceManager.GetString("Setting_RoleStaff", resourceCulture);
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Sucht eine lokalisierte Zeichenfolge, die Student ähnelt.
|
||||
/// </summary>
|
||||
public static string Setting_RoleStudent {
|
||||
get {
|
||||
return ResourceManager.GetString("Setting_RoleStudent", resourceCulture);
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Sucht eine lokalisierte Zeichenfolge, die Profileinstellungen ähnelt.
|
||||
/// </summary>
|
||||
public static string Setting_User {
|
||||
get {
|
||||
return ResourceManager.GetString("Setting_User", resourceCulture);
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Sucht eine lokalisierte Zeichenfolge, die Studiengang ähnelt.
|
||||
/// </summary>
|
||||
public static string Setting_UserCourse {
|
||||
get {
|
||||
return ResourceManager.GetString("Setting_UserCourse", resourceCulture);
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Sucht eine lokalisierte Zeichenfolge, die Abschluss ähnelt.
|
||||
/// </summary>
|
||||
public static string Setting_UserDegree {
|
||||
get {
|
||||
return ResourceManager.GetString("Setting_UserDegree", resourceCulture);
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Sucht eine lokalisierte Zeichenfolge, die Profileinstellungen ähnelt.
|
||||
/// </summary>
|
||||
public static string Setting_UserProfilAppBarTitle {
|
||||
get {
|
||||
return ResourceManager.GetString("Setting_UserProfilAppBarTitle", resourceCulture);
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Sucht eine lokalisierte Zeichenfolge, die Rolle ähnelt.
|
||||
/// </summary>
|
||||
public static string Setting_UserRole {
|
||||
get {
|
||||
return ResourceManager.GetString("Setting_UserRole", resourceCulture);
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Sucht eine lokalisierte Zeichenfolge, die Semster ähnelt.
|
||||
/// </summary>
|
||||
public static string Setting_UserSemester {
|
||||
get {
|
||||
return ResourceManager.GetString("Setting_UserSemester", resourceCulture);
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Sucht eine lokalisierte Zeichenfolge, die Freitag ähnelt.
|
||||
/// </summary>
|
||||
|
||||
@@ -320,4 +320,28 @@
|
||||
<data name="UpdateBtn" xml:space="preserve">
|
||||
<value>Aktualisieren</value>
|
||||
</data>
|
||||
<data name="Setting_User" xml:space="preserve">
|
||||
<value>Profileinstellungen</value>
|
||||
</data>
|
||||
<data name="Setting_UserCourse" xml:space="preserve">
|
||||
<value>Studiengang</value>
|
||||
</data>
|
||||
<data name="Setting_UserDegree" xml:space="preserve">
|
||||
<value>Abschluss</value>
|
||||
</data>
|
||||
<data name="Setting_UserProfilAppBarTitle" xml:space="preserve">
|
||||
<value>Profileinstellungen</value>
|
||||
</data>
|
||||
<data name="Setting_UserRole" xml:space="preserve">
|
||||
<value>Rolle</value>
|
||||
</data>
|
||||
<data name="Setting_UserSemester" xml:space="preserve">
|
||||
<value>Semster</value>
|
||||
</data>
|
||||
<data name="Setting_RoleStaff" xml:space="preserve">
|
||||
<value>Mitarbeiter</value>
|
||||
</data>
|
||||
<data name="Setting_RoleStudent" xml:space="preserve">
|
||||
<value>Student</value>
|
||||
</data>
|
||||
</root>
|
||||
@@ -132,6 +132,15 @@ namespace CampusAppWP8.Resources {
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Sucht eine lokalisierte Zeichenfolge, die user.xml ähnelt.
|
||||
/// </summary>
|
||||
public static string FileProfil_User {
|
||||
get {
|
||||
return ResourceManager.GetString("FileProfil_User", resourceCulture);
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Sucht eine lokalisierte Zeichenfolge, die StudentCouncils.xml ähnelt.
|
||||
/// </summary>
|
||||
@@ -438,6 +447,15 @@ namespace CampusAppWP8.Resources {
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Sucht eine lokalisierte Zeichenfolge, die /Pages/Setting/UserProfil.xaml ähnelt.
|
||||
/// </summary>
|
||||
public static string PathSetting_User {
|
||||
get {
|
||||
return ResourceManager.GetString("PathSetting_User", resourceCulture);
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Sucht eine lokalisierte Zeichenfolge, die /Pages/StudentCouncil/StudentCouncilPage.xaml ähnelt.
|
||||
/// </summary>
|
||||
@@ -447,6 +465,24 @@ namespace CampusAppWP8.Resources {
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Sucht eine lokalisierte Zeichenfolge, die 767 ähnelt.
|
||||
/// </summary>
|
||||
public static string Setting_DefaultCourseNumber {
|
||||
get {
|
||||
return ResourceManager.GetString("Setting_DefaultCourseNumber", resourceCulture);
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Sucht eine lokalisierte Zeichenfolge, die 20131 ähnelt.
|
||||
/// </summary>
|
||||
public static string Setting_DefaultSemester {
|
||||
get {
|
||||
return ResourceManager.GetString("Setting_DefaultSemester", resourceCulture);
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Sucht eine lokalisierte Zeichenfolge, die ToggleContent ähnelt.
|
||||
/// </summary>
|
||||
@@ -555,6 +591,33 @@ namespace CampusAppWP8.Resources {
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Sucht eine lokalisierte Zeichenfolge, die 20121 ähnelt.
|
||||
/// </summary>
|
||||
public static string Valid_FirstSemseter {
|
||||
get {
|
||||
return ResourceManager.GetString("Valid_FirstSemseter", resourceCulture);
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Sucht eine lokalisierte Zeichenfolge, die 20502 ähnelt.
|
||||
/// </summary>
|
||||
public static string Valid_LastSemseter {
|
||||
get {
|
||||
return ResourceManager.GetString("Valid_LastSemseter", resourceCulture);
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Sucht eine lokalisierte Zeichenfolge, die 999 ähnelt.
|
||||
/// </summary>
|
||||
public static string Valid_MaxCourseNumber {
|
||||
get {
|
||||
return ResourceManager.GetString("Valid_MaxCourseNumber", resourceCulture);
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Sucht eine lokalisierte Zeichenfolge, die root ähnelt.
|
||||
/// </summary>
|
||||
|
||||
@@ -284,5 +284,26 @@
|
||||
</data>
|
||||
<data name="IsolatedStorage_OpeninghoursModel" xml:space="preserve">
|
||||
<value>IsolatedStorage_OpeninghoursModel</value>
|
||||
</data>
|
||||
<data name="FileProfil_User" xml:space="preserve">
|
||||
<value>user.xml</value>
|
||||
</data>
|
||||
<data name="PathSetting_User" xml:space="preserve">
|
||||
<value>/Pages/Setting/UserProfil.xaml</value>
|
||||
</data>
|
||||
<data name="Setting_DefaultCourseNumber" xml:space="preserve">
|
||||
<value>767</value>
|
||||
</data>
|
||||
<data name="Setting_DefaultSemester" xml:space="preserve">
|
||||
<value>20131</value>
|
||||
</data>
|
||||
<data name="Valid_FirstSemseter" xml:space="preserve">
|
||||
<value>20121</value>
|
||||
</data>
|
||||
<data name="Valid_LastSemseter" xml:space="preserve">
|
||||
<value>20502</value>
|
||||
</data>
|
||||
<data name="Valid_MaxCourseNumber" xml:space="preserve">
|
||||
<value>999</value>
|
||||
</data>
|
||||
</root>
|
||||
42
CampusAppWP8/CampusAppWP8/Settings.cs
Normal file
42
CampusAppWP8/CampusAppWP8/Settings.cs
Normal file
@@ -0,0 +1,42 @@
|
||||
//-----------------------------------------------------------------------
|
||||
// <copyright file="Settings.cs" company="BTU/IIT">
|
||||
// Company copyright tag.
|
||||
// </copyright>
|
||||
// <author>stubbfel</author>
|
||||
// <sience>23.07.2013</sience>
|
||||
//----------------------------------------------------------------------
|
||||
|
||||
namespace CampusAppWP8
|
||||
{
|
||||
using CampusAppWP8.File.Setting;
|
||||
|
||||
/// <summary>
|
||||
/// Class handle all setting (files)
|
||||
/// </summary>
|
||||
public static class Settings
|
||||
{
|
||||
/// <summary>
|
||||
/// reference of the user-profile-file
|
||||
/// </summary>
|
||||
private static UserProfilFile userProfil = new UserProfilFile();
|
||||
|
||||
/// <summary>
|
||||
/// Gets or sets the user-profile-file
|
||||
/// </summary>
|
||||
public static UserProfilFile UserProfil
|
||||
{
|
||||
get
|
||||
{
|
||||
return Settings.userProfil;
|
||||
}
|
||||
|
||||
set
|
||||
{
|
||||
if (value != Settings.userProfil)
|
||||
{
|
||||
Settings.userProfil = value;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user