diff --git a/CampusAppWP8/CampusAppWP8/Api/Person/PersonSearchApi.cs b/CampusAppWP8/CampusAppWP8/Api/Person/PersonSearchApi.cs
index a982fb99..e44e2dbd 100644
--- a/CampusAppWP8/CampusAppWP8/Api/Person/PersonSearchApi.cs
+++ b/CampusAppWP8/CampusAppWP8/Api/Person/PersonSearchApi.cs
@@ -15,7 +15,7 @@ namespace CampusAppWP8.Api.Person
/// Person search api.
/// Stubbfel, 05.09.2013.
- public class PersonSearchApi : XmlModel
+ public class PersonSearchApi : XmlModel
{
#region Constructor
diff --git a/CampusAppWP8/CampusAppWP8/CampusAppWP8.csproj b/CampusAppWP8/CampusAppWP8/CampusAppWP8.csproj
index 0450dc67..636dcfc6 100644
--- a/CampusAppWP8/CampusAppWP8/CampusAppWP8.csproj
+++ b/CampusAppWP8/CampusAppWP8/CampusAppWP8.csproj
@@ -127,9 +127,9 @@
-
-
-
+
+
+
diff --git a/CampusAppWP8/CampusAppWP8/Model/Person/PersonFunctionWp8Model.cs b/CampusAppWP8/CampusAppWP8/Model/Person/PersonFunctionWp8Model.cs
new file mode 100644
index 00000000..09876067
--- /dev/null
+++ b/CampusAppWP8/CampusAppWP8/Model/Person/PersonFunctionWp8Model.cs
@@ -0,0 +1,77 @@
+//-----------------------------------------------------------------------------
+//
+// Company copyright tag.
+//
+// stubbfel
+// 05.09.2013
+//-----------------------------------------------------------------------------
+namespace CampusAppWP8.Model.Person
+{
+ using System.Xml.Serialization;
+ using CampusAppWP8.Utility;
+
+ /// Person function model.
+ /// Stubbfel, 05.09.2013.
+ public class PersonFunctionWp8Model : CampusAppWPortalLib8.Model.Person.PersonFunctionModel
+ {
+ #region Property
+
+ /// Gets or sets the function.
+ /// The function.
+ [XmlAttribute("funktion")]
+ public new string Function
+ {
+ get
+ {
+ return base.Function;
+ }
+
+ set
+ {
+ if (value != this.Function)
+ {
+ base.Function = Wp8StringManager.StripAndDecodeHTML(value);
+ }
+ }
+ }
+
+ /// Gets or sets the appointment.
+ /// The appointment.
+ [XmlAttribute("einrichtung")]
+ public new string Appointment
+ {
+ get
+ {
+ return base.Appointment;
+ }
+
+ set
+ {
+ if (value != this.Appointment)
+ {
+ base.Appointment = Wp8StringManager.StripAndDecodeHTML(value);
+ }
+ }
+ }
+
+ /// Gets or sets the building.
+ /// The building.
+ [XmlAttribute("gebaeude")]
+ public new string Building
+ {
+ get
+ {
+ return base.Building;
+ }
+
+ set
+ {
+ if (value != this.Building)
+ {
+ base.Building = Wp8StringManager.StripAndDecodeHTML(value);
+ }
+ }
+ }
+ #endregion
+ }
+}
diff --git a/CampusAppWP8/CampusAppWP8/Model/Person/PersonListWp8Model.cs b/CampusAppWP8/CampusAppWP8/Model/Person/PersonListWp8Model.cs
new file mode 100644
index 00000000..e3135c13
--- /dev/null
+++ b/CampusAppWP8/CampusAppWP8/Model/Person/PersonListWp8Model.cs
@@ -0,0 +1,29 @@
+//-----------------------------------------------------------------------------
+//
+// Company copyright tag.
+//
+// stubbfel
+// 05.09.2013
+//-----------------------------------------------------------------------------
+
+namespace CampusAppWP8.Model.Person
+{
+ using System.Xml.Serialization;
+ using CampusAppWPortalLib8.Model.Person;
+
+ /// Person list model.
+ /// Stubbfel, 05.09.2013.
+ [XmlRoot("Uebersicht")]
+ public class PersonListWp8Model : CampusAppWPortalLib8.Model.Person.PersonListModel
+ {
+ /// Gets a person.
+ /// Stubbfel, 05.09.2013.
+ /// The identifier.
+ /// The person.
+ public new PersonWp8Model GetPerson(string id)
+ {
+ IPersonModel tmpPerson = base.GetPerson(id);
+ return tmpPerson as PersonWp8Model;
+ }
+ }
+}
diff --git a/CampusAppWP8/CampusAppWP8/Pages/Person/PersonPage.xaml.cs b/CampusAppWP8/CampusAppWP8/Pages/Person/PersonPage.xaml.cs
index 289d4ad4..ac47c1e4 100644
--- a/CampusAppWP8/CampusAppWP8/Pages/Person/PersonPage.xaml.cs
+++ b/CampusAppWP8/CampusAppWP8/Pages/Person/PersonPage.xaml.cs
@@ -12,13 +12,12 @@ namespace CampusAppWP8.Pages.Person
using System.Windows;
using CampusAppWP8.Api.Person;
using CampusAppWP8.Model.Person;
- using CampusAppWP8.Model.Utility;
using CampusAppWP8.Resources;
using CampusAppWP8.Utility.Lui.Button;
using CampusAppWP8.Utility.Lui.MessageBoxes;
+ using CampusAppWPortalLib8.Model.Utility;
using Microsoft.Phone.Controls;
using Microsoft.Phone.Tasks;
- using CampusAppWPortalLib8.Model.Utility;
/// Person page.
/// Stubbfel, 09.09.2013.
@@ -115,7 +114,7 @@ namespace CampusAppWP8.Pages.Person
string personID = btn.PersonId as string;
int functionIndex = (int)btn.FunctionIndex;
- PersonModel person = this.api.Model.GetPerson(personID);
+ PersonWp8Model person = this.api.Model.GetPerson(personID);
if (person == null)
{
return;
diff --git a/CampusAppWP8/CampusAppWPortalLib8/Model/Person/IPersonFunctionModel.cs b/CampusAppWP8/CampusAppWPortalLib8/Model/Person/IPersonFunctionModel.cs
new file mode 100644
index 00000000..6bc47b1b
--- /dev/null
+++ b/CampusAppWP8/CampusAppWPortalLib8/Model/Person/IPersonFunctionModel.cs
@@ -0,0 +1,23 @@
+//-----------------------------------------------------------------------------
+//
+// Company copyright tag.
+//
+// stubbfel
+// 01.10.2013
+//-----------------------------------------------------------------------------
+namespace CampusAppWPortalLib8.Model.Person
+{
+ ///
+ /// Interface for PersonFunctionModel classes
+ ///
+ public interface IPersonFunctionModel
+ {
+ /// Gets or sets the identifier of the person.
+ /// The identifier of the person.
+ string PersonID { get; set; }
+
+ /// Gets or sets zero-based index of the function.
+ /// The function index.
+ int FunctionIndex { get; set; }
+ }
+}
diff --git a/CampusAppWP8/CampusAppWPortalLib8/Model/Person/IPersonModel.cs b/CampusAppWP8/CampusAppWPortalLib8/Model/Person/IPersonModel.cs
new file mode 100644
index 00000000..c56cfa3b
--- /dev/null
+++ b/CampusAppWP8/CampusAppWPortalLib8/Model/Person/IPersonModel.cs
@@ -0,0 +1,30 @@
+//-----------------------------------------------------------------------------
+//
+// Company copyright tag.
+//
+// stubbfel
+// 01.10.2013
+//-----------------------------------------------------------------------------
+namespace CampusAppWPortalLib8.Model.Person
+{
+ using System.Collections.ObjectModel;
+
+ ///
+ /// Interface for PersonModel classes
+ ///
+ /// PersonFunctionModel template
+ public interface IPersonModel
+ {
+ /// Gets or sets the functions of a person.
+ /// The functions.
+ ObservableCollection Functions { get; set; }
+
+ /// Gets or sets the identifier.
+ /// The identifier.
+ string ID { get; set; }
+
+ /// Sets person identifier to function.
+ /// Stubbfel, 05.09.2013.
+ void SetPersonIdToFunction();
+ }
+}
diff --git a/CampusAppWP8/CampusAppWP8/Model/Person/PersonFunctionModel.cs b/CampusAppWP8/CampusAppWPortalLib8/Model/Person/PersonFunctionModel.cs
similarity index 86%
rename from CampusAppWP8/CampusAppWP8/Model/Person/PersonFunctionModel.cs
rename to CampusAppWP8/CampusAppWPortalLib8/Model/Person/PersonFunctionModel.cs
index 0a0ddc9f..017e51df 100644
--- a/CampusAppWP8/CampusAppWP8/Model/Person/PersonFunctionModel.cs
+++ b/CampusAppWP8/CampusAppWPortalLib8/Model/Person/PersonFunctionModel.cs
@@ -5,14 +5,14 @@
// stubbfel
// 05.09.2013
//-----------------------------------------------------------------------------
-namespace CampusAppWP8.Model.Person
+namespace CampusAppWPortalLib8.Model.Person
{
using System.Xml.Serialization;
- using CampusAppWP8.Utility;
+ using CampusAppWPortalLib8.Utility;
/// Person function model.
/// Stubbfel, 05.09.2013.
- public class PersonFunctionModel
+ public class PersonFunctionModel : IPersonFunctionModel
{
#region Member
@@ -55,7 +55,7 @@ namespace CampusAppWP8.Model.Person
{
if (value != null && value != string.Empty && value != this.tel1)
{
- this.tel1 = Wp8StringManager.CreateUniTelefonNumber(value);
+ this.tel1 = DefaultStringManager.CreateUniTelefonNumber(value);
}
}
}
@@ -74,7 +74,7 @@ namespace CampusAppWP8.Model.Person
{
if (value != null && value != string.Empty && value != this.tel2)
{
- this.tel2 = Wp8StringManager.CreateUniTelefonNumber(value);
+ this.tel2 = DefaultStringManager.CreateUniTelefonNumber(value);
}
}
}
@@ -93,7 +93,7 @@ namespace CampusAppWP8.Model.Person
{
if (value != null && value != string.Empty && value != this.fax)
{
- this.fax = Wp8StringManager.CreateUniTelefonNumber(value);
+ this.fax = DefaultStringManager.CreateUniTelefonNumber(value);
}
}
}
@@ -112,7 +112,7 @@ namespace CampusAppWP8.Model.Person
{
if (value != this.function)
{
- this.function = Wp8StringManager.StripAndDecodeHTML(value);
+ this.function = value;
}
}
}
@@ -131,7 +131,7 @@ namespace CampusAppWP8.Model.Person
{
if (value != this.appointment)
{
- this.appointment = Wp8StringManager.StripAndDecodeHTML(value);
+ this.appointment = value;
}
}
}
@@ -150,7 +150,7 @@ namespace CampusAppWP8.Model.Person
{
if (value != this.building)
{
- this.building = Wp8StringManager.StripAndDecodeHTML(value);
+ this.building = value;
}
}
}
@@ -167,7 +167,7 @@ namespace CampusAppWP8.Model.Person
set
{
- if (value != null && value != this.mail && Wp8StringManager.IsValidEmail(value))
+ if (value != null && value != this.mail && DefaultStringManager.IsValidEmail(value))
{
this.mail = value;
}
diff --git a/CampusAppWP8/CampusAppWP8/Model/Person/PersonListModel.cs b/CampusAppWP8/CampusAppWPortalLib8/Model/Person/PersonListModel.cs
similarity index 64%
rename from CampusAppWP8/CampusAppWP8/Model/Person/PersonListModel.cs
rename to CampusAppWP8/CampusAppWPortalLib8/Model/Person/PersonListModel.cs
index 8af959d0..381e3a0f 100644
--- a/CampusAppWP8/CampusAppWP8/Model/Person/PersonListModel.cs
+++ b/CampusAppWP8/CampusAppWPortalLib8/Model/Person/PersonListModel.cs
@@ -6,7 +6,7 @@
// 05.09.2013
//-----------------------------------------------------------------------------
-namespace CampusAppWP8.Model.Person
+namespace CampusAppWPortalLib8.Model.Person
{
using System.Collections.Generic;
using System.Collections.ObjectModel;
@@ -14,15 +14,16 @@ namespace CampusAppWP8.Model.Person
/// Person list model.
/// Stubbfel, 05.09.2013.
+ /// personModel template
[XmlRoot("Uebersicht")]
- public class PersonListModel
+ public class PersonListModel
{
#region Property
/// Gets or sets the persons.
/// The persons.
[XmlElement("person")]
- public ObservableCollection Persons { get; set; }
+ public ObservableCollection Persons { get; set; }
#endregion
@@ -32,9 +33,13 @@ namespace CampusAppWP8.Model.Person
/// Stubbfel, 05.09.2013.
public void SetPersonIdToFunction()
{
- foreach (PersonModel person in this.Persons)
+ foreach (T item in this.Persons)
{
- person.SetPersonIdToFunction();
+ IPersonModel person = item as IPersonModel;
+ if (person != null)
+ {
+ person.SetPersonIdToFunction();
+ }
}
}
@@ -42,17 +47,23 @@ namespace CampusAppWP8.Model.Person
/// Stubbfel, 05.09.2013.
/// The identifier.
/// The person.
- public PersonModel GetPerson(string id)
+ public IPersonModel GetPerson(string id)
{
- foreach (PersonModel tmpPerson in this.Persons)
+ foreach (T item in this.Persons)
{
+ IPersonModel tmpPerson = item as IPersonModel;
+ if (tmpPerson == null)
+ {
+ continue;
+ }
+
if (tmpPerson.ID.Equals(id))
{
return tmpPerson;
}
}
- return null;
+ return default(IPersonModel);
}
/// Removes the non function and set identifiers person.
@@ -67,16 +78,22 @@ namespace CampusAppWP8.Model.Person
/// Stubbfel, 05.09.2013.
public void RemoveNonFunctionPerson()
{
- List removeList = new List();
- foreach (PersonModel tmpPerson in this.Persons)
+ List removeList = new List();
+ foreach (T item in this.Persons)
{
+ IPersonModel tmpPerson = item as IPersonModel;
+ if (tmpPerson == null)
+ {
+ continue;
+ }
+
if (tmpPerson.Functions.Count < 1)
{
- removeList.Add(tmpPerson);
+ removeList.Add(item);
}
}
- foreach (PersonModel removePerson in removeList)
+ foreach (T removePerson in removeList)
{
this.Persons.Remove(removePerson);
}
diff --git a/CampusAppWP8/CampusAppWP8/Model/Person/PersonModel.cs b/CampusAppWP8/CampusAppWPortalLib8/Model/Person/PersonModel.cs
similarity index 84%
rename from CampusAppWP8/CampusAppWP8/Model/Person/PersonModel.cs
rename to CampusAppWP8/CampusAppWPortalLib8/Model/Person/PersonModel.cs
index d4acbbcd..91623e1a 100644
--- a/CampusAppWP8/CampusAppWP8/Model/Person/PersonModel.cs
+++ b/CampusAppWP8/CampusAppWPortalLib8/Model/Person/PersonModel.cs
@@ -5,15 +5,15 @@
// stubbfel
// 05.09.2013
//-----------------------------------------------------------------------------
-namespace CampusAppWP8.Model.Person
+namespace CampusAppWPortalLib8.Model.Person
{
using System.Collections.ObjectModel;
using System.Xml.Serialization;
- using CampusAppWP8.Utility;
/// Person model.
/// Stubbfel, 05.09.2013.
- public class PersonModel
+ /// template for the PersonFunction-Class
+ public class PersonModel : IPersonModel
{
#region Member
@@ -30,7 +30,7 @@ namespace CampusAppWP8.Model.Person
private string id;
/// The functions.
- private ObservableCollection functions;
+ private ObservableCollection functions;
#endregion
@@ -70,7 +70,7 @@ namespace CampusAppWP8.Model.Person
{
if (value != this.akadgrad)
{
- this.akadgrad = Wp8StringManager.StripAndDecodeHTML(value);
+ this.akadgrad = value;
}
}
}
@@ -89,7 +89,7 @@ namespace CampusAppWP8.Model.Person
{
if (value != this.surName)
{
- this.surName = Wp8StringManager.StripAndDecodeHTML(value);
+ this.surName = value;
}
}
}
@@ -108,7 +108,7 @@ namespace CampusAppWP8.Model.Person
{
if (value != this.firstName)
{
- this.firstName = Wp8StringManager.StripAndDecodeHTML(value);
+ this.firstName = value;
}
}
}
@@ -116,7 +116,7 @@ namespace CampusAppWP8.Model.Person
/// Gets or sets the functions of a person.
/// The functions.
[XmlElement("funktion")]
- public ObservableCollection Functions
+ public ObservableCollection Functions
{
get
{
@@ -157,10 +157,14 @@ namespace CampusAppWP8.Model.Person
}
int index = 0;
- foreach (PersonFunctionModel function in this.functions)
+ foreach (T item in this.functions)
{
- function.PersonID = this.ID;
- function.FunctionIndex = index++;
+ IPersonFunctionModel function = item as IPersonFunctionModel;
+ if (function != null)
+ {
+ function.PersonID = this.ID;
+ function.FunctionIndex = index++;
+ }
}
}
diff --git a/CampusAppWP8/CampusAppWPortalLib8/Settings.StyleCop b/CampusAppWP8/CampusAppWPortalLib8/Settings.StyleCop
index e1e8289d..4bc40550 100644
--- a/CampusAppWP8/CampusAppWPortalLib8/Settings.StyleCop
+++ b/CampusAppWP8/CampusAppWPortalLib8/Settings.StyleCop
@@ -1,6 +1,7 @@
+ akadgrad
api
nfc
param