From 354bbfc2e42ac87f593686ef3eecf2003791d6a2 Mon Sep 17 00:00:00 2001 From: stubbfel Date: Tue, 15 Oct 2013 11:28:01 +0200 Subject: [PATCH] refactor all model --- CampusAppWP8/CampusAppWP8/CampusAppWP8.csproj | 1 + .../CampusAppWP8/Model/BinaryModel.cs | 47 +++--- .../Model/Exams/ExamListWp8Model.cs | 14 +- .../CampusAppWP8/Model/Exams/ExamWp8Model.cs | 18 ++- .../Model/GeoDb/CampusBuildingLayerModel.cs | 34 ++-- .../Model/GeoDb/CampusBuildingModel.cs | 47 +++--- .../Model/GeoDb/PlaceInformation.cs | 30 ++-- .../CampusAppWP8/Model/GeoDb/PlaceModel.cs | 97 ++++++----- .../CampusAppWP8/Model/GeoDb/PlaceService.cs | 41 ++--- .../CampusAppWP8/Model/GeoDb/SpsModel.cs | 105 ++++++------ .../Model/Lecture/LecturePageModel.cs | 151 +++++++----------- .../Model/Lecture/LectureWp8Activity.cs | 34 ++-- .../Model/Lecture/LectureWp8List.cs | 24 +-- CampusAppWP8/CampusAppWP8/Model/MainModel.cs | 112 ++++++------- .../Model/Person/PersonFunctionWp8Model.cs | 28 ++-- .../Model/Person/PersonListWp8Model.cs | 38 ++--- .../Model/Person/PersonWp8Model.cs | 28 ++-- .../CampusAppWP8/Model/Setting/AppSettings.cs | 59 +++---- .../Model/Setting/BTUTagHandlerTypes.cs | 21 +++ .../TagHandlerListPickerItemListModel.cs | 29 ++-- .../Model/Setting/UserProfilModel.cs | 69 ++++---- .../CourseListPickerItemListWp8Model.cs | 55 ++++--- CampusAppWP8/CampusAppWP8/Model/XmlModel.cs | 60 ++++--- .../Pages/Setting/AppSettingPage.xaml | 2 +- 24 files changed, 551 insertions(+), 593 deletions(-) create mode 100644 CampusAppWP8/CampusAppWP8/Model/Setting/BTUTagHandlerTypes.cs diff --git a/CampusAppWP8/CampusAppWP8/CampusAppWP8.csproj b/CampusAppWP8/CampusAppWP8/CampusAppWP8.csproj index b87004b2..1f098b7d 100644 --- a/CampusAppWP8/CampusAppWP8/CampusAppWP8.csproj +++ b/CampusAppWP8/CampusAppWP8/CampusAppWP8.csproj @@ -138,6 +138,7 @@ + diff --git a/CampusAppWP8/CampusAppWP8/Model/BinaryModel.cs b/CampusAppWP8/CampusAppWP8/Model/BinaryModel.cs index bcb8b39b..f98219f1 100644 --- a/CampusAppWP8/CampusAppWP8/Model/BinaryModel.cs +++ b/CampusAppWP8/CampusAppWP8/Model/BinaryModel.cs @@ -1,35 +1,36 @@ //----------------------------------------------------------------------- // -// Company copyright tag. +// The MIT License (MIT). Copyright (c) 2013 BTU/IIT. // -// stubbfel -// 03.09.2013 -//---------------------------------------------------------------------- - +// Stubbfel +// 15.10.2013 +// Implements the binary model class +//----------------------------------------------------------------------- namespace CampusAppWP8.Model { using CampusAppWPortalLib8.Model; - /// Binary model. - /// Stubbfel, 03.09.2013. + /// Binary model. + /// Stubbfel, 03.09.2013. + /// public abstract class BinaryModel : MainModel { #region Constructor - /// Initializes a new instance of the BinaryModel class. - /// Stubbfel, 03.09.2013. - /// Type of the model. - /// Filename of the file. - /// URL of the document. + /// Initializes a new instance of the BinaryModel class. + /// Stubbfel, 03.09.2013. + /// Type of the model. + /// Filename of the file. + /// URL of the document. public BinaryModel(ModelType modelType, string fileName, string url) : base(modelType, fileName, url) { } - /// Initializes a new instance of the BinaryModel class. - /// Stubbfel, 03.09.2013. - /// Type of the model. - /// Name of the source. + /// Initializes a new instance of the BinaryModel class. + /// Stubbfel, 03.09.2013. + /// Type of the model. + /// Name of the source. public BinaryModel(ModelType modelType, string sourceName) : base(modelType, sourceName) { @@ -39,10 +40,10 @@ namespace CampusAppWP8.Model #region Method - /// Deserialize model. - /// Stubbfel, 03.09.2013. - /// Information describing the model. - /// true if it succeeds, false if it fails. + /// Deserialize model. + /// Stubbfel, 03.09.2013. + /// Information describing the model. + /// true if it succeeds, false if it fails. protected override bool DeserializeModel(byte[] modelData) { bool retValue = true; @@ -59,9 +60,9 @@ namespace CampusAppWP8.Model return retValue; } - /// Gets the serialize model. - /// Stubbfel, 03.09.2013. - /// an byte Array. + /// Gets the serialize model. + /// Stubbfel, 03.09.2013. + /// an byte Array. protected override byte[] SerializeModel() { return this.Model; diff --git a/CampusAppWP8/CampusAppWP8/Model/Exams/ExamListWp8Model.cs b/CampusAppWP8/CampusAppWP8/Model/Exams/ExamListWp8Model.cs index 0e112c99..c7c4c200 100644 --- a/CampusAppWP8/CampusAppWP8/Model/Exams/ExamListWp8Model.cs +++ b/CampusAppWP8/CampusAppWP8/Model/Exams/ExamListWp8Model.cs @@ -1,16 +1,18 @@ //----------------------------------------------------------------------- // -// Company copyright tag. +// The MIT License (MIT). Copyright (c) 2013 BTU/IIT. // -// stubbfel -// 02.09.2013 -//---------------------------------------------------------------------- +// Stubbfel +// 15.10.2013 +// Implements the exam list wp 8 model class +//----------------------------------------------------------------------- namespace CampusAppWP8.Model.Exams { using System.Xml.Serialization; - /// Exam list model. - /// Stubbfel, 02.09.2013. + /// Exam list model. + /// Stubbfel, 02.09.2013. + /// [XmlRoot("links")] public class ExamListWp8Model : CampusAppWPortalLib8.Model.Exams.ExamListModel { diff --git a/CampusAppWP8/CampusAppWP8/Model/Exams/ExamWp8Model.cs b/CampusAppWP8/CampusAppWP8/Model/Exams/ExamWp8Model.cs index f0d89d4e..b48bb444 100644 --- a/CampusAppWP8/CampusAppWP8/Model/Exams/ExamWp8Model.cs +++ b/CampusAppWP8/CampusAppWP8/Model/Exams/ExamWp8Model.cs @@ -1,22 +1,24 @@ //----------------------------------------------------------------------- // -// Company copyright tag. +// The MIT License (MIT). Copyright (c) 2013 BTU/IIT. // -// stubbfel -// 02.09.2013 -//---------------------------------------------------------------------- +// Stubbfel +// 15.10.2013 +// Implements the exam wp 8 model class +//----------------------------------------------------------------------- namespace CampusAppWP8.Model.Exams { using CampusAppWP8.Utility; - /// Exam model. - /// Stubbfel, 02.09.2013. + /// Exam model. + /// Stubbfel, 02.09.2013. + /// public class ExamWp8Model : CampusAppWPortalLib8.Model.Exams.ExamModel { #region Property - /// Gets the caption. - /// The caption. + /// Gets the caption of the exam. + /// The caption. public string Caption { get diff --git a/CampusAppWP8/CampusAppWP8/Model/GeoDb/CampusBuildingLayerModel.cs b/CampusAppWP8/CampusAppWP8/Model/GeoDb/CampusBuildingLayerModel.cs index 32307073..d55db74c 100644 --- a/CampusAppWP8/CampusAppWP8/Model/GeoDb/CampusBuildingLayerModel.cs +++ b/CampusAppWP8/CampusAppWP8/Model/GeoDb/CampusBuildingLayerModel.cs @@ -1,28 +1,28 @@ -//----------------------------------------------------------------------------- +//----------------------------------------------------------------------- // -// Company copyright tag. +// The MIT License (MIT). Copyright (c) 2013 BTU/IIT. // -// stubbfel -// 23.09.2013 -//----------------------------------------------------------------------------- - +// Stubbfel +// 15.10.2013 +// Implements the campus building layer model class +//----------------------------------------------------------------------- namespace CampusAppWP8.Model.GeoDb { using System.Collections.Generic; using CampusAppWP8.Resources; - /// - /// Class is model for buildings of a campus - /// + /// Class is model for buildings of a campus. + /// Stubbfel, 15.10.2013. public class CampusBuildingLayerModel { #region Constructor /// - /// Initializes a new instance of the class. + /// Initializes a new instance of the class. /// - /// id of the layer - /// list of place which can be room of the layer + /// Stubbfel, 15.10.2013. + /// id of the layer. + /// list of place which can be room of the layer. public CampusBuildingLayerModel(string layerId, List places) { this.LayerId = layerId; @@ -42,14 +42,12 @@ namespace CampusAppWP8.Model.GeoDb #region property - /// - /// Gets or sets Rooms - /// + /// Gets or sets Rooms. + /// The rooms. public SpsModel Rooms { get; set; } - /// - /// Gets or sets LayerId - /// + /// Gets or sets LayerId. + /// The identifier of the layer. public string LayerId { get; set; } #endregion diff --git a/CampusAppWP8/CampusAppWP8/Model/GeoDb/CampusBuildingModel.cs b/CampusAppWP8/CampusAppWP8/Model/GeoDb/CampusBuildingModel.cs index cbee3c67..05da5f80 100644 --- a/CampusAppWP8/CampusAppWP8/Model/GeoDb/CampusBuildingModel.cs +++ b/CampusAppWP8/CampusAppWP8/Model/GeoDb/CampusBuildingModel.cs @@ -1,28 +1,28 @@ -//----------------------------------------------------------------------------- +//----------------------------------------------------------------------- // -// Company copyright tag. +// The MIT License (MIT). Copyright (c) 2013 BTU/IIT. // -// stubbfel -// 23.09.2013 -//----------------------------------------------------------------------------- - +// Stubbfel +// 15.10.2013 +// Implements the campus building model class +//----------------------------------------------------------------------- namespace CampusAppWP8.Model.GeoDb { using System.Collections.Generic; using CampusAppWP8.Resources; - /// - /// Class is model for buildings of a campus - /// + /// Class is model for buildings of a campus. + /// Stubbfel, 15.10.2013. public class CampusBuildingModel { #region constructor /// - /// Initializes a new instance of the class. + /// Initializes a new instance of the class. /// - /// id of the building - /// list of place which can be room of the buildings + /// Stubbfel, 15.10.2013. + /// id of the building. + /// list of place which can be room of the buildings. public CampusBuildingModel(string buildingId, List places) { this.Layers = new Dictionary(); @@ -57,25 +57,22 @@ namespace CampusAppWP8.Model.GeoDb #region Property - /// - /// Gets the Layer of the building - /// + /// Gets the Layer of the building. + /// The layers. public Dictionary Layers { get; private set; } - /// - /// Gets or sets the Building PlaceModel - /// + /// Gets or sets the Building PlaceModel. + /// The building. public PlaceModel Building { get; set; } #endregion #region method - /// - /// Method gets a place by their placeID - /// - /// the placeId of the place - /// The place by identifier. + /// Method gets a place by their placeID. + /// Stubbfel, 15.10.2013. + /// the placeId of the place. + /// The place by identifier. public PlaceModel GetPlaceById(string placeID) { PlaceModel result = null; @@ -91,6 +88,10 @@ namespace CampusAppWP8.Model.GeoDb return result; } + /// Gets layer key. + /// Stubbfel, 15.10.2013. + /// Identifier for the place. + /// The layer key. public string GetLayerKey(string placeId) { PlaceModel tmpPlace = null; diff --git a/CampusAppWP8/CampusAppWP8/Model/GeoDb/PlaceInformation.cs b/CampusAppWP8/CampusAppWP8/Model/GeoDb/PlaceInformation.cs index d504afd3..4882a456 100644 --- a/CampusAppWP8/CampusAppWP8/Model/GeoDb/PlaceInformation.cs +++ b/CampusAppWP8/CampusAppWP8/Model/GeoDb/PlaceInformation.cs @@ -1,28 +1,30 @@ //----------------------------------------------------------------------- // -// Company copyright tag. +// The MIT License (MIT). Copyright (c) 2013 BTU/IIT. // -// stubbfel -// 19.08.2013 -//---------------------------------------------------------------------- +// Stubbfel +// 15.10.2013 +// Implements the place information class +//----------------------------------------------------------------------- namespace CampusAppWP8.Model.GeoDb { using System; using System.Xml.Serialization; - /// Information about the place. - /// Stubbfel, 19.08.2013. + /// Information about the place. + /// Stubbfel, 19.08.2013. + /// public class PlaceInformation : IEquatable { #region Property - /// Gets or sets the name of the information. - /// The name of the information. + /// Gets or sets the name of the information. + /// The name of the information. [XmlAttribute("placeInformationName")] public string InformationName { get; set; } - /// Gets or sets the information value. - /// The information value. + /// Gets or sets the information value. + /// The information value. [XmlText] public string InformationValue { get; set; } @@ -30,10 +32,10 @@ namespace CampusAppWP8.Model.GeoDb #region Method - /// Tests if this PlaceInformation is considered equal to another. - /// Stubbfel, 09.09.2013. - /// The place information to compare to this object. - /// true if the objects are considered equal, false if they are not. + /// Tests if this PlaceInformation is considered equal to another. + /// Stubbfel, 09.09.2013. + /// The place information to compare to this object. + /// true if the objects are considered equal, false if they are not. public bool Equals(PlaceInformation other) { if (other.InformationName.Equals(this.InformationName)) diff --git a/CampusAppWP8/CampusAppWP8/Model/GeoDb/PlaceModel.cs b/CampusAppWP8/CampusAppWP8/Model/GeoDb/PlaceModel.cs index 03e8661d..f6b29595 100644 --- a/CampusAppWP8/CampusAppWP8/Model/GeoDb/PlaceModel.cs +++ b/CampusAppWP8/CampusAppWP8/Model/GeoDb/PlaceModel.cs @@ -1,11 +1,11 @@ //----------------------------------------------------------------------- // -// Company copyright tag. +// The MIT License (MIT). Copyright (c) 2013 BTU/IIT. // -// stubbfel -// 08.08.2013 -//---------------------------------------------------------------------- - +// Stubbfel +// 15.10.2013 +// Implements the place model class +//----------------------------------------------------------------------- namespace CampusAppWP8.Model.GeoDb { using System; @@ -18,33 +18,30 @@ namespace CampusAppWP8.Model.GeoDb using CampusAppWP8.Resources; using CampusAppWPortalLib8.Utility; - /// - /// Model for a place of the SPSService - /// + /// Model for a place of the SPSService. + /// Stubbfel, 15.10.2013. + /// public class PlaceModel : IEquatable { #region Property - /// - /// Gets or sets the placeId - /// + /// Gets or sets the placeId. + /// The identifier of the place. [XmlAttribute("id")] public string PlaceId { get; set; } - /// - /// Gets or sets the id of the "parent" of a place - /// + /// Gets or sets the id of the "parent" of a place. + /// The identifier of the parent. [XmlAttribute("parentId")] public string ParentId { get; set; } - /// - /// Gets or sets the ReferencePoint of a place - /// + /// Gets or sets the ReferencePoint of a place. + /// The reference point. [XmlAttribute("refpoint")] public string RefPoint { get; set; } - /// Gets the geo reference point. - /// The geo reference point. + /// Gets the geo reference point. + /// The geo reference point. public GeoCoordinate GeoRefPoint { get @@ -77,38 +74,39 @@ namespace CampusAppWP8.Model.GeoDb } } - /// Gets or sets the information. - /// The information. + /// Gets or sets the information. + /// The information. [XmlElement("placeInformation")] public ObservableCollection Informations { get; set; } - /// Gets or sets the services. - /// The services. + /// Gets or sets the services. + /// The services. [XmlElement("placeService")] public ObservableCollection Services { get; set; } /// - /// Gets or sets a string, which is the caption of the place (e.g. for contents of UIElements) + /// Gets or sets a string, which is the caption of the place (e.g. for contents of UIElements) /// + /// The caption. public string Caption { get; set; } #endregion #region Method - /// Converts this object to a nfc string. - /// Stubbfel, 21.08.2013. - /// This object as a string. + /// Converts this object to a nfc string. + /// Stubbfel, 21.08.2013. + /// This object as a string. public string ToNfcString() { string nfcStr = "{\n\"url\":\"http://www.tu-cottbus.de/campusapp\",\n\"pid\":\"" + this.PlaceId + "\",\n\"parent\":\"" + this.ParentId + "\"\n}"; return nfcStr; } - /// Tests if this PlaceModel is considered equal to another. - /// Stubbfel, 09.09.2013. - /// The place model to compare to this object. - /// true if the objects are considered equal, false if they are not. + /// Tests if this PlaceModel is considered equal to another. + /// Stubbfel, 09.09.2013. + /// The place model to compare to this object. + /// true if the objects are considered equal, false if they are not. public bool Equals(PlaceModel other) { if (other.PlaceId.Equals(this.PlaceId)) @@ -119,9 +117,9 @@ namespace CampusAppWP8.Model.GeoDb return false; } - /// Adds a place information. - /// Stubbfel, 09.09.2013. - /// The place information. + /// Adds a place information. + /// Stubbfel, 09.09.2013. + /// The place information. public void AddPlaceInformations(List placeInformations) { foreach (PlaceInformation info in placeInformations) @@ -138,9 +136,9 @@ namespace CampusAppWP8.Model.GeoDb } } - /// Adds a place services. - /// Stubbfel, 09.09.2013. - /// The place services. + /// Adds a place services. + /// Stubbfel, 09.09.2013. + /// The place services. public void AddPlaceServices(List placeServices) { foreach (PlaceService service in placeServices) @@ -158,10 +156,10 @@ namespace CampusAppWP8.Model.GeoDb } } - /// Query if 'names' contains information names. - /// Stubbfel, 09.09.2013. - /// The names. - /// true if it succeeds, false if it fails. + /// Query if 'names' contains information names. + /// Stubbfel, 09.09.2013. + /// The names. + /// true if it succeeds, false if it fails. public bool ContainsInformationNames(List names) { foreach (string name in names) @@ -185,10 +183,10 @@ namespace CampusAppWP8.Model.GeoDb return true; } - /// Query if 'services' contains service names. - /// Stubbfel, 09.09.2013. - /// The services. - /// true if it succeeds, false if it fails. + /// Query if 'services' contains service names. + /// Stubbfel, 09.09.2013. + /// The services. + /// true if it succeeds, false if it fails. public bool ContainsServiceNames(List services) { foreach (string name in services) @@ -212,11 +210,10 @@ namespace CampusAppWP8.Model.GeoDb return true; } - /// - /// Method gets the InformationValue of a certain InformationName - /// - /// string for InformationName - /// value of the information + /// Method gets the InformationValue of a certain InformationName. + /// Stubbfel, 15.10.2013. + /// string for InformationName. + /// value of the information. public string GetInformationsValue(string key) { foreach (PlaceInformation info in this.Informations) diff --git a/CampusAppWP8/CampusAppWP8/Model/GeoDb/PlaceService.cs b/CampusAppWP8/CampusAppWP8/Model/GeoDb/PlaceService.cs index 9f318365..a4d00deb 100644 --- a/CampusAppWP8/CampusAppWP8/Model/GeoDb/PlaceService.cs +++ b/CampusAppWP8/CampusAppWP8/Model/GeoDb/PlaceService.cs @@ -1,34 +1,35 @@ -//----------------------------------------------------------------------------- +//----------------------------------------------------------------------- // -// Company copyright tag. +// The MIT License (MIT). Copyright (c) 2013 BTU/IIT. // -// stubbfel -// 19.08.2013 -//----------------------------------------------------------------------------- - +// Stubbfel +// 15.10.2013 +// Implements the place service class +//----------------------------------------------------------------------- namespace CampusAppWP8.Model.GeoDb { using System; using System.Xml.Serialization; - /// Place service. - /// Stubbfel, 19.08.2013. + /// Place service. + /// Stubbfel, 19.08.2013. + /// public class PlaceService : IEquatable { #region Property - /// Gets or sets the name of the service. - /// The name of the service. + /// Gets or sets the name of the service. + /// The name of the service. [XmlAttribute("placeServiceName")] public string ServiceName { get; set; } - /// Gets or sets the SAP of an service. - /// The sap. + /// Gets or sets the SAP of an service. + /// The sap. [XmlElement("sap")] public string SAP { get; set; } - /// Gets or sets the request for a place. - /// The request. + /// Gets or sets the request for a place. + /// The request. [XmlElement("request")] public string Request { get; set; } @@ -36,8 +37,8 @@ namespace CampusAppWP8.Model.GeoDb #region Method - /// Gets the URL string. - /// The URL string. + /// Gets the URL string. + /// The URL string. public string URLString { get @@ -46,10 +47,10 @@ namespace CampusAppWP8.Model.GeoDb } } - /// Tests if this PlaceService is considered equal to another. - /// Stubbfel, 09.09.2013. - /// The place service to compare to this object. - /// true if the objects are considered equal, false if they are not. + /// Tests if this PlaceService is considered equal to another. + /// Stubbfel, 09.09.2013. + /// The place service to compare to this object. + /// true if the objects are considered equal, false if they are not. public bool Equals(PlaceService other) { if (other.ServiceName.Equals(this.ServiceName)) diff --git a/CampusAppWP8/CampusAppWP8/Model/GeoDb/SpsModel.cs b/CampusAppWP8/CampusAppWP8/Model/GeoDb/SpsModel.cs index 4982eeb3..00219adc 100644 --- a/CampusAppWP8/CampusAppWP8/Model/GeoDb/SpsModel.cs +++ b/CampusAppWP8/CampusAppWP8/Model/GeoDb/SpsModel.cs @@ -1,11 +1,11 @@ //----------------------------------------------------------------------- // -// Company copyright tag. +// The MIT License (MIT). Copyright (c) 2013 BTU/IIT. // -// stubbfel -// 08.08.2013 -//---------------------------------------------------------------------- - +// Stubbfel +// 15.10.2013 +// Implements the sps model class +//----------------------------------------------------------------------- namespace CampusAppWP8.Model.GeoDb { using System.Collections.Generic; @@ -13,16 +13,15 @@ namespace CampusAppWP8.Model.GeoDb using System.Linq; using System.Xml.Serialization; - /// - /// Model for a xml-response of the SPSService - /// + /// Model for a xml-response of the SPSService. + /// Stubbfel, 15.10.2013. [XmlRoot("root")] public class SpsModel { #region Constructor - /// Initializes a new instance of the SpsModel class. - /// Stubbfel, 20.08.2013. + /// Initializes a new instance of the SpsModel class. + /// Stubbfel, 20.08.2013. public SpsModel() { this.HasChanged = false; @@ -33,14 +32,13 @@ namespace CampusAppWP8.Model.GeoDb #region Property - /// - /// Gets or sets a list of places - /// + /// Gets or sets a list of places. + /// The places. [XmlElement("place")] public ObservableCollection Places { get; set; } - /// Gets or sets a value indicating whether this object has changed. - /// true if this object has changed, false if not. + /// Gets or sets a value indicating whether this object has changed. + /// true if this object has changed, false if not. public bool HasChanged { get; set; } #endregion @@ -48,13 +46,13 @@ namespace CampusAppWP8.Model.GeoDb #region Method #region public - - /// Gets places by information. - /// Stubbfel, 19.08.2013. - /// The query. - /// (Optional) the ignore cases. - /// (Optional) name of the information. - /// The places by information. + + /// Gets places by information. + /// Stubbfel, 19.08.2013. + /// The query. + /// (Optional) the ignore cases. + /// (Optional) name of the information. + /// The places by information. public List GetPlacesByInformation(string query, bool ignoreCases = true, List informationNames = null) { string querryStr = string.Empty; @@ -71,9 +69,9 @@ namespace CampusAppWP8.Model.GeoDb return resultplaces; } - /// Adds the places. - /// Stubbfel, 09.09.2013. - /// A list of places. + /// Adds the places. + /// Stubbfel, 09.09.2013. + /// A list of places. public void AddPlaces(List places) { foreach (PlaceModel place in places) @@ -93,9 +91,9 @@ namespace CampusAppWP8.Model.GeoDb this.HasChanged = true; } - /// Creates PID list. - /// Stubbfel, 09.09.2013. - /// The new PID list. + /// Creates PID list. + /// Stubbfel, 09.09.2013. + /// The new PID list. public List CreatePidList() { List pidList = new List(); @@ -107,10 +105,10 @@ namespace CampusAppWP8.Model.GeoDb return pidList; } - /// Gets place by identifier. - /// Stubbfel, 09.09.2013. - /// The identifier. - /// The place by identifier. + /// Gets place by identifier. + /// Stubbfel, 09.09.2013. + /// The identifier. + /// The place by identifier. public PlaceModel GetPlaceById(string id) { foreach (PlaceModel place in this.Places) @@ -124,11 +122,11 @@ namespace CampusAppWP8.Model.GeoDb return null; } - /// Query if 'pidList' contains information names. - /// Stubbfel, 09.09.2013. - /// List of pids. - /// The names. - /// true if it succeeds, false if it fails. + /// Query if 'pidList' contains information names. + /// Stubbfel, 09.09.2013. + /// List of pids. + /// The names. + /// true if it succeeds, false if it fails. public bool ContainsInformationNames(List pidList, List names) { foreach (string pid in pidList) @@ -143,11 +141,11 @@ namespace CampusAppWP8.Model.GeoDb return true; } - /// Query if 'pidList' contains service names. - /// Stubbfel, 09.09.2013. - /// List of pids. - /// The names. - /// true if it succeeds, false if it fails. + /// Query if 'pidList' contains service names. + /// Stubbfel, 09.09.2013. + /// List of pids. + /// The names. + /// true if it succeeds, false if it fails. public bool ContainsServiceNames(List pidList, List names) { foreach (string pid in pidList) @@ -162,10 +160,10 @@ namespace CampusAppWP8.Model.GeoDb return true; } - /// Filter by PID. - /// Stubbfel, 11.09.2013. - /// List of pids. - /// filtered list of places. + /// Filter by PID. + /// Stubbfel, 11.09.2013. + /// List of pids. + /// filtered list of places. public List FilterByPid(List pidList) { List fitlerList = new List(); @@ -190,14 +188,13 @@ namespace CampusAppWP8.Model.GeoDb #region private - /// - /// Method check if a certain place matched by query string - /// - /// the Place - /// the Query - /// (Optional) the ignore cases. - /// (Optional) name of the information. - /// true if it match otherwise false + /// Method check if a certain place matched by query string. + /// Stubbfel, 15.10.2013. + /// the Place. + /// the Query. + /// (Optional) the ignore cases. + /// (Optional) name of the information. + /// true if it match otherwise false. private bool IsPlaceQueryMatched(PlaceModel place, string query, bool ignoreCases = true, List informationNames = null) { string queryString = query; diff --git a/CampusAppWP8/CampusAppWP8/Model/Lecture/LecturePageModel.cs b/CampusAppWP8/CampusAppWP8/Model/Lecture/LecturePageModel.cs index 6afc7a82..62d7e7be 100644 --- a/CampusAppWP8/CampusAppWP8/Model/Lecture/LecturePageModel.cs +++ b/CampusAppWP8/CampusAppWP8/Model/Lecture/LecturePageModel.cs @@ -1,10 +1,11 @@ //----------------------------------------------------------------------- // -// Company copyright tag. +// The MIT License (MIT). Copyright (c) 2013 BTU/IIT. // -// stubbfel -// 18.06.2013 -//---------------------------------------------------------------------- +// Stubbfel +// 15.10.2013 +// Implements the lecture page model class +//----------------------------------------------------------------------- namespace CampusAppWP8.Model.Lecture { using System.Runtime.Serialization; @@ -12,79 +13,54 @@ namespace CampusAppWP8.Model.Lecture using CampusAppWP8.Model.Utility; using CampusAppWPortalLib8.Model.Utility; - /// - /// Model for the LecturePage - /// + /// Model for the LecturePage. + /// Stubbfel, 15.10.2013. [DataContract] public class LecturePageModel { #region Members - /// - /// Variable for the courseIndex - /// + /// Variable for the courseIndex. [DataMember] public int selectCourseIndex; - /// - /// Variable for the degreeIndex - /// + /// Variable for the degreeIndex. [DataMember] public int selectDegreeIndex; - /// - /// Variable for the semesterIndex - /// + /// Variable for the semesterIndex. [DataMember] public int selectSemesterIndex; - /// - /// Variable for the fromIndex - /// + /// Variable for the fromIndex. [DataMember] public int selectFromIndex; - /// - /// Variable for the toIndex - /// + /// Variable for the toIndex. [DataMember] public int selectToIndex; - /// - /// List for the courses of the BTU - /// - /// - /// need to be extend to full list - /// + /// List for the courses of the BTU. private CourseListPickerItemListWp8Model courseList; - /// - /// List of the degrees - /// + /// List of the degrees. private ListPickerItemListModel degreeList; - /// - /// List of the semester - /// + /// List of the semester. private ListPickerItemListModel semesterList; - /// - /// List for the number of semester (from) - /// + /// List for the number of semester (from) private ListPickerItemListModel fromNumberList; - /// - /// List for the number of semester (to) - /// + /// List for the number of semester (to) private ListPickerItemListModel toNumberList; #endregion #region Constructor - /// - /// Initializes a new instance of the class. - /// + /// Initializes a new instance of the class. + /// Stubbfel, 15.10.2013. public LecturePageModel() { } @@ -92,23 +68,19 @@ namespace CampusAppWP8.Model.Lecture #region events - /// - /// Delegate of the OnIO callback function. - /// + /// Delegate of the OnIO callback function. + /// Stubbfel, 15.10.2013. public delegate void OnIO(); - /// - /// Callback pointer, called after loading. - /// + /// Callback pointer, called after loading. public event OnIO OnLoaded = null; #endregion #region Proberty - /// - /// Gets or sets the selected course index - /// + /// Gets or sets the selected course index. + /// The select course index. public int SelectCourseIndex { get @@ -125,9 +97,8 @@ namespace CampusAppWP8.Model.Lecture } } - /// - /// Gets or sets the selected degree index - /// + /// Gets or sets the selected degree index. + /// The select degree index. public int SelectDegreeIndex { get @@ -144,9 +115,8 @@ namespace CampusAppWP8.Model.Lecture } } - /// - /// Gets or sets the selected semester-index - /// + /// Gets or sets the selected semester-index. + /// The select semester index. public int SelectSemesterIndex { get @@ -163,9 +133,8 @@ namespace CampusAppWP8.Model.Lecture } } - /// - /// Gets or sets the selected from-index - /// + /// Gets or sets the selected from-index. + /// The select from index. public int SelectFromIndex { get @@ -182,9 +151,8 @@ namespace CampusAppWP8.Model.Lecture } } - /// - /// Gets or sets the selected to-index - /// + /// Gets or sets the selected to-index. + /// The select to index. public int SelectToIndex { get @@ -201,9 +169,8 @@ namespace CampusAppWP8.Model.Lecture } } - /// - /// Gets List for the courses of the BTU - /// + /// Gets List for the courses of the BTU. + /// A List of courses. public ListPickerItemListModel CourseList { get @@ -212,9 +179,8 @@ namespace CampusAppWP8.Model.Lecture } } - /// - /// Gets List of the degrees - /// + /// Gets List of the degrees. + /// A List of degrees. public ListPickerItemListModel DegreeList { get @@ -223,9 +189,8 @@ namespace CampusAppWP8.Model.Lecture } } - /// - /// Gets List of the semester - /// + /// Gets List of the semester. + /// A List of semesters. public ListPickerItemListModel SemesterList { get @@ -234,9 +199,8 @@ namespace CampusAppWP8.Model.Lecture } } - /// - /// Gets List for the number of semester - /// + /// Gets List for the number of semester (from). + /// A List of from numbers. public ListPickerItemListModel FromNumberList { get @@ -245,9 +209,8 @@ namespace CampusAppWP8.Model.Lecture } } - /// - /// Gets the NumberList - /// + /// Gets List for the number of semester (to). + /// A List of to numbers. public ListPickerItemListModel ToNumberList { get @@ -261,9 +224,8 @@ namespace CampusAppWP8.Model.Lecture #region public - /// - /// Load all ListPickerLists - /// + /// Load all ListPickerLists. + /// Stubbfel, 15.10.2013. public void LoadLists() { this.courseList = new CourseListPickerItemListWp8Model(); @@ -271,9 +233,8 @@ namespace CampusAppWP8.Model.Lecture this.courseList.LoadCourseList(); } - /// - /// Load the NumberList - /// + /// Load the NumberList. + /// Stubbfel, 15.10.2013. public void LoadFromNumberList() { string selectValue = null; @@ -286,9 +247,8 @@ namespace CampusAppWP8.Model.Lecture this.SelectFromIndex = this.fromNumberList.GetIndexOrDefault(selectValue); } - /// - /// Load the NumberList - /// + /// Load the NumberList. + /// Stubbfel, 15.10.2013. public void LoadToNumberList() { string selectValue = null; @@ -305,8 +265,8 @@ namespace CampusAppWP8.Model.Lecture #region private - /// Course list is ready. - /// Stubbfel, 10.09.2013. + /// Course list is ready. + /// Stubbfel, 10.09.2013. private void CourseListIsReady() { this.degreeList = new DegreeListPickerItemListModel(); @@ -324,12 +284,11 @@ namespace CampusAppWP8.Model.Lecture } } - /// - /// Method create a NumberList - /// - /// startValue of the list - /// endValue of the list - /// return list + /// Method create a NumberList. + /// Stubbfel, 15.10.2013. + /// startValue of the list. + /// endValue of the list. + /// return list. private ListPickerItemListModel CreateNumberList(int startvalue, int endvalue) { ListPickerItemListModel list = new ListPickerItemListModel(); diff --git a/CampusAppWP8/CampusAppWP8/Model/Lecture/LectureWp8Activity.cs b/CampusAppWP8/CampusAppWP8/Model/Lecture/LectureWp8Activity.cs index a0a3eb0e..cef0c89e 100644 --- a/CampusAppWP8/CampusAppWP8/Model/Lecture/LectureWp8Activity.cs +++ b/CampusAppWP8/CampusAppWP8/Model/Lecture/LectureWp8Activity.cs @@ -1,33 +1,34 @@ //----------------------------------------------------------------------- // -// Company copyright tag. +// The MIT License (MIT). Copyright (c) 2013 BTU/IIT. // -// stubbfel -// 13.06.2013 -//---------------------------------------------------------------------- +// Stubbfel +// 15.10.2013 +// Implements the lecture wp 8 activity class +//----------------------------------------------------------------------- namespace CampusAppWP8.Model.Lecture { + using System.Xml.Serialization; using CampusAppWP8.Resources; using CampusAppWP8.Utility; - using CampusAppWPortalLib8.Model.Lecture; - using System.Xml.Serialization; + using CampusAppWPortalLib8.Model.Lecture; - /// - /// Model for a Activity - /// + /// Model for a Activity. + /// Stubbfel, 15.10.2013. + /// public class LectureWp8Activity : LectureActivity { #region Members - /// URL of the icon. + /// URL of the icon. private string iconUrl; #endregion #region Proberty - /// Gets URL of the icon. - /// The icon URL. + /// Gets URL of the icon. + /// The icon URL. public string IconUrl { get @@ -37,9 +38,8 @@ namespace CampusAppWP8.Model.Lecture } } - /// - /// Gets or sets the topic of the Lecture - /// + /// Gets or sets the topic of the Lecture. + /// The topic. [XmlElement("lehrinhalt")] public new string Topic { @@ -62,8 +62,8 @@ namespace CampusAppWP8.Model.Lecture #region private - /// Creates icon URL. - /// Stubbfel, 12.09.2013. + /// Creates icon URL. + /// Stubbfel, 12.09.2013. private void CreateIconUrl() { string typeStr = this.Type; diff --git a/CampusAppWP8/CampusAppWP8/Model/Lecture/LectureWp8List.cs b/CampusAppWP8/CampusAppWP8/Model/Lecture/LectureWp8List.cs index a2ca637d..92fa8c2e 100644 --- a/CampusAppWP8/CampusAppWP8/Model/Lecture/LectureWp8List.cs +++ b/CampusAppWP8/CampusAppWP8/Model/Lecture/LectureWp8List.cs @@ -1,28 +1,28 @@ //----------------------------------------------------------------------- // -// Company copyright tag. +// The MIT License (MIT). Copyright (c) 2013 BTU/IIT. // -// stubbfel -// 10.06.2013 -//---------------------------------------------------------------------- +// Stubbfel +// 15.10.2013 +// Implements the lecture wp 8 list class +//----------------------------------------------------------------------- namespace CampusAppWP8.Model.Lecture { using System.Linq; using System.Xml.Serialization; - /// - /// Model for a List of LectureActivity - /// + /// Model for a List of LectureActivity. + /// Stubbfel, 15.10.2013. + /// [XmlRoot("lsf_auszug")] public class LectureWp8List : CampusAppWPortalLib8.Model.Lecture.LectureList { #region Methods - /// - /// Method return a certain activity - /// - /// id of the activity - /// the activity (FirstOrDefault) + /// Method return a certain activity. + /// Stubbfel, 15.10.2013. + /// id of the activity. + /// the activity (FirstOrDefault) public new LectureWp8Activity GetActivity(int id) { LectureWp8Activity activity = this.Activities.Where(p => p.Id == id).FirstOrDefault(); diff --git a/CampusAppWP8/CampusAppWP8/Model/MainModel.cs b/CampusAppWP8/CampusAppWP8/Model/MainModel.cs index 74abbcac..cbbc9b8a 100644 --- a/CampusAppWP8/CampusAppWP8/Model/MainModel.cs +++ b/CampusAppWP8/CampusAppWP8/Model/MainModel.cs @@ -1,10 +1,11 @@ -//----------------------------------------------------------------------------- +//----------------------------------------------------------------------- // -// Company copyright tag. +// The MIT License (MIT). Copyright (c) 2013 BTU/IIT. // // fiedlchr -// 05.07.2013 -//----------------------------------------------------------------------------- +// 15.10.2013 +// Implements the main model class +//----------------------------------------------------------------------- namespace CampusAppWP8.Model { using System; @@ -13,30 +14,27 @@ namespace CampusAppWP8.Model using CampusAppWP8.Utility; using CampusAppWPortalLib8.Model; - /// - /// Base model io handling class. - /// - /// model type + /// Base model io handling class. + /// fiedlchr, 15.10.2013. + /// public abstract class MainModel : AbstractMainModel { #region Constructor - /// - /// Initializes a new instance of the class. - /// - /// Model IO type - /// name of the file - /// url of the feed + /// Initializes a new instance of the class. + /// fiedlchr, 15.10.2013. + /// Model IO type. + /// name of the file. + /// url of the feed. public MainModel(ModelType modelType, string fileName, string url) : base(modelType, fileName, url) { } - /// - /// Initializes a new instance of the class. - /// - /// Model IO type - /// name of the file or the url of the feed + /// Initializes a new instance of the class. + /// fiedlchr, 15.10.2013. + /// Model IO type. + /// name of the file or the url of the feed. public MainModel(ModelType modelType, string sourceName) : base(modelType, sourceName) { @@ -46,31 +44,25 @@ namespace CampusAppWP8.Model #region Events - /// - /// Delegate of the IsFileUpToDate callback function. - /// - /// data model - /// info of the file - /// true, is file is up to date + /// Delegate of the IsFileUpToDate callback function. + /// fiedlchr, 15.10.2013. + /// data model. + /// info of the file. + /// true, is file is up to date. public delegate bool IsFileUpToDate(T model, FileInfo fileInfo); - /// - /// Callback pointer, for checking if file is up to date at loading. - /// + /// Callback pointer, for checking if file is up to date at loading. public event IsFileUpToDate IsFileUpToDateOnLoad = null; - /// - /// Callback pointer, for checking if file is up to date at saving. - /// + /// Callback pointer, for checking if file is up to date at saving. public event IsFileUpToDate IsFileUpToDateOnSave = null; #endregion #region property - /// - /// Gets or sets the file - /// + /// Gets the file. + /// The file. public new CampusAppWP8.Utility.File File { get @@ -84,9 +76,8 @@ namespace CampusAppWP8.Model } } - /// - /// Gets or sets the api - /// + /// Gets the api. + /// The API. public new HttpRequest Api { get @@ -105,36 +96,32 @@ namespace CampusAppWP8.Model #region protected - /// - /// Method overrides the base CheckLoadFileIsNotUpToDate Method - /// - /// true if it is not up-to-date, otherwise false + /// Method overrides the base CheckLoadFileIsNotUpToDate Method. + /// fiedlchr, 15.10.2013. + /// true if it is not up-to-date, otherwise false. protected override bool CheckLoadFileIsNotUpToDate() { return this.CheckIsNotUpToDate(this.IsFileUpToDateOnLoad); } - /// - /// Method overrides the base CheckSaveFileIsNotUpToDate Method - /// - /// true if it is not up-to-date, otherwise false + /// Method overrides the base CheckSaveFileIsNotUpToDate Method. + /// fiedlchr, 15.10.2013. + /// true if it is not up-to-date, otherwise false. protected override bool CheckSaveFileIsNotUpToDate() { return this.CheckIsNotUpToDate(this.IsFileUpToDateOnSave); } - /// - /// Method overrides the base SendHttpGet Method - /// - /// the url + /// Method overrides the base SendHttpGet Method. + /// fiedlchr, 15.10.2013. + /// the url. protected override void SendHttpGet(Uri url) { ((HttpRequest)this.Api).HttpGet(url, this.OnLoadDataComplete); } - /// - /// Initializes the file object. - /// + /// Initializes the file object. + /// fiedlchr, 15.10.2013. protected override void InitFile() { if ((this.IsFile() == true) @@ -144,9 +131,8 @@ namespace CampusAppWP8.Model } } - /// - /// Initializes the web object. - /// + /// Initializes the web object. + /// fiedlchr, 15.10.2013. protected override void InitHttpApi() { if ((this.IsHttpApi() == true) @@ -156,9 +142,10 @@ namespace CampusAppWP8.Model } } - /// Check if model or file is not up to date. - /// The check function. - /// true if model or file is not up to date, false if it is. + /// Check if model or file is not up to date. + /// fiedlchr, 15.10.2013. + /// The check function. + /// true if model or file is not up to date, false if it is. protected override bool CheckIsNotUpToDate(object checkFunc) { bool retValue = false; @@ -189,11 +176,10 @@ namespace CampusAppWP8.Model #region private - /// - /// Is called after the loading from web is complete. - /// - /// sending object - /// event args + /// Is called after the loading from web is complete. + /// fiedlchr, 15.10.2013. + /// sending object. + /// event args. private void OnLoadDataComplete(object sender, OpenReadCompletedEventArgs e) { Exception downloadError = e.Error; diff --git a/CampusAppWP8/CampusAppWP8/Model/Person/PersonFunctionWp8Model.cs b/CampusAppWP8/CampusAppWP8/Model/Person/PersonFunctionWp8Model.cs index 944cf9e1..62eb6b32 100644 --- a/CampusAppWP8/CampusAppWP8/Model/Person/PersonFunctionWp8Model.cs +++ b/CampusAppWP8/CampusAppWP8/Model/Person/PersonFunctionWp8Model.cs @@ -1,23 +1,25 @@ -//----------------------------------------------------------------------------- +//----------------------------------------------------------------------- // -// Company copyright tag. +// The MIT License (MIT). Copyright (c) 2013 BTU/IIT. // -// stubbfel -// 05.09.2013 -//----------------------------------------------------------------------------- +// Stubbfel +// 15.10.2013 +// Implements the person function wp 8 model class +//----------------------------------------------------------------------- namespace CampusAppWP8.Model.Person { using System.Xml.Serialization; using CampusAppWP8.Utility; - /// Person function model. - /// Stubbfel, 05.09.2013. + /// Person function model. + /// Stubbfel, 05.09.2013. + /// public class PersonFunctionWp8Model : CampusAppWPortalLib8.Model.Person.PersonFunctionModel { #region Property - /// Gets or sets the function. - /// The function. + /// Gets or sets the function. + /// The function. [XmlAttribute("funktion")] public new string Function { @@ -35,8 +37,8 @@ namespace CampusAppWP8.Model.Person } } - /// Gets or sets the appointment. - /// The appointment. + /// Gets or sets the appointment. + /// The appointment. [XmlAttribute("einrichtung")] public new string Appointment { @@ -54,8 +56,8 @@ namespace CampusAppWP8.Model.Person } } - /// Gets or sets the building. - /// The building. + /// Gets or sets the building. + /// The building. [XmlAttribute("gebaeude")] public new string Building { diff --git a/CampusAppWP8/CampusAppWP8/Model/Person/PersonListWp8Model.cs b/CampusAppWP8/CampusAppWP8/Model/Person/PersonListWp8Model.cs index fe47181e..5e64ccdc 100644 --- a/CampusAppWP8/CampusAppWP8/Model/Person/PersonListWp8Model.cs +++ b/CampusAppWP8/CampusAppWP8/Model/Person/PersonListWp8Model.cs @@ -1,30 +1,27 @@ -//----------------------------------------------------------------------------- +//----------------------------------------------------------------------- // -// Company copyright tag. +// The MIT License (MIT). Copyright (c) 2013 BTU/IIT. // -// stubbfel -// 05.09.2013 -//----------------------------------------------------------------------------- - +// Stubbfel +// 15.10.2013 +// Implements the person list wp 8 model class +//----------------------------------------------------------------------- namespace CampusAppWP8.Model.Person { using System.Xml.Serialization; using CampusAppWPortalLib8.Model.Person; using System.Collections.Generic; - /// Person list model. - /// Stubbfel, 05.09.2013. + /// 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. - /// Gets a person. - /// Stubbfel, 05.09.2013. - /// The identifier. - /// The person. + /// Gets a person. + /// Stubbfel, 15.10.2013. + /// The identifier. + /// The person. public override PersonWp8Model GetPerson(string id) { foreach (PersonWp8Model tmpPerson in this.Persons) @@ -38,9 +35,8 @@ namespace CampusAppWP8.Model.Person return null; } - - /// Removes the non function person. - /// Stubbfel, 05.09.2013. + /// Removes the non function person. + /// Stubbfel, 05.09.2013. public override void RemoveNonFunctionPerson() { List removeList = new List(); @@ -58,8 +54,8 @@ namespace CampusAppWP8.Model.Person } } - /// Sets person identifier to function. - /// Stubbfel, 05.09.2013. + /// Sets person identifier to function. + /// Stubbfel, 05.09.2013. public override void SetPersonIdToFunction() { foreach (PersonWp8Model person in this.Persons) diff --git a/CampusAppWP8/CampusAppWP8/Model/Person/PersonWp8Model.cs b/CampusAppWP8/CampusAppWP8/Model/Person/PersonWp8Model.cs index ccceb929..ccc49410 100644 --- a/CampusAppWP8/CampusAppWP8/Model/Person/PersonWp8Model.cs +++ b/CampusAppWP8/CampusAppWP8/Model/Person/PersonWp8Model.cs @@ -1,23 +1,25 @@ -//----------------------------------------------------------------------------- +//----------------------------------------------------------------------- // -// Company copyright tag. +// The MIT License (MIT). Copyright (c) 2013 BTU/IIT. // -// stubbfel -// 05.09.2013 -//----------------------------------------------------------------------------- +// Stubbfel +// 15.10.2013 +// Implements the person wp 8 model class +//----------------------------------------------------------------------- namespace CampusAppWP8.Model.Person { using System.Xml.Serialization; using CampusAppWP8.Utility; - /// Person model. - /// Stubbfel, 05.09.2013. + /// Person model. + /// Stubbfel, 05.09.2013. + /// public class PersonWp8Model : CampusAppWPortalLib8.Model.Person.PersonModel { #region property - /// Gets or sets the akadgrad. - /// The akadgrad. + /// Gets or sets the akadgrad. + /// The akadgrad. [XmlAttribute("akadgrad")] public new string Akadgrad { @@ -35,8 +37,8 @@ namespace CampusAppWP8.Model.Person } } - /// Gets or sets the name of the sur. - /// The name of the sur. + /// Gets or sets the name of the sur. + /// The name of the sur. [XmlAttribute("nachname")] public new string SurName { @@ -54,8 +56,8 @@ namespace CampusAppWP8.Model.Person } } - /// Gets or sets the person's first name. - /// The name of the first. + /// Gets or sets the person's first name. + /// The name of the first. [XmlAttribute("vorname")] public new string FirstName { diff --git a/CampusAppWP8/CampusAppWP8/Model/Setting/AppSettings.cs b/CampusAppWP8/CampusAppWP8/Model/Setting/AppSettings.cs index af3dd11e..b1a1b976 100644 --- a/CampusAppWP8/CampusAppWP8/Model/Setting/AppSettings.cs +++ b/CampusAppWP8/CampusAppWP8/Model/Setting/AppSettings.cs @@ -1,35 +1,37 @@ //----------------------------------------------------------------------- // -// Company copyright tag. +// The MIT License (MIT). Copyright (c) 2013 BTU/IIT. // -// stubbfel -// 08.08.2013 -//---------------------------------------------------------------------- - +// Stubbfel +// 15.10.2013 +// Implements the application settings class +//----------------------------------------------------------------------- namespace CampusAppWP8.Model.Setting { using CampusAppWP8.Resources; - /// - /// Model for settings of the app - /// + /// Model for settings of the app. + /// Stubbfel, 15.10.2013. public class AppSettings { - #region Enum + /// Values that represent BTUTagDefaultHandler. + /// Stubbfel, 15.10.2013. public enum BTUTagDefaultHandler { + /// An enum constant representing the information page option. InfoPage = 0, + + /// An enum constant representing the campus map option. CampusMap = 1 } #endregion #region Property - /// - /// Gets or sets a value indicating whether the GeoWatch-Flag - /// + /// Gets or sets a value indicating whether the GeoWatch-Flag. + /// true if geo watch enable, false if not. public bool GeoWatchEnable { get @@ -43,9 +45,8 @@ namespace CampusAppWP8.Model.Setting } } - /// - /// Gets or sets a value indicating whether the InitializationApp-Flag - /// + /// Gets or sets a value indicating whether the InitializationApp-Flag. + /// true if initialise application, false if not. public bool InitApp { get @@ -59,8 +60,8 @@ namespace CampusAppWP8.Model.Setting } } - /// Gets or sets a value indicating whether the development mode. - /// true if development mode, false if not. + /// Gets or sets a value indicating whether the development mode. + /// true if development mode, false if not. public bool DevMode { get @@ -74,8 +75,8 @@ namespace CampusAppWP8.Model.Setting } } - /// Gets or sets a value indicating whether the uni network. - /// true if uni network, false if not. + /// Gets or sets a value indicating whether the uni network. + /// true if uni network, false if not. public bool UniNetwork { get @@ -89,8 +90,8 @@ namespace CampusAppWP8.Model.Setting } } - /// Gets or sets a value indicating whether this object is WiFi enable. - /// true if WiFi enable, false if not. + /// Gets or sets a value indicating whether this object is WiFi enable. + /// true if WiFi enable, false if not. public bool WifiEnable { get @@ -104,8 +105,8 @@ namespace CampusAppWP8.Model.Setting } } - /// Gets or sets a value indicating whether the only WiFi. - /// true if only wifi, false if not. + /// Gets or sets a value indicating whether the only WiFi. + /// true if only wifi, false if not. public bool OnlyWifi { get @@ -119,28 +120,30 @@ namespace CampusAppWP8.Model.Setting } } - /// - /// Gets or sets the DeploymentNumber of the app - /// + /// Gets or sets the DeploymentNumber of the app. + /// The deployment number. public int DeploymentNumber { get { return App.LoadFromAppState(Constants.AppSetting_DeploymentNumber); } + set { - App.SaveToAppState(Constants.AppSetting_DeploymentNumber,value); + App.SaveToAppState(Constants.AppSetting_DeploymentNumber, value); } } - + /// Gets or sets the tag default handler. + /// The tag default handler. public BTUTagDefaultHandler TagDefaultHandler { get { return App.LoadFromAppState(Constants.AppSetting_BTUTagDefaultHandler); } + set { App.SaveToAppState(Constants.AppSetting_BTUTagDefaultHandler, value); diff --git a/CampusAppWP8/CampusAppWP8/Model/Setting/BTUTagHandlerTypes.cs b/CampusAppWP8/CampusAppWP8/Model/Setting/BTUTagHandlerTypes.cs new file mode 100644 index 00000000..1967f073 --- /dev/null +++ b/CampusAppWP8/CampusAppWP8/Model/Setting/BTUTagHandlerTypes.cs @@ -0,0 +1,21 @@ +//----------------------------------------------------------------------- +// +// The MIT License (MIT). Copyright (c) 2013 BTU/IIT. +// +// Stubbfel +// 15.10.2013 +// Implements the btu tag handler types class +//----------------------------------------------------------------------- +namespace CampusAppWP8.Model.Setting +{ + /// Values that represent BTUTagDefaultHandler. + /// Stubbfel, 15.10.2013. + public enum BTUTagDefaultHandler + { + /// An enum constant representing the information page option. + InfoPage = 0, + + /// An enum constant representing the campus map option. + CampusMap = 1 + } +} diff --git a/CampusAppWP8/CampusAppWP8/Model/Setting/TagHandlerListPickerItemListModel.cs b/CampusAppWP8/CampusAppWP8/Model/Setting/TagHandlerListPickerItemListModel.cs index 96eec5f6..645a2bc7 100644 --- a/CampusAppWP8/CampusAppWP8/Model/Setting/TagHandlerListPickerItemListModel.cs +++ b/CampusAppWP8/CampusAppWP8/Model/Setting/TagHandlerListPickerItemListModel.cs @@ -1,25 +1,28 @@ -// -// Company copyright tag.List +//----------------------------------------------------------------------- +// +// The MIT License (MIT). Copyright (c) 2013 BTU/IIT. // -// stubbfel -// 25.07.2013 -//---------------------------------------------------------------------- +// Stubbfel +// 15.10.2013 +// Implements the tag handler list picker item list model class +//----------------------------------------------------------------------- namespace CampusApp8.Model.Setting { - using CampusAppWPortalLib8.Model.Utility; using CampusAppWP8.Model.Setting; using CampusAppWP8.Resources; + using CampusAppWPortalLib8.Model.Utility; - /// - /// Class for the RoleList - /// + /// A data Model for the tag handler list picker item list. + /// Stubbfel, 15.10.2013. + /// public class TagHandlerListPickerItemListModel : ListPickerItemListModel { #region Constructor /// - /// Initializes a new instance of the class. + /// Initializes a new instance of the TagHandlerListPickerItemListModel class. /// + /// Stubbfel, 15.10.2013. public TagHandlerListPickerItemListModel() : base() { @@ -30,9 +33,9 @@ namespace CampusApp8.Model.Setting #region Method - /// - /// Overrides the LoadList-Method - /// + /// Overrides the LoadList-Method + /// Stubbfel, 15.10.2013. + /// protected override void LoadList() { this.AddItem(new ListPickerItemModel(AppSettings.BTUTagDefaultHandler.InfoPage.ToString(), AppResources.Setting_TagHandlerInfo)); diff --git a/CampusAppWP8/CampusAppWP8/Model/Setting/UserProfilModel.cs b/CampusAppWP8/CampusAppWP8/Model/Setting/UserProfilModel.cs index f61df5a4..2951d780 100644 --- a/CampusAppWP8/CampusAppWP8/Model/Setting/UserProfilModel.cs +++ b/CampusAppWP8/CampusAppWP8/Model/Setting/UserProfilModel.cs @@ -1,46 +1,39 @@ //----------------------------------------------------------------------- // -// Company copyright tag. +// The MIT License (MIT). Copyright (c) 2013 BTU/IIT. // -// stubbfel -// 23.07.2013 -//---------------------------------------------------------------------- +// Stubbfel +// 15.10.2013 +// Implements the user profil model class +//----------------------------------------------------------------------- namespace CampusAppWP8.Model.Setting { using System.Xml.Serialization; using CampusAppWP8.Resources; using CampusAppWPortalLib8.Model.Settings; - /// - /// Model for the profile of an user - /// + /// Model for the profile of an user. + /// Stubbfel, 15.10.2013. [XmlRoot("root")] public class UserProfilModel { #region Members - /// - /// constant for the first validate semester - /// + /// constant for the first validate semester. private static readonly int FirstSemester = int.Parse(Constants.Valid_FirstSemseter); - /// - /// constant for the last validate semester - /// + /// constant for the last validate semester. private static readonly int LastSemester = int.Parse(Constants.Valid_LastSemseter); - /// - /// constant for the max. number of a validate course - /// + /// constant for the max. number of a validate course. private static readonly int MaxCourseNumber = int.Parse(Constants.Valid_MaxCourseNumber); #endregion #region Proberties - /// - /// Gets or sets the course of the user - /// + /// Gets or sets the course of the user. + /// The course. public int Course { get @@ -57,9 +50,8 @@ namespace CampusAppWP8.Model.Setting } } - /// - /// Gets or sets the defaultCampus of the user - /// + /// Gets or sets the defaultCampus of the user. + /// The default campus. public Campus DefaultCampus { get @@ -73,9 +65,8 @@ namespace CampusAppWP8.Model.Setting } } - /// - /// Gets or sets the role of the user - /// + /// Gets or sets the role of the user. + /// The role. public RoleType Role { get @@ -89,9 +80,8 @@ namespace CampusAppWP8.Model.Setting } } - /// - /// Gets or sets the degree of the user - /// + /// Gets or sets the degree of the user. + /// The degree. public DegreeType Degree { get @@ -105,9 +95,8 @@ namespace CampusAppWP8.Model.Setting } } - /// - /// Gets or sets the semester of the user - /// + /// Gets or sets the semester of the user. + /// The semester. public int Semester { get @@ -127,11 +116,10 @@ namespace CampusAppWP8.Model.Setting #region Methods - /// - /// Methods check if a value could be a valid semester - /// - /// value which has to be checked - /// true if it is an valid semester, otherwise false + /// Methods check if a value could be a valid semester. + /// Stubbfel, 15.10.2013. + /// value which has to be checked. + /// true if it is an valid semester, otherwise false. private bool ValditateSemester(int possibleSemester) { if (possibleSemester < UserProfilModel.FirstSemester || possibleSemester > UserProfilModel.LastSemester) @@ -142,11 +130,10 @@ namespace CampusAppWP8.Model.Setting return true; } - /// - /// Methods check if a value could be a valid course - /// - /// value which has to be checked - /// true if it is an valid course, otherwise false + /// Methods check if a value could be a valid course. + /// Stubbfel, 15.10.2013. + /// value which has to be checked. + /// true if it is an valid course, otherwise false. private bool ValditateCourse(int possibleCourse) { if (possibleCourse > UserProfilModel.MaxCourseNumber) diff --git a/CampusAppWP8/CampusAppWP8/Model/Utility/CourseListPickerItemListWp8Model.cs b/CampusAppWP8/CampusAppWP8/Model/Utility/CourseListPickerItemListWp8Model.cs index d520b49d..d7437a86 100644 --- a/CampusAppWP8/CampusAppWP8/Model/Utility/CourseListPickerItemListWp8Model.cs +++ b/CampusAppWP8/CampusAppWP8/Model/Utility/CourseListPickerItemListWp8Model.cs @@ -1,9 +1,11 @@ -// -// Company copyright tag.List +//----------------------------------------------------------------------- +// +// The MIT License (MIT). Copyright (c) 2013 BTU/IIT. // -// stubbfel -// 25.07.2013 -//---------------------------------------------------------------------- +// Stubbfel +// 15.10.2013 +// Implements the course list picker item list wp 8 model class +//----------------------------------------------------------------------- namespace CampusAppWP8.Model.Utility { using System.Collections.Generic; @@ -12,14 +14,14 @@ namespace CampusAppWP8.Model.Utility using CampusAppWP8.Utility; using CampusAppWPortalLib8.Model.Utility; - /// - /// This is a class for the courseList - /// + /// This is a class for the courseList. + /// Stubbfel, 15.10.2013. + /// public class CourseListPickerItemListWp8Model : CampusAppWPortalLib8.Model.Utility.CourseListPickerItemListModel { #region Member - /// List of courses. + /// List of courses. private CourseFeed courseList; #endregion @@ -27,8 +29,9 @@ namespace CampusAppWP8.Model.Utility #region Constructor /// - /// Initializes a new instance of the class. + /// Initializes a new instance of the class. /// + /// Stubbfel, 15.10.2013. public CourseListPickerItemListWp8Model() { } @@ -37,14 +40,11 @@ namespace CampusAppWP8.Model.Utility #region Events - /// - /// Delegate of the OnIO callback function. - /// + /// Delegate of the OnIO callback function. + /// Stubbfel, 15.10.2013. public delegate void OnIO(); - /// - /// Callback pointer, called after loading. - /// + /// Callback pointer, called after loading. public event OnIO OnLoaded = null; #endregion @@ -53,9 +53,8 @@ namespace CampusAppWP8.Model.Utility #region public - /// - /// Overrides the LoadList-Method - /// + /// Overrides the LoadList-Method + /// Stubbfel, 15.10.2013. public void LoadCourseList() { if (this.courseList == null || this.courseList.Model == null) @@ -76,25 +75,25 @@ namespace CampusAppWP8.Model.Utility #region private - /// Feed is fail. - /// Stubbfel, 10.09.2013. + /// Feed is fail. + /// Stubbfel, 10.09.2013. private void FeedIsFail() { this.FallBackList(); this.CallOnLoaded(); } - /// Feed is ready. - /// Stubbfel, 10.09.2013. + /// Feed is ready. + /// Stubbfel, 10.09.2013. private void FeedIsReady() { this.ConvertToListPickerItemModel(this.courseList.Model.CreateCourseList()); this.CallOnLoaded(); } - /// Converts a courseList to a list picker item model. - /// Stubbfel, 10.09.2013. - /// List of courses. + /// Converts a courseList to a list picker item model. + /// Stubbfel, 10.09.2013. + /// List of courses. private void ConvertToListPickerItemModel(List courseList) { foreach (CourseModel course in courseList) @@ -106,8 +105,8 @@ namespace CampusAppWP8.Model.Utility this.courseList.SaveData(); } - /// Call on loaded. - /// Stubbfel, 10.09.2013. + /// Call on loaded. + /// Stubbfel, 10.09.2013. private void CallOnLoaded() { if (this.OnLoaded != null) diff --git a/CampusAppWP8/CampusAppWP8/Model/XmlModel.cs b/CampusAppWP8/CampusAppWP8/Model/XmlModel.cs index c0a24f9d..958f118a 100644 --- a/CampusAppWP8/CampusAppWP8/Model/XmlModel.cs +++ b/CampusAppWP8/CampusAppWP8/Model/XmlModel.cs @@ -1,31 +1,31 @@ -//----------------------------------------------------------------------------- +//----------------------------------------------------------------------- // -// Company copyright tag. +// The MIT License (MIT). Copyright (c) 2013 BTU/IIT. // // fiedlchr -// 05.07.2013 -//----------------------------------------------------------------------------- +// 15.10.2013 +// Implements the XML model class +//----------------------------------------------------------------------- namespace CampusAppWP8.Model { using System.Text; using CampusAppWPortalLib8.Utility; using CampusAppWPortalLib8.Model; using CampusAppWPortalLib8.Resources; - - /// - /// Xml model io handler class. - /// - /// model type + + /// Xml model io handler class. + /// fiedlchr, 15.10.2013. + /// + /// public abstract class XmlModel : MainModel, IXmlModel { #region Constructor - /// - /// Initializes a new instance of the class. - /// - /// model io type - /// filename of the data file - /// url of the feed data + /// Initializes a new instance of the class. + /// fiedlchr, 15.10.2013. + /// model io type. + /// filename of the data file. + /// url of the feed data. public XmlModel(ModelType modelType, string fileName, string url) : base(modelType, fileName, url) { @@ -33,11 +33,12 @@ namespace CampusAppWP8.Model } /// - /// Initializes a new instance of the class. - /// Use only if the model io type is file or feed, not both. + /// Initializes a new instance of the class. Use only if the model + /// io type is file or feed, not both. /// - /// model io type - /// name of the file or the url of the feed + /// fiedlchr, 15.10.2013. + /// model io type. + /// name of the file or the url of the feed. public XmlModel(ModelType modelType, string sourceName) : base(modelType, sourceName) { @@ -48,20 +49,18 @@ namespace CampusAppWP8.Model #region Property - /// - /// Gets or sets for the name of the root-tag - /// + /// Gets or sets for the name of the root-tag. + /// public string ValidRootName { get; set; } #endregion #region Method - /// - /// Create the model from a xml byte array. - /// - /// model data - /// true, if succeeded + /// Create the model from a xml byte array. + /// fiedlchr, 15.10.2013. + /// model data. + /// true, if succeeded. protected override bool DeserializeModel(byte[] modelData) { bool retValue = true; @@ -81,10 +80,9 @@ namespace CampusAppWP8.Model return retValue; } - /// - /// Serializes the model to a byte array. - /// - /// model data + /// Serializes the model to a byte array. + /// fiedlchr, 15.10.2013. + /// model data. protected override byte[] SerializeModel() { byte[] retValue = null; diff --git a/CampusAppWP8/CampusAppWP8/Pages/Setting/AppSettingPage.xaml b/CampusAppWP8/CampusAppWP8/Pages/Setting/AppSettingPage.xaml index 20e6192b..5fcb9e65 100644 --- a/CampusAppWP8/CampusAppWP8/Pages/Setting/AppSettingPage.xaml +++ b/CampusAppWP8/CampusAppWP8/Pages/Setting/AppSettingPage.xaml @@ -41,7 +41,7 @@ - +