diff --git a/CampusAppWP8/CampusAppWP8/CampusAppWP8.csproj b/CampusAppWP8/CampusAppWP8/CampusAppWP8.csproj index 847a75fc..cc5f5a59 100644 --- a/CampusAppWP8/CampusAppWP8/CampusAppWP8.csproj +++ b/CampusAppWP8/CampusAppWP8/CampusAppWP8.csproj @@ -99,6 +99,7 @@ + diff --git a/CampusAppWP8/CampusAppWP8/Model/Mensa/MealModel.cs b/CampusAppWP8/CampusAppWP8/Model/Mensa/MealModel.cs new file mode 100644 index 00000000..4a6d2e8a --- /dev/null +++ b/CampusAppWP8/CampusAppWP8/Model/Mensa/MealModel.cs @@ -0,0 +1,267 @@ +//----------------------------------------------------------------------- +// +// Company copyright tag. +// +// stubbfel +// 06.08.2013 +//---------------------------------------------------------------------- +namespace CampusAppWP8.Model.Mensa +{ + using System.Xml.Serialization; + using CampusAppWP8.Resources; + + /// + /// Model for a meal + /// + public class MealModel + { + #region Members + + /// + /// Constant for the vegetarian icon + /// + private const string MealIconNameVegetarian = "CAROTTE"; + + /// + /// Constant for the free icon + /// + private const string MealIconNameFree = "FREI"; + + /// + /// Constant for the pig icon + /// + private const string MealIconNamePig = "SCHWEIN"; + + /// + /// Constant for the cow icon + /// + private const string MealIconNameCow = "RIND"; + + /// + /// Constant for the fowl icon + /// + private const string MealIconNameFowl = "GEFL"; + + /// + /// Constant for the cow-pig icon + /// + private const string MealIconNameCowPig = "RINDSCHWEIN"; + + /// + /// Constant for the fish icon + /// + private const string MealIconNameFish = "FISCH"; + + /// + /// Constant for the wild icon + /// + private const string MealIconNameWild = "WILD"; + + /// + /// Constant for the lamb icon + /// + private const string MealIconNameLamb = "LAMM"; + + /// + /// Variable for the id of the meal + /// + /// + /// ValueRange : 0 - 7 + /// + private int mealId; + + /// + /// Name of the meal + /// + private string mealName; + + /// + /// Name of the icon + /// + private string iconName; + + /// + /// Url of the icon + /// + private string iconUrl; + + /// + /// Description of the meal + /// + private string mealDesc; + + #endregion + + #region Proberty + + /// + /// Gets or sets the mealId + /// + /// + /// ValueRange : 0 - 7 + /// + [XmlAttribute("id")] + public int MealId + { + get + { + return this.mealId; + } + + set + { + if (value != this.mealId && value > -1 && value < 8) + { + this.mealId = value; + this.CreateMealName(); + } + } + } + + /// + /// Gets the mealName + /// + public string MealName + { + get + { + return this.mealName; + } + } + + /// + /// Gets or sets the iconName + /// + [XmlAttribute("icon")] + public string IconName + { + get + { + return this.iconName; + } + + set + { + if (value != this.iconName) + { + this.iconName = value; + this.CreateIconUrl(); + } + } + } + + /// + /// Gets the iconUrl + /// + public string IconUrl + { + get + { + return this.iconUrl; + } + } + + /// + /// Gets or sets the mealDescription + /// + [XmlAttribute("desc")] + public string MealDesc + { + get + { + return this.mealDesc; + } + + set + { + if (value != this.mealDesc) + { + this.mealDesc = value; + } + } + } + + #endregion + + #region Methods + + /// + /// Method create depends of the mealId the mealName + /// + private void CreateMealName() + { + switch (this.mealId) + { + case 0: + this.mealName = AppResources.MensaApp_Soup; + break; + case 1: + this.mealName = AppResources.MensaApp_Dinner1; + break; + case 2: + this.mealName = AppResources.MensaApp_Dinner2; + break; + case 3: + this.mealName = AppResources.MensaApp_Dinner3; + break; + case 4: + this.mealName = AppResources.MensaApp_Dinner4; + break; + case 5: + this.mealName = AppResources.MensaApp_Dinner5; + break; + case 6: + this.mealName = AppResources.MensaApp_Bio; + break; + case 7: + this.mealName = AppResources.MensaApp_Action; + break; + default: + this.mealName = string.Empty; + break; + } + } + + /// + /// Method create depends of the iconUrl the iconName + /// + private void CreateIconUrl() + { + switch (this.iconName) + { + case MealModel.MealIconNameVegetarian: + this.iconUrl = Icons.Info; + break; + case MealModel.MealIconNameFree: + this.iconUrl = Icons.Info; + break; + case MealModel.MealIconNameCowPig: + this.iconUrl = Icons.Info; + break; + case MealModel.MealIconNameFish: + this.iconUrl = Icons.Info; + break; + case MealModel.MealIconNameFowl: + this.iconUrl = Icons.Info; + break; + case MealModel.MealIconNameLamb: + this.iconUrl = Icons.Info; + break; + case MealModel.MealIconNamePig: + this.iconUrl = Icons.Info; + break; + case MealModel.MealIconNameWild: + this.iconUrl = Icons.Info; + break; + case MealModel.MealIconNameCow: + this.iconUrl = Icons.Info; + break; + default: + this.iconUrl = string.Empty; + break; + } + } + + #endregion + } +} diff --git a/CampusAppWP8/CampusAppWP8/Model/Mensa/MenuWeekModel.cs b/CampusAppWP8/CampusAppWP8/Model/Mensa/MenuWeekModel.cs index 4093eae8..de26c237 100644 --- a/CampusAppWP8/CampusAppWP8/Model/Mensa/MenuWeekModel.cs +++ b/CampusAppWP8/CampusAppWP8/Model/Mensa/MenuWeekModel.cs @@ -22,7 +22,11 @@ namespace CampusAppWP8.Model.Mensa /// Time when the model was created /// private readonly DateTime createTime; + + #endregion + #region Constructor + /// /// Initializes a new instance of the class. /// @@ -33,7 +37,7 @@ namespace CampusAppWP8.Model.Mensa #endregion - #region Constructor + #region Proberty /// /// Gets or sets the menus for the week @@ -42,9 +46,6 @@ namespace CampusAppWP8.Model.Mensa [XmlArrayItem("Tagesmenu")] public ObservableCollection Menus { get; set; } - #endregion - - #region Proberty /// /// Gets the creation time of the model /// diff --git a/CampusAppWP8/CampusAppWP8/Resources/AppResources.Designer.cs b/CampusAppWP8/CampusAppWP8/Resources/AppResources.Designer.cs index e9444955..e9372b2d 100644 --- a/CampusAppWP8/CampusAppWP8/Resources/AppResources.Designer.cs +++ b/CampusAppWP8/CampusAppWP8/Resources/AppResources.Designer.cs @@ -474,6 +474,15 @@ namespace CampusAppWP8.Resources { } } + /// + /// Sucht eine lokalisierte Zeichenfolge, die Essen 5 ähnelt. + /// + public static string MensaApp_Dinner5 { + get { + return ResourceManager.GetString("MensaApp_Dinner5", resourceCulture); + } + } + /// /// Sucht eine lokalisierte Zeichenfolge, die 84 ähnelt. /// @@ -492,6 +501,15 @@ namespace CampusAppWP8.Resources { } } + /// + /// Sucht eine lokalisierte Zeichenfolge, die Suppe ähnelt. + /// + public static string MensaApp_Soup { + get { + return ResourceManager.GetString("MensaApp_Soup", resourceCulture); + } + } + /// /// Sucht eine lokalisierte Zeichenfolge, die Mensaplan ähnelt. /// diff --git a/CampusAppWP8/CampusAppWP8/Resources/AppResources.resx b/CampusAppWP8/CampusAppWP8/Resources/AppResources.resx index f4c6f531..af5596e0 100644 --- a/CampusAppWP8/CampusAppWP8/Resources/AppResources.resx +++ b/CampusAppWP8/CampusAppWP8/Resources/AppResources.resx @@ -353,4 +353,10 @@ Semesterauswahl + + Essen 5 + + + Suppe + \ No newline at end of file diff --git a/CampusAppWP8/CampusAppWP8/Resources/Constants.Designer.cs b/CampusAppWP8/CampusAppWP8/Resources/Constants.Designer.cs index 479a1426..7520cb92 100644 --- a/CampusAppWP8/CampusAppWP8/Resources/Constants.Designer.cs +++ b/CampusAppWP8/CampusAppWP8/Resources/Constants.Designer.cs @@ -222,6 +222,87 @@ namespace CampusAppWP8.Resources { } } + /// + /// Sucht eine lokalisierte Zeichenfolge, die RIND ähnelt. + /// + public static string MealIconName_Cow { + get { + return ResourceManager.GetString("MealIconName_Cow", resourceCulture); + } + } + + /// + /// Sucht eine lokalisierte Zeichenfolge, die RINDSCHWEIN ähnelt. + /// + public static string MealIconName_CowPig { + get { + return ResourceManager.GetString("MealIconName_CowPig", resourceCulture); + } + } + + /// + /// Sucht eine lokalisierte Zeichenfolge, die FISCH ähnelt. + /// + public static string MealIconName_Fish { + get { + return ResourceManager.GetString("MealIconName_Fish", resourceCulture); + } + } + + /// + /// Sucht eine lokalisierte Zeichenfolge, die GEFL ähnelt. + /// + public static string MealIconName_Fowl { + get { + return ResourceManager.GetString("MealIconName_Fowl", resourceCulture); + } + } + + /// + /// Sucht eine lokalisierte Zeichenfolge, die FREI ähnelt. + /// + public static string MealIconName_Free { + get { + return ResourceManager.GetString("MealIconName_Free", resourceCulture); + } + } + + /// + /// Sucht eine lokalisierte Zeichenfolge, die LAMM ähnelt. + /// + public static string MealIconName_Lamb { + get { + return ResourceManager.GetString("MealIconName_Lamb", resourceCulture); + } + } + + /// + /// Sucht eine lokalisierte Zeichenfolge, die SCHWEIN ähnelt. + /// + public static string MealIconName_Pig { + get { + return ResourceManager.GetString("MealIconName_Pig", resourceCulture); + } + } + + /// + /// Sucht eine lokalisierte Zeichenfolge, die CAROTTE ähnelt. + /// + public static string MealIconName_Vegetarian { + get { + return ResourceManager.GetString("MealIconName_Vegetarian", resourceCulture); + } + } + + /// + /// Sucht eine lokalisierte Zeichenfolge, die WILD ähnelt. + /// + public static string MealIconName_Wild { + get { + return ResourceManager.GetString("MealIconName_Wild", resourceCulture); + } + } + /// /// Sucht eine lokalisierte Zeichenfolge, die Studiengang ähnelt. /// diff --git a/CampusAppWP8/CampusAppWP8/Resources/Constants.resx b/CampusAppWP8/CampusAppWP8/Resources/Constants.resx index ba9aa34f..adcdb9f9 100644 --- a/CampusAppWP8/CampusAppWP8/Resources/Constants.resx +++ b/CampusAppWP8/CampusAppWP8/Resources/Constants.resx @@ -284,7 +284,7 @@ IsolatedStorage_OpeninghoursModel - + user.xml @@ -306,4 +306,31 @@ 999 + + RIND + + + RINDSCHWEIN + + + FISCH + + + GEFL + + + FREI + + + LAMM + + + SCHWEIN + + + CAROTTE + + + WILD + \ No newline at end of file diff --git a/CampusAppWP8/CampusAppWP8/Resources/Icons.resx b/CampusAppWP8/CampusAppWP8/Resources/Icons.resx index cc44f12f..5f901171 100644 --- a/CampusAppWP8/CampusAppWP8/Resources/Icons.resx +++ b/CampusAppWP8/CampusAppWP8/Resources/Icons.resx @@ -123,6 +123,12 @@ campus_159.png + + info_159.png + + + info_159.png + delete_159.png @@ -132,12 +138,24 @@ favorite_159.png + + info_159.png + + + info_159.png + + + info_159.png + homework_159.png info_159.png + + info_159.png + lectures_159.png @@ -156,6 +174,9 @@ phone_159.png + + info_159.png + schedule_159.png @@ -168,7 +189,13 @@ update_159.png + + info_159.png + webmail_159.png + + info_159.png + \ No newline at end of file