diff --git a/CampusAppWP8/CampusAppDLL/CampusAppDLL.csproj b/CampusAppWP8/CampusAppDLL/CampusAppDLL.csproj index ac3271f3..d039f9d6 100644 --- a/CampusAppWP8/CampusAppDLL/CampusAppDLL.csproj +++ b/CampusAppWP8/CampusAppDLL/CampusAppDLL.csproj @@ -9,8 +9,9 @@ Properties CampusAppDLL CampusAppDLL - v4.5 + v4.0 512 + Client true diff --git a/CampusAppWP8/CampusAppDLL/Model/GeoDb/PlaceInformation.cs b/CampusAppWP8/CampusAppDLL/Model/GeoDb/PlaceInformation.cs index f23d4124..96390875 100644 --- a/CampusAppWP8/CampusAppDLL/Model/GeoDb/PlaceInformation.cs +++ b/CampusAppWP8/CampusAppDLL/Model/GeoDb/PlaceInformation.cs @@ -7,20 +7,35 @@ //---------------------------------------------------------------------- namespace CampusAppDLL.Model.GeoDb { + using System; using System.Xml.Serialization; /// Information about the place. /// Stubbfel, 19.08.2013. - public class PlaceInformation + public class PlaceInformation : IEquatable { /// Gets or sets the name of the information. /// The name of the information. - [XmlElement("placeInformationName")] + [XmlAttribute("placeInformationName")] public string InformationName { get; set; } /// Gets or sets the information value. /// The information value. [XmlText] public string InformationValue { get; set; } + + /// 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)) + { + return true; + } + + return false; + } } } diff --git a/CampusAppWP8/CampusAppDLL/Model/GeoDb/PlaceModel.cs b/CampusAppWP8/CampusAppDLL/Model/GeoDb/PlaceModel.cs index 8e0a0d20..939b4f76 100644 --- a/CampusAppWP8/CampusAppDLL/Model/GeoDb/PlaceModel.cs +++ b/CampusAppWP8/CampusAppDLL/Model/GeoDb/PlaceModel.cs @@ -8,13 +8,16 @@ namespace CampusAppDLL.Model.GeoDb { + using System; + using System.Collections.Generic; using System.Collections.ObjectModel; + using System.Text.RegularExpressions; using System.Xml.Serialization; /// /// Model for a place of the SPSService /// - public class PlaceModel + public class PlaceModel : IEquatable { /// /// Gets or sets the placeId @@ -34,6 +37,7 @@ namespace CampusAppDLL.Model.GeoDb [XmlAttribute("refpoint")] public string RefPoint { get; set; } + /// Gets or sets the information. /// The information. [XmlElement("placeInformation")] @@ -43,5 +47,121 @@ namespace CampusAppDLL.Model.GeoDb /// The services. [XmlElement("placeService")] public ObservableCollection Services { get; set; } + + /// Converts this object to a nfc string. + /// Stubbfel, 21.08.2013. + /// This object as a string. + public string ToNfcString() + { + string nfcStr = "{\"pid\":\"" + this.PlaceId + "\",\"parent\":\"" + this.ParentId + "\"}"; + 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. + public bool Equals(PlaceModel other) + { + if (other.PlaceId.Equals(this.PlaceId)) + { + return true; + } + + return false; + } + + /// Adds a place informations. + /// Stubbfel, 09.09.2013. + /// The place informations. + public void AddPlaceInformations(List placeInformations) + { + foreach (PlaceInformation info in placeInformations) + { + if (this.Informations.Contains(info)) + { + int index = this.Informations.IndexOf(info); + this.Informations[index].InformationValue = info.InformationValue; + } + else + { + this.Informations.Add(info); + } + } + } + + /// Adds a place services. + /// Stubbfel, 09.09.2013. + /// The place services. + public void AddPlaceServices(List placeServices) + { + foreach (PlaceService service in placeServices) + { + if (this.Services.Contains(service)) + { + int index = this.Services.IndexOf(service); + this.Services[index].Request = service.Request; + this.Services[index].SAP = service.SAP; + } + else + { + this.Services.Add(service); + } + } + } + + /// 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) + { + bool tmpResult = false; + foreach (PlaceInformation info in this.Informations) + { + if (name.Equals(info.InformationName)) + { + tmpResult = true; + break; + } + } + + if (!tmpResult) + { + return tmpResult; + } + } + + return true; + } + + /// 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) + { + bool tmpResult = false; + foreach (PlaceService service in this.Services) + { + if (name.Equals(service.ServiceName)) + { + tmpResult = true; + break; + } + } + + if (!tmpResult) + { + return tmpResult; + } + } + + return true; + } } } diff --git a/CampusAppWP8/CampusAppDLL/Model/GeoDb/PlaceService.cs b/CampusAppWP8/CampusAppDLL/Model/GeoDb/PlaceService.cs index 7e17403c..2804886d 100644 --- a/CampusAppWP8/CampusAppDLL/Model/GeoDb/PlaceService.cs +++ b/CampusAppWP8/CampusAppDLL/Model/GeoDb/PlaceService.cs @@ -8,11 +8,12 @@ namespace CampusAppDLL.Model.GeoDb { + using System; using System.Xml.Serialization; /// Place service. /// Stubbfel, 19.08.2013. - public class PlaceService + public class PlaceService : IEquatable { /// Gets or sets the name of the service. /// The name of the service. @@ -28,5 +29,29 @@ namespace CampusAppDLL.Model.GeoDb /// The request. [XmlElement("request")] public string Request { get; set; } + + /// Gets the URL string. + /// The URL string. + public string URLString + { + get + { + return this.SAP + this.Request; + } + } + + /// 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)) + { + return true; + } + + return false; + } } } diff --git a/CampusAppWP8/CampusAppDLL/Model/GeoDb/SpsModel.cs b/CampusAppWP8/CampusAppDLL/Model/GeoDb/SpsModel.cs index 4fa4bb86..396fa73e 100644 --- a/CampusAppWP8/CampusAppDLL/Model/GeoDb/SpsModel.cs +++ b/CampusAppWP8/CampusAppDLL/Model/GeoDb/SpsModel.cs @@ -23,6 +23,7 @@ namespace CampusAppDLL.Model.GeoDb /// Stubbfel, 20.08.2013. public SpsModel() { + this.HasChanged = false; this.Places = new ObservableCollection(); } @@ -32,6 +33,10 @@ namespace CampusAppDLL.Model.GeoDb [XmlElement("place")] public ObservableCollection Places { get; set; } + /// Gets a value indicating whether this object has changed. + /// true if this object has changed, false if not. + public bool HasChanged { get; set; } + /// Gets places by information. /// Stubbfel, 19.08.2013. /// The query. @@ -83,5 +88,113 @@ namespace CampusAppDLL.Model.GeoDb return resultplaces.ToList(); } + + /// Adds the places. + /// Stubbfel, 09.09.2013. + /// A list of places. + public void AddPlaces(List places) + { + foreach (PlaceModel place in places) + { + if (this.Places.Contains(place)) + { + int index = this.Places.IndexOf(place); + this.Places[index].AddPlaceInformations(place.Informations.ToList()); + this.Places[index].AddPlaceServices(place.Services.ToList()); + } + else + { + this.Places.Add(place); + } + } + this.HasChanged = true; + } + + /// Creates PID list. + /// Stubbfel, 09.09.2013. + /// The new PID list. + public List CreatePidList() + { + List pidList = new List(); + foreach (PlaceModel place in this.Places) + { + pidList.Add(place.PlaceId); + } + + return pidList; + } + + /// 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) + { + if (place.PlaceId.Equals(id)) + { + return place; + } + } + + 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. + public bool ContainsInformationNames(List pidList, List names) + { + foreach (string pid in pidList) + { + PlaceModel place = this.GetPlaceById(pid); + if (!place.ContainsInformationNames(names)) + { + return false; + } + } + + 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. + public bool ContainsServiceNames(List pidList, List names) + { + foreach (string pid in pidList) + { + PlaceModel place = this.GetPlaceById(pid); + if (!place.ContainsServiceNames(names)) + { + return false; + } + } + + return true; + } + + /// Filter by PID. + /// Stubbfel, 11.09.2013. + /// List of pids. + /// flitered list of places + public List FilterByPid(List pidList) + { + List fitlerList = new List(); + foreach (PlaceModel place in this.Places) + { + if (pidList.Contains(place.PlaceId)) + { + fitlerList.Add(place); + } + } + + return fitlerList; + } } } diff --git a/CampusAppWP8/CampusAppW8.sln b/CampusAppWP8/CampusAppW8.sln index 8403729e..f65bd6ee 100644 --- a/CampusAppWP8/CampusAppW8.sln +++ b/CampusAppWP8/CampusAppW8.sln @@ -33,9 +33,9 @@ Global {120B88CC-F3F0-4C5A-A3FD-C26E835338CC}.Debug|ARM.ActiveCfg = Debug|ARM {120B88CC-F3F0-4C5A-A3FD-C26E835338CC}.Debug|ARM.Build.0 = Debug|ARM {120B88CC-F3F0-4C5A-A3FD-C26E835338CC}.Debug|ARM.Deploy.0 = Debug|ARM - {120B88CC-F3F0-4C5A-A3FD-C26E835338CC}.Debug|Mixed Platforms.ActiveCfg = Debug|x86 - {120B88CC-F3F0-4C5A-A3FD-C26E835338CC}.Debug|Mixed Platforms.Build.0 = Debug|x86 - {120B88CC-F3F0-4C5A-A3FD-C26E835338CC}.Debug|Mixed Platforms.Deploy.0 = Debug|x86 + {120B88CC-F3F0-4C5A-A3FD-C26E835338CC}.Debug|Mixed Platforms.ActiveCfg = Debug|Any CPU + {120B88CC-F3F0-4C5A-A3FD-C26E835338CC}.Debug|Mixed Platforms.Build.0 = Debug|Any CPU + {120B88CC-F3F0-4C5A-A3FD-C26E835338CC}.Debug|Mixed Platforms.Deploy.0 = Debug|Any CPU {120B88CC-F3F0-4C5A-A3FD-C26E835338CC}.Debug|Win32.ActiveCfg = Debug|x86 {120B88CC-F3F0-4C5A-A3FD-C26E835338CC}.Debug|Win32.Build.0 = Debug|x86 {120B88CC-F3F0-4C5A-A3FD-C26E835338CC}.Debug|Win32.Deploy.0 = Debug|x86 @@ -65,9 +65,9 @@ Global {E49420AA-3023-42EF-8255-67B1F5E52B43}.Debug|ARM.ActiveCfg = Debug|ARM {E49420AA-3023-42EF-8255-67B1F5E52B43}.Debug|ARM.Build.0 = Debug|ARM {E49420AA-3023-42EF-8255-67B1F5E52B43}.Debug|ARM.Deploy.0 = Debug|ARM - {E49420AA-3023-42EF-8255-67B1F5E52B43}.Debug|Mixed Platforms.ActiveCfg = Debug|x86 - {E49420AA-3023-42EF-8255-67B1F5E52B43}.Debug|Mixed Platforms.Build.0 = Debug|x86 - {E49420AA-3023-42EF-8255-67B1F5E52B43}.Debug|Mixed Platforms.Deploy.0 = Debug|x86 + {E49420AA-3023-42EF-8255-67B1F5E52B43}.Debug|Mixed Platforms.ActiveCfg = Debug|Any CPU + {E49420AA-3023-42EF-8255-67B1F5E52B43}.Debug|Mixed Platforms.Build.0 = Debug|Any CPU + {E49420AA-3023-42EF-8255-67B1F5E52B43}.Debug|Mixed Platforms.Deploy.0 = Debug|Any CPU {E49420AA-3023-42EF-8255-67B1F5E52B43}.Debug|Win32.ActiveCfg = Debug|x86 {E49420AA-3023-42EF-8255-67B1F5E52B43}.Debug|Win32.Build.0 = Debug|x86 {E49420AA-3023-42EF-8255-67B1F5E52B43}.Debug|Win32.Deploy.0 = Debug|x86 diff --git a/CampusAppWP8/CampusAppWP8/Api/GeoApi/CampusSpsApi.cs b/CampusAppWP8/CampusAppWP8/Api/GeoApi/CampusSpsApi.cs index 3502c684..e6b79166 100644 --- a/CampusAppWP8/CampusAppWP8/Api/GeoApi/CampusSpsApi.cs +++ b/CampusAppWP8/CampusAppWP8/Api/GeoApi/CampusSpsApi.cs @@ -5,22 +5,20 @@ // stubbfel // 12.08.2013 //---------------------------------------------------------------------- -namespace CampusAppWP8.Feed.GeoApi +namespace CampusAppWP8.Api.GeoApi { using System; - using System.Collections.Generic; - using CampusAppWP8.Model; using CampusAppWP8.Model.GeoDb; - using CampusAppWP8.Model.Utility; using CampusAppWP8.Resources; - using CampusAppWP8.Utility; - using System.Device.Location; + using CampusAppWP8.Utility; /// /// Class for SPSAPI /// public class CampusSpsApi : SpsApi { + #region Constructor + /// /// Initializes a new instance of the class. /// @@ -29,6 +27,10 @@ namespace CampusAppWP8.Feed.GeoApi { } + #endregion + + #region Method + /// /// Method set the UriParameter of a campusRequest for a given latitude and longitude /// @@ -72,5 +74,7 @@ namespace CampusAppWP8.Feed.GeoApi return Settings.UserProfil.DefaultCampus; } + + #endregion } } diff --git a/CampusAppWP8/CampusAppWP8/Api/GeoApi/PisApi.cs b/CampusAppWP8/CampusAppWP8/Api/GeoApi/PisApi.cs new file mode 100644 index 00000000..2409d10a --- /dev/null +++ b/CampusAppWP8/CampusAppWP8/Api/GeoApi/PisApi.cs @@ -0,0 +1,64 @@ +//----------------------------------------------------------------------- +// +// Company copyright tag. +// +// stubbfel +// 09.09.2013 +//---------------------------------------------------------------------- + +namespace CampusAppWP8.Api.GeoApi +{ + using System.Collections.Generic; + using CampusAppWP8.Model; + using CampusAppWP8.Model.GeoDb; + using CampusAppWP8.Model.Utility; + using CampusAppWP8.Resources; + + /// Pis api. + /// Stubbfel, 09.09.2013. + public class PisApi : XmlModel + { + #region Constructor + + /// Initializes a new instance of the PisApi class. + /// Stubbfel, 09.09.2013. + public PisApi() + : base(ModelType.Feed, Constants.UrlPisService) + { + } + + #endregion + + #region Method + + /// Sets up the information request. + /// Stubbfel, 09.09.2013. + /// List of pids. + /// (Optional) list of names of the information. + public void SetupInformationRequest(List pidList, List infoNames = null) + { + string pidListStr = string.Empty; + foreach (string pid in pidList) + { + pidListStr += "/" + pid; + } + + List parameterList = new List(); + parameterList.Add(new CleanUrlParamModel(Constants.PisApi_PidListKey, pidListStr.Trim('/'))); + if (infoNames != null) + { + string infoNamesStr = string.Empty; + foreach (string name in infoNames) + { + infoNamesStr += "/" + name; + } + + parameterList.Add(new CleanUrlParamModel(Constants.PisApi_InformationNameKey, infoNamesStr.Trim('/'))); + } + + this.SetUriParams(parameterList); + } + + #endregion + } +} diff --git a/CampusAppWP8/CampusAppWP8/Api/GeoApi/PssApi.cs b/CampusAppWP8/CampusAppWP8/Api/GeoApi/PssApi.cs new file mode 100644 index 00000000..b6cb614e --- /dev/null +++ b/CampusAppWP8/CampusAppWP8/Api/GeoApi/PssApi.cs @@ -0,0 +1,64 @@ +//----------------------------------------------------------------------- +// +// Company copyright tag. +// +// stubbfel +// 09.09.2013 +//---------------------------------------------------------------------- + +namespace CampusAppWP8.Api.GeoApi +{ + using System.Collections.Generic; + using CampusAppWP8.Model; + using CampusAppWP8.Model.GeoDb; + using CampusAppWP8.Model.Utility; + using CampusAppWP8.Resources; + + /// Pss api. + /// Stubbfel, 09.09.2013. + public class PssApi : XmlModel + { + #region Constructor + + /// Initializes a new instance of the PssApi class. + /// Stubbfel, 09.09.2013. + public PssApi() + : base(ModelType.Feed, Constants.UrlPssService) + { + } + + #endregion + + #region Method + + /// Sets up the service request. + /// Stubbfel, 09.09.2013. + /// List of pids. + /// (Optional) list of names of the services. + public void SetupServiceRequest(List pidList, List serviceNames = null) + { + string pidListStr = string.Empty; + foreach (string pid in pidList) + { + pidListStr += "/" + pid; + } + + List parameterList = new List(); + parameterList.Add(new CleanUrlParamModel(Constants.PssApi_PidListKey, pidListStr.Trim('/'))); + if (serviceNames != null) + { + string serviceNamesStr = string.Empty; + foreach (string name in serviceNames) + { + serviceNamesStr += "/" + name; + } + + parameterList.Add(new CleanUrlParamModel(Constants.PssApi_ServiceNameKey, serviceNamesStr.Trim('/'))); + } + + this.SetUriParams(parameterList); + } + + #endregion + } +} diff --git a/CampusAppWP8/CampusAppWP8/Api/GeoApi/SpsApi.cs b/CampusAppWP8/CampusAppWP8/Api/GeoApi/SpsApi.cs index 7972517f..18d727f7 100644 --- a/CampusAppWP8/CampusAppWP8/Api/GeoApi/SpsApi.cs +++ b/CampusAppWP8/CampusAppWP8/Api/GeoApi/SpsApi.cs @@ -5,21 +5,22 @@ // stubbfel // 06.08.2013 //---------------------------------------------------------------------- -namespace CampusAppWP8.Feed.GeoApi +namespace CampusAppWP8.Api.GeoApi { - using System; using System.Collections.Generic; using CampusAppWP8.Model; using CampusAppWP8.Model.GeoDb; using CampusAppWP8.Model.Utility; using CampusAppWP8.Resources; - using CampusAppWP8.Utility; + using CampusAppWP8.Utility; /// /// Class for SPSAPI /// public class SpsApi : XmlModel { + #region Constructor + /// /// Initializes a new instance of the class. /// @@ -28,6 +29,10 @@ namespace CampusAppWP8.Feed.GeoApi { } + #endregion + + #region Method + /// /// Method set the UriParameter of a placeRequest for a given latitude and longitude /// @@ -46,5 +51,18 @@ namespace CampusAppWP8.Feed.GeoApi this.SetUriParams(parameterList); } + + /// Sets up the current place request. + /// Stubbfel, 09.09.2013. + /// (Optional) request domain. + public void SetupCurrentPlaceRequest(string domian = null) + { + Utilities.DetermineAndStoreCurrentPosition(); + string lat = App.LoadFromAppState(Constants.GeoWatch_CurrentPosition_Lat); + string log = App.LoadFromAppState(Constants.GeoWatch_CurrentPosition_Long); + this.SetupPlaceRequest(lat, log, domian); + } + + #endregion } } diff --git a/CampusAppWP8/CampusAppWP8/Api/Lecture/LectureApi.cs b/CampusAppWP8/CampusAppWP8/Api/Lecture/LectureApi.cs index da60d1a9..bf49bb08 100644 --- a/CampusAppWP8/CampusAppWP8/Api/Lecture/LectureApi.cs +++ b/CampusAppWP8/CampusAppWP8/Api/Lecture/LectureApi.cs @@ -5,7 +5,7 @@ // stubbfel // 13.06.2013 //---------------------------------------------------------------------- -namespace CampusAppWP8.Feed.Lecture +namespace CampusAppWP8.Api.Lecture { using CampusAppWP8.Model; using CampusAppWP8.Model.Lecture; @@ -19,6 +19,8 @@ namespace CampusAppWP8.Feed.Lecture /// public class LectureApi : XmlModel { + #region Constructor + /// /// Initializes a new instance of the class. /// @@ -27,5 +29,7 @@ namespace CampusAppWP8.Feed.Lecture { this.ValidRootName = Constants.LectureXmlValidRootName; } + + #endregion } } diff --git a/CampusAppWP8/CampusAppWP8/Api/Person/PersonSearchApi.cs b/CampusAppWP8/CampusAppWP8/Api/Person/PersonSearchApi.cs new file mode 100644 index 00000000..50ab4ef2 --- /dev/null +++ b/CampusAppWP8/CampusAppWP8/Api/Person/PersonSearchApi.cs @@ -0,0 +1,31 @@ +//----------------------------------------------------------------------------- +// +// Company copyright tag. +// +// stubbfel +// 05.09.2013 +//----------------------------------------------------------------------------- + +namespace CampusAppWP8.Api.Person +{ + using CampusAppWP8.Model; + using CampusAppWP8.Model.Person; + using CampusAppWP8.Resources; + + /// Person search api. + /// Stubbfel, 05.09.2013. + public class PersonSearchApi : XmlModel + { + #region Constructor + + /// Initializes a new instance of the PersonSearchApi class. + /// Stubbfel, 05.09.2013. + public PersonSearchApi() + : base(ModelType.Feed, Constants.UrlPerson_PersonSearchByName) + { + this.ValidRootName = Constants.PersonListValidRootName; + } + + #endregion + } +} diff --git a/CampusAppWP8/CampusAppWP8/Assets/Icons/DarkTheme/add_contact_159.png b/CampusAppWP8/CampusAppWP8/Assets/Icons/DarkTheme/add_contact_159.png new file mode 100644 index 00000000..0348b4c1 Binary files /dev/null and b/CampusAppWP8/CampusAppWP8/Assets/Icons/DarkTheme/add_contact_159.png differ diff --git a/CampusAppWP8/CampusAppWP8/Assets/Icons/DarkTheme/lab_159.png b/CampusAppWP8/CampusAppWP8/Assets/Icons/DarkTheme/lab_159.png new file mode 100644 index 00000000..22f3387f Binary files /dev/null and b/CampusAppWP8/CampusAppWP8/Assets/Icons/DarkTheme/lab_159.png differ diff --git a/CampusAppWP8/CampusAppWP8/Assets/Icons/DarkTheme/lecture_159.png b/CampusAppWP8/CampusAppWP8/Assets/Icons/DarkTheme/lecture_159.png new file mode 100644 index 00000000..254afb5a Binary files /dev/null and b/CampusAppWP8/CampusAppWP8/Assets/Icons/DarkTheme/lecture_159.png differ diff --git a/CampusAppWP8/CampusAppWP8/Assets/Icons/DarkTheme/practise_159.png b/CampusAppWP8/CampusAppWP8/Assets/Icons/DarkTheme/practise_159.png new file mode 100644 index 00000000..565b8dcf Binary files /dev/null and b/CampusAppWP8/CampusAppWP8/Assets/Icons/DarkTheme/practise_159.png differ diff --git a/CampusAppWP8/CampusAppWP8/Assets/Icons/DarkTheme/seminar_159.png b/CampusAppWP8/CampusAppWP8/Assets/Icons/DarkTheme/seminar_159.png new file mode 100644 index 00000000..e0b38745 Binary files /dev/null and b/CampusAppWP8/CampusAppWP8/Assets/Icons/DarkTheme/seminar_159.png differ diff --git a/CampusAppWP8/CampusAppWP8/Assets/Icons/LightTheme/add_contact_159.png b/CampusAppWP8/CampusAppWP8/Assets/Icons/LightTheme/add_contact_159.png new file mode 100644 index 00000000..70e67924 Binary files /dev/null and b/CampusAppWP8/CampusAppWP8/Assets/Icons/LightTheme/add_contact_159.png differ diff --git a/CampusAppWP8/CampusAppWP8/Assets/Icons/LightTheme/lab_159.png b/CampusAppWP8/CampusAppWP8/Assets/Icons/LightTheme/lab_159.png new file mode 100644 index 00000000..39943f90 Binary files /dev/null and b/CampusAppWP8/CampusAppWP8/Assets/Icons/LightTheme/lab_159.png differ diff --git a/CampusAppWP8/CampusAppWP8/Assets/Icons/LightTheme/lecture_159.png b/CampusAppWP8/CampusAppWP8/Assets/Icons/LightTheme/lecture_159.png new file mode 100644 index 00000000..1a6b2a66 Binary files /dev/null and b/CampusAppWP8/CampusAppWP8/Assets/Icons/LightTheme/lecture_159.png differ diff --git a/CampusAppWP8/CampusAppWP8/Assets/Icons/LightTheme/practise_159.png b/CampusAppWP8/CampusAppWP8/Assets/Icons/LightTheme/practise_159.png new file mode 100644 index 00000000..e9e54821 Binary files /dev/null and b/CampusAppWP8/CampusAppWP8/Assets/Icons/LightTheme/practise_159.png differ diff --git a/CampusAppWP8/CampusAppWP8/Assets/Icons/LightTheme/seminar_159.png b/CampusAppWP8/CampusAppWP8/Assets/Icons/LightTheme/seminar_159.png new file mode 100644 index 00000000..8981575b Binary files /dev/null and b/CampusAppWP8/CampusAppWP8/Assets/Icons/LightTheme/seminar_159.png differ diff --git a/CampusAppWP8/CampusAppWP8/CampusAppWP8.csproj b/CampusAppWP8/CampusAppWP8/CampusAppWP8.csproj index 525d8374..a828d095 100644 --- a/CampusAppWP8/CampusAppWP8/CampusAppWP8.csproj +++ b/CampusAppWP8/CampusAppWP8/CampusAppWP8.csproj @@ -94,18 +94,23 @@ + + + App.xaml - + + + @@ -119,12 +124,14 @@ + + @@ -195,6 +202,13 @@ PersonPage.xaml + + PlaceNews.xaml + + + ShowPad.xaml + + @@ -333,7 +347,7 @@ - + QRScanner.xaml @@ -423,6 +437,14 @@ Designer MSBuild:Compile + + Designer + MSBuild:Compile + + + Designer + MSBuild:Compile + Designer MSBuild:Compile @@ -459,7 +481,7 @@ Designer MSBuild:Compile - + Designer MSBuild:Compile @@ -484,6 +506,7 @@ + @@ -491,11 +514,16 @@ + + + + + @@ -508,6 +536,8 @@ + + @@ -520,11 +550,13 @@ + + @@ -586,9 +618,7 @@ - - - + + - - + diff --git a/CampusAppWP8/CampusAppWP8/Pages/Events/EventPage.xaml.cs b/CampusAppWP8/CampusAppWP8/Pages/Events/EventPage.xaml.cs index 9283b491..03f83d24 100644 --- a/CampusAppWP8/CampusAppWP8/Pages/Events/EventPage.xaml.cs +++ b/CampusAppWP8/CampusAppWP8/Pages/Events/EventPage.xaml.cs @@ -25,6 +25,8 @@ namespace CampusAppWP8.Pages.Events /// public partial class EventPage : PhoneApplicationPage { + #region Method + /// /// To checking if the feed source is already set or not. /// @@ -46,6 +48,10 @@ namespace CampusAppWP8.Pages.Events /// The is in speech. private volatile bool isInSpeech = false; + #endregion + + #region Constructor + /// /// Initializes a new instance of the class. /// @@ -71,6 +77,12 @@ namespace CampusAppWP8.Pages.Events this.isInSpeech = false; } + #endregion + + #region Method + + #region protected + /// /// On navigation to this page. /// The PivotItem source will be set, if it wasn't before. @@ -157,6 +169,10 @@ namespace CampusAppWP8.Pages.Events } } + #endregion + + #region private + /// /// Called when the index of the selected PivotItem is changed. /// Set the text Grid to visible and the WebBrowser to collapsed. @@ -222,5 +238,9 @@ namespace CampusAppWP8.Pages.Events this.isInSpeech = false; } } + + #endregion + + #endregion } } diff --git a/CampusAppWP8/CampusAppWP8/Pages/Exams/Exams.xaml.cs b/CampusAppWP8/CampusAppWP8/Pages/Exams/Exams.xaml.cs index 6bcaebe2..bce8f255 100644 --- a/CampusAppWP8/CampusAppWP8/Pages/Exams/Exams.xaml.cs +++ b/CampusAppWP8/CampusAppWP8/Pages/Exams/Exams.xaml.cs @@ -21,12 +21,18 @@ namespace CampusAppWP8.Pages.Exams /// Stubbfel, 02.09.2013. public partial class Exams : PhoneApplicationPage { + #region Member + /// The feed. private ExamFeed feed; /// The exam file. private ExamFile file; + #endregion + + #region Constructor + /// Initializes a new instance of the Exams class. /// Stubbfel, 02.09.2013. public Exams() @@ -35,6 +41,12 @@ namespace CampusAppWP8.Pages.Exams this.InitializeFeed(); } + #endregion + + #region Method + + #region protected + /// Wird aufgerufen, wenn eine Seite die aktive Seite in einem Frame wird. /// Stubbfel, 02.09.2013. /// Ein Objekt, das die Ereignisdaten enthält. @@ -47,7 +59,7 @@ namespace CampusAppWP8.Pages.Exams } this.ProgressBar.Visibility = System.Windows.Visibility.Visible; - this.feed.LoadData(Utilities.getLoadModus()); + this.feed.LoadData(Utilities.GetLoadModus()); } /// @@ -68,6 +80,10 @@ namespace CampusAppWP8.Pages.Exams } } + #endregion + + #region private + /// Method initialize the Feed. /// Stubbfel, 02.09.2013. private void InitializeFeed() @@ -199,5 +215,9 @@ namespace CampusAppWP8.Pages.Exams this.file.LoadData(); this.ProgressBar.Visibility = System.Windows.Visibility.Visible; } + + #endregion + + #endregion } } \ No newline at end of file diff --git a/CampusAppWP8/CampusAppWP8/Pages/Lecture/LecturePage.xaml.cs b/CampusAppWP8/CampusAppWP8/Pages/Lecture/LecturePage.xaml.cs index df00699e..ee02e75c 100644 --- a/CampusAppWP8/CampusAppWP8/Pages/Lecture/LecturePage.xaml.cs +++ b/CampusAppWP8/CampusAppWP8/Pages/Lecture/LecturePage.xaml.cs @@ -11,7 +11,7 @@ namespace CampusAppWP8.Pages.Lecture using System.Collections.Generic; using System.Windows; using System.Windows.Navigation; - using CampusAppWP8.Feed.Lecture; + using CampusAppWP8.Api.Lecture; using CampusAppWP8.Model.Lecture; using CampusAppWP8.Model.Utility; using CampusAppWP8.Resources; @@ -54,8 +54,6 @@ namespace CampusAppWP8.Pages.Lecture this.InitializeComponent(); this.init = false; this.LoadPageModel(); - this.SetupListPickers(); - this.init = true; } #endregion @@ -63,7 +61,7 @@ namespace CampusAppWP8.Pages.Lecture #region methods #region protected - + /// /// Methods overrides the OnNavigatedFrom-Method /// @@ -94,7 +92,9 @@ namespace CampusAppWP8.Pages.Lecture /// private void LoadPageModel() { + this.ProgressBar.Visibility = Visibility.Visible; this.pageModel = new LecturePageModel(); + this.pageModel.OnLoaded += new LecturePageModel.OnIO(this.SetupListPickers); this.pageModel.LoadLists(); } @@ -117,6 +117,8 @@ namespace CampusAppWP8.Pages.Lecture } this.SetSelectedIndex(); + this.init = true; + this.ProgressBar.Visibility = Visibility.Collapsed; } /// @@ -159,9 +161,6 @@ namespace CampusAppWP8.Pages.Lecture /// /// Method send a request to the Feed /// - /// - /// have to refactors - /// /// sender of this event /// events arguments private void SendRequest(object sender, RoutedEventArgs e) @@ -201,6 +200,12 @@ namespace CampusAppWP8.Pages.Lecture /// private void ApiIsReady() { + string query = this.ActivtyName.Text; + if (!query.Equals(string.Empty)) + { + this.api.Model.FilterByCourseTitle(query); + } + App.SaveToIsolatedStorage(Constants.IsolatedStorage_LectureModel, this.api.Model); this.ProgressBar.Visibility = System.Windows.Visibility.Collapsed; Uri url = new Uri(Constants.PathLecture_ResultPage, UriKind.Relative); diff --git a/CampusAppWP8/CampusAppWP8/Pages/Lecture/ModulWebPage.xaml.cs b/CampusAppWP8/CampusAppWP8/Pages/Lecture/ModulWebPage.xaml.cs index cf6d4332..95e3e8d0 100644 --- a/CampusAppWP8/CampusAppWP8/Pages/Lecture/ModulWebPage.xaml.cs +++ b/CampusAppWP8/CampusAppWP8/Pages/Lecture/ModulWebPage.xaml.cs @@ -17,6 +17,8 @@ namespace CampusAppWP8.Pages.Lecture /// public partial class ModulWebPage : PhoneApplicationPage { + #region Constructor + /// /// Initializes a new instance of the class. /// @@ -24,6 +26,10 @@ namespace CampusAppWP8.Pages.Lecture { this.InitializeComponent(); } + + #endregion + + #region Method /// /// Override the OnNavigatedTo method @@ -39,5 +45,7 @@ namespace CampusAppWP8.Pages.Lecture base.OnNavigatedTo(e); } + + #endregion } } \ No newline at end of file diff --git a/CampusAppWP8/CampusAppWP8/Pages/Lecture/ResultDetailPage.xaml.cs b/CampusAppWP8/CampusAppWP8/Pages/Lecture/ResultDetailPage.xaml.cs index e09763e3..87a5c88e 100644 --- a/CampusAppWP8/CampusAppWP8/Pages/Lecture/ResultDetailPage.xaml.cs +++ b/CampusAppWP8/CampusAppWP8/Pages/Lecture/ResultDetailPage.xaml.cs @@ -17,6 +17,8 @@ namespace CampusAppWP8.Pages.Lecture /// public partial class ResultDetailPage : PhoneApplicationPage { + #region Constructor + /// /// Initializes a new instance of the class. /// @@ -25,6 +27,11 @@ namespace CampusAppWP8.Pages.Lecture this.InitializeComponent(); } + #endregion + + #region Method + + #region protected /// /// Override the OnNavigatedTo method /// @@ -40,6 +47,10 @@ namespace CampusAppWP8.Pages.Lecture base.OnNavigatedTo(e); } + #endregion + + #region private + /// /// Method load a certain Activity from the model /// @@ -53,7 +64,12 @@ namespace CampusAppWP8.Pages.Lecture activity.CreateLectureString(); activity.CreateCourseString(); this.ContentPanel.DataContext = activity; - } + } } + + #endregion + + #endregion + } } \ No newline at end of file diff --git a/CampusAppWP8/CampusAppWP8/Pages/Lecture/ResultPage.xaml b/CampusAppWP8/CampusAppWP8/Pages/Lecture/ResultPage.xaml index a2854ff7..0575f070 100644 --- a/CampusAppWP8/CampusAppWP8/Pages/Lecture/ResultPage.xaml +++ b/CampusAppWP8/CampusAppWP8/Pages/Lecture/ResultPage.xaml @@ -47,9 +47,12 @@ - - - + + + + + + diff --git a/CampusAppWP8/CampusAppWP8/Pages/Lecture/ResultPage.xaml.cs b/CampusAppWP8/CampusAppWP8/Pages/Lecture/ResultPage.xaml.cs index f464c0d3..aefe127f 100644 --- a/CampusAppWP8/CampusAppWP8/Pages/Lecture/ResultPage.xaml.cs +++ b/CampusAppWP8/CampusAppWP8/Pages/Lecture/ResultPage.xaml.cs @@ -9,9 +9,11 @@ namespace CampusAppWP8.Pages.Lecture { using System; using System.Linq; + using System.Windows; using System.Windows.Navigation; using CampusAppWP8.Model.Lecture; using CampusAppWP8.Resources; + using CampusAppWP8.Utility.Lui.MessageBoxes; using Microsoft.Phone.Controls; /// @@ -19,6 +21,8 @@ namespace CampusAppWP8.Pages.Lecture /// public partial class ResultPage : PhoneApplicationPage { + #region Constructor + /// /// Initializes a new instance of the class. /// @@ -27,12 +31,17 @@ namespace CampusAppWP8.Pages.Lecture this.InitializeComponent(); } + #endregion + + #region Method + /// /// Override the OnNavigatedTo method /// /// Arguments of navigation protected override void OnNavigatedTo(NavigationEventArgs e) { + base.OnNavigatedTo(e); LectureList list = App.LoadFromIsolatedStorage(Constants.IsolatedStorage_LectureModel); if (list == null) { @@ -41,8 +50,21 @@ namespace CampusAppWP8.Pages.Lecture return; } - this.ResultList.ItemsSource = list.Activities.OrderByDescending(o => o.Type).ThenBy(o => o.Title).ToList(); - base.OnNavigatedTo(e); + if (list.Activities.Count > 0) + { + this.ResultList.ItemsSource = list.Activities.OrderByDescending(o => o.Type).ThenBy(o => o.Title).ToList(); + } + else + { + MessageBoxResult result = MessageBoxes.ShowMainModelInfoMessageBox(AppResources.MsgBox_NoResult); + + if (result == MessageBoxResult.OK) + { + NavigationService.GoBack(); + } + } } + + #endregion } } \ No newline at end of file diff --git a/CampusAppWP8/CampusAppWP8/Pages/Links/LinkPage.xaml.cs b/CampusAppWP8/CampusAppWP8/Pages/Links/LinkPage.xaml.cs index 4cac9c3a..779eef46 100644 --- a/CampusAppWP8/CampusAppWP8/Pages/Links/LinkPage.xaml.cs +++ b/CampusAppWP8/CampusAppWP8/Pages/Links/LinkPage.xaml.cs @@ -12,9 +12,9 @@ namespace CampusAppWP8.Pages.Links using System.Windows.Navigation; using CampusAppWP8.Feed.Link; using CampusAppWP8.Resources; + using CampusAppWP8.Utility; using CampusAppWP8.Utility.Lui.MessageBoxes; using Microsoft.Phone.Controls; - using CampusAppWP8.Utility; /// /// Class for the LinkPage @@ -67,8 +67,8 @@ namespace CampusAppWP8.Pages.Links this.InitializeFeeds(); this.ProgressBar.Visibility = System.Windows.Visibility.Visible; this.loadingFeeds = 2; - this.commonLinkFeed.LoadData(Utilities.getLoadModus()); - this.clubLinkFeed.LoadData(Utilities.getLoadModus()); + this.commonLinkFeed.LoadData(Utilities.GetLoadModus()); + this.clubLinkFeed.LoadData(Utilities.GetLoadModus()); } /// diff --git a/CampusAppWP8/CampusAppWP8/Pages/Mensa/MensaPage.xaml.cs b/CampusAppWP8/CampusAppWP8/Pages/Mensa/MensaPage.xaml.cs index 228ffcb9..66988df9 100644 --- a/CampusAppWP8/CampusAppWP8/Pages/Mensa/MensaPage.xaml.cs +++ b/CampusAppWP8/CampusAppWP8/Pages/Mensa/MensaPage.xaml.cs @@ -11,13 +11,13 @@ namespace CampusAppWP8.Pages.Mensa using System.Threading; using System.Windows; using System.Windows.Navigation; - using CampusAppWP8.Feed.GeoApi; + using CampusAppWP8.Api.GeoApi; using CampusAppWP8.Feed.Mensa; using CampusAppWP8.Resources; + using CampusAppWP8.Utility; using CampusAppWP8.Utility.Lui.MessageBoxes; using Microsoft.Phone.Controls; using Microsoft.Phone.Shell; - using CampusAppWP8.Utility; /// /// Class for the MensaPage @@ -177,7 +177,7 @@ namespace CampusAppWP8.Pages.Mensa } else { - this.feed.LoadData(Utilities.getLoadModus()); + this.feed.LoadData(Utilities.GetLoadModus()); } } diff --git a/CampusAppWP8/CampusAppWP8/Pages/News/NewsIndexPage.xaml.cs b/CampusAppWP8/CampusAppWP8/Pages/News/NewsIndexPage.xaml.cs index b48619c2..7b5f8e7e 100644 --- a/CampusAppWP8/CampusAppWP8/Pages/News/NewsIndexPage.xaml.cs +++ b/CampusAppWP8/CampusAppWP8/Pages/News/NewsIndexPage.xaml.cs @@ -12,21 +12,27 @@ namespace CampusAppWP8.Pages.News using System.Windows.Navigation; using CampusAppWP8.Feed.News; using CampusAppWP8.Resources; + using CampusAppWP8.Utility; using CampusAppWP8.Utility.Lui.MessageBoxes; using Microsoft.Phone.Controls; using Microsoft.Phone.Shell; - using CampusAppWP8.Utility; /// /// Overview page of all news. /// public partial class NewsIndexPage : PhoneApplicationPage { + #region Member + /// /// News Feed object, which contains the RSS models and data. /// private static NewsFeed newsFeed = null; + #endregion + + #region Constructor + /// /// Initializes a new instance of the class. /// @@ -49,9 +55,13 @@ namespace CampusAppWP8.Pages.News NewsIndexPage.newsFeed.OnLoaded += new NewsFeed.OnIO(this.SetupNewsPageList); NewsIndexPage.newsFeed.OnFailedWeb += new NewsFeed.OnFailed(this.FeedIsFailWeb); NewsIndexPage.newsFeed.OnFailedFile += new NewsFeed.OnFailed(this.FeedIsFailFile); - NewsIndexPage.newsFeed.LoadData(Utilities.getLoadModus()); + NewsIndexPage.newsFeed.LoadData(Utilities.GetLoadModus()); } + #endregion + + #region Property + /// /// Gets or sets the feed object. /// @@ -80,6 +90,12 @@ namespace CampusAppWP8.Pages.News return NewsIndexPage.newsFeed; } + #endregion + + #region Method + + #region protected + /// /// On navigation to this page, creates a FeedEventHandler and load the RSS feed data. /// @@ -103,6 +119,11 @@ namespace CampusAppWP8.Pages.News base.OnNavigatedFrom(e); } + + #endregion + + #region private + /// /// Is called after the RSS feeds are loaded into the newsFeed model. /// If there was no feed information set to the UI, the feed list @@ -143,5 +164,9 @@ namespace CampusAppWP8.Pages.News this.progressBar.Visibility = Visibility.Collapsed; MessageBoxResult result = MessageBoxes.ShowMainModelErrorMessageBox(AppResources.MsgBox_ErrorMainModelLoadFile); } + + #endregion + + #endregion } } diff --git a/CampusAppWP8/CampusAppWP8/Pages/Openinghours/OpeninghoursPage.xaml.cs b/CampusAppWP8/CampusAppWP8/Pages/Openinghours/OpeninghoursPage.xaml.cs index ab256c91..725f7d2f 100644 --- a/CampusAppWP8/CampusAppWP8/Pages/Openinghours/OpeninghoursPage.xaml.cs +++ b/CampusAppWP8/CampusAppWP8/Pages/Openinghours/OpeninghoursPage.xaml.cs @@ -13,9 +13,9 @@ namespace CampusAppWP8.Pages.Openinghours using CampusAppWP8.Feed.Openinghours; using CampusAppWP8.Model.Openinghours; using CampusAppWP8.Resources; + using CampusAppWP8.Utility; using CampusAppWP8.Utility.Lui.MessageBoxes; using Microsoft.Phone.Controls; - using CampusAppWP8.Utility; /// /// Opening hours page. @@ -52,7 +52,7 @@ namespace CampusAppWP8.Pages.Openinghours this.feed.OnLoaded += new OpeninghoursFeed.OnIO(this.FeedIsReady); this.feed.OnFailedWeb += new OpeninghoursFeed.OnFailed(this.FeedIsFailedWeb); this.feed.OnFailedFile += new OpeninghoursFeed.OnFailed(this.FeedIsFailedFile); - this.feed.LoadData(Utilities.getLoadModus()); + this.feed.LoadData(Utilities.GetLoadModus()); } this.isNewInstance = true; diff --git a/CampusAppWP8/CampusAppWP8/Pages/Person/PersonPage.xaml b/CampusAppWP8/CampusAppWP8/Pages/Person/PersonPage.xaml index 42be8898..bfc4d4ca 100644 --- a/CampusAppWP8/CampusAppWP8/Pages/Person/PersonPage.xaml +++ b/CampusAppWP8/CampusAppWP8/Pages/Person/PersonPage.xaml @@ -6,6 +6,7 @@ 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:lui="clr-namespace:CampusAppWP8.Utility.Lui.Button" FontFamily="{StaticResource PhoneFontFamilyNormal}" FontSize="{StaticResource PhoneFontSizeNormal}" Foreground="{StaticResource PhoneForegroundBrush}" @@ -20,6 +21,8 @@ + + @@ -33,18 +36,22 @@ - + + + + + - - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/CampusAppWP8/CampusAppWP8/Pages/Person/PersonPage.xaml.cs b/CampusAppWP8/CampusAppWP8/Pages/Person/PersonPage.xaml.cs index 42f82e7f..b95c31e2 100644 --- a/CampusAppWP8/CampusAppWP8/Pages/Person/PersonPage.xaml.cs +++ b/CampusAppWP8/CampusAppWP8/Pages/Person/PersonPage.xaml.cs @@ -1,20 +1,143 @@ -using System; -using System.Collections.Generic; -using System.Linq; -using System.Net; -using System.Windows; -using System.Windows.Controls; -using System.Windows.Navigation; -using Microsoft.Phone.Controls; -using Microsoft.Phone.Shell; +//----------------------------------------------------------------------- +// +// Company copyright tag. +// +// stubbfel +// 09.09.2013 +//---------------------------------------------------------------------- namespace CampusAppWP8.Pages.Person { + using System.Collections.Generic; + 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 Microsoft.Phone.Controls; + using Microsoft.Phone.Tasks; + + /// Person page. + /// Stubbfel, 09.09.2013. public partial class PersonPage : PhoneApplicationPage { + #region Member + + /// The API. + private PersonSearchApi api; + + #endregion + + #region Constructor + + /// Initializes a new instance of the PersonPage class. + /// Stubbfel, 09.09.2013. public PersonPage() { - InitializeComponent(); + this.InitializeComponent(); } + + #endregion + + #region Method + + /// Sends a request. + /// Stubbfel, 09.09.2013. + /// Source of the event. + /// Routed event information. + private void SendRequest(object sender, RoutedEventArgs e) + { + string query = this.SearchName.Text.Trim(); + if (query.Equals(string.Empty)) + { + return; + } + + this.api = new PersonSearchApi(); + this.api.OnLoaded += new PersonSearchApi.OnIO(this.ApiIsReady); + this.api.OnFailedLoad += new PersonSearchApi.OnFailed(this.ApiIsFail); + this.ProgressBar.Visibility = System.Windows.Visibility.Visible; + List parameterList = this.CreateUrlParameter(query); + this.api.SetUriParams(parameterList); + this.api.LoadData(); + } + + /// Creates URL parameter. + /// Stubbfel, 09.09.2013. + /// The name. + /// The new URL parameter. + private List CreateUrlParameter(string name) + { + List parameterList = new List(); + parameterList.Add(new CleanUrlParamModel(Constants.ParamPersonList, name)); + return parameterList; + } + + /// API is fail. + /// Stubbfel, 09.09.2013. + private void ApiIsFail() + { + MessageBoxResult result = MessageBoxes.ShowMainModelErrorMessageBox(AppResources.MsgBox_ErrorMainModelLoad); + this.ProgressBar.Visibility = Visibility.Collapsed; + } + + /// API is ready. + /// Stubbfel, 09.09.2013. + private void ApiIsReady() + { + this.SetupResultBox(); + this.ProgressBar.Visibility = Visibility.Collapsed; + } + + /// Sets up the result box. + /// Stubbfel, 09.09.2013. + private void SetupResultBox() + { + this.api.Model.RemoveNonFunctionAndSetIdsPerson(); + this.ResultBox.ItemsSource = this.api.Model.Persons; + } + + /// Event handler. Called by Button for click events. + /// Stubbfel, 09.09.2013. + /// Source of the event. + /// Routed event information. + private void Button_Click(object sender, RoutedEventArgs e) + { + AddPersonButton btn = sender as AddPersonButton; + if (btn == null) + { + return; + } + + string personID = btn.PersonId as string; + int functionIndex = (int)btn.FunctionIndex; + + PersonModel person = this.api.Model.GetPerson(personID); + if (person == null) + { + return; + } + + SaveContactTask saveContactTask = new SaveContactTask(); + + saveContactTask.FirstName = person.FirstName; + saveContactTask.LastName = person.SurName; + saveContactTask.Title = person.Akadgrad; + saveContactTask.JobTitle = person.Functions[functionIndex].Function; + saveContactTask.Company = Constants.Addr_CBMainCompanyName + " - " + person.Functions[functionIndex].Appointment; + saveContactTask.WorkAddressCountry = Constants.Addr_CBMainCountry; + saveContactTask.WorkAddressCity = Constants.Addr_CBMainCity; + saveContactTask.WorkAddressState = Constants.Addr_CBMainState; + saveContactTask.WorkAddressZipCode = Constants.Addr_CBMainZipCode; + saveContactTask.WorkAddressStreet = person.Functions[functionIndex].Building; + saveContactTask.WorkPhone = person.Functions[functionIndex].Tel1; + saveContactTask.WorkEmail = person.Functions[functionIndex].Mail; + + saveContactTask.Show(); + } + + #endregion } } \ No newline at end of file diff --git a/CampusAppWP8/CampusAppWP8/Pages/PlaceNews/PlaceNews.xaml b/CampusAppWP8/CampusAppWP8/Pages/PlaceNews/PlaceNews.xaml new file mode 100644 index 00000000..52cbd5de --- /dev/null +++ b/CampusAppWP8/CampusAppWP8/Pages/PlaceNews/PlaceNews.xaml @@ -0,0 +1,60 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/CampusAppWP8/CampusAppWP8/Pages/PlaceNews/PlaceNews.xaml.cs b/CampusAppWP8/CampusAppWP8/Pages/PlaceNews/PlaceNews.xaml.cs new file mode 100644 index 00000000..b8c4ef91 --- /dev/null +++ b/CampusAppWP8/CampusAppWP8/Pages/PlaceNews/PlaceNews.xaml.cs @@ -0,0 +1,327 @@ +//----------------------------------------------------------------------- +// +// Company copyright tag. +// +// stubbfel +// 09.09.2013 +//---------------------------------------------------------------------- + +namespace CampusAppWP8.Pages.PlaceNews +{ + using System; + using System.Collections.Generic; + using System.Linq; + using System.Threading; + using System.Windows; + using System.Windows.Navigation; + using CampusAppWP8.Api.GeoApi; + using CampusAppWP8.File.Places; + using CampusAppWP8.Model.GeoDb; + using CampusAppWP8.Resources; + using CampusAppWP8.Utility; + using CampusAppWP8.Utility.Lui.MessageBoxes; + using Microsoft.Phone.Controls; + + /// Place news. + /// Stubbfel, 09.09.2013. + public partial class PlaceNews : PhoneApplicationPage + { + #region Member + /// The sps API. + private SpsApi spsApi; + + /// The pis API. + private PisApi pisApi; + + /// The pss API. + private PssApi pssApi; + + /// The places. + private PlacesFile places; + + /// variable indicates how many apis are running. + private int waitForApi; + + /// true to force request. + private bool forceRequest; + + /// List of search pids. + private List searchPidList; + + #endregion + + #region Constructor + + /// Initializes a new instance of the PlaceNews class. + /// Stubbfel, 09.09.2013. + public PlaceNews() + { + this.InitializeComponent(); + this.waitForApi = 0; + } + + #endregion + + #region Method + + #region protected + + /// Wird aufgerufen, wenn eine Seite die aktive Seite in einem Frame wird. + /// Stubbfel, 09.09.2013. + /// Ein Objekt, das die Ereignisdaten enthält. + protected override void OnNavigatedTo(NavigationEventArgs e) + { + base.OnNavigatedTo(e); + + if (NavigationMode.Back == e.NavigationMode && this.places == null) + { + this.places = new PlacesFile(); + this.places.Model = App.LoadFromIsolatedStorage(Constants.IsolatedStorage_AllPlaces); + this.SetupResultBox(); + } + else + { + this.ProgressBar.Visibility = System.Windows.Visibility.Visible; + Thread thread = new Thread(delegate() + { + this.InitializeApi(); + }); + thread.Start(); + } + } + + /// + /// Wird aufgerufen, wenn eine Seite nicht mehr die aktive Seite in einem Frame ist. + /// + /// Stubbfel, 09.09.2013. + /// Ein Objekt, das die Ereignisdaten enthält. + protected override void OnNavigatedFrom(NavigationEventArgs e) + { + if (NavigationMode.Back == e.NavigationMode) + { + App.SaveToIsolatedStorage(Constants.IsolatedStorage_AllPlaces, null); + } + } + + #endregion + + #region private + + /// Initializes the API. + /// Stubbfel, 09.09.2013. + private void InitializeApi() + { + // init place file + if (this.places == null) + { + this.places = new PlacesFile(); + this.places.OnLoaded += new PlacesFile.OnIO(this.PlacesFileIsReady); + this.places.OnFailedLoad += new PlacesFile.OnFailed(this.PlacesFileIsFail); + this.places.LoadData(); + } + + // init sps Api + if (this.spsApi == null || this.forceRequest) + { + this.spsApi = new SpsApi(); + this.spsApi.OnLoaded += new SpsApi.OnIO(this.SpsApiIsReady); + this.spsApi.OnFailedLoad += new SpsApi.OnFailed(this.ApiIsFail); + this.spsApi.SetupCurrentPlaceRequest(Constants.SpsDomain_Buildings); + if (this.forceRequest) + { + this.spsApi.LoadData(); + } + } + + // init pis API + if (this.pisApi == null || this.forceRequest) + { + this.pisApi = new PisApi(); + this.pisApi.OnLoaded += new PisApi.OnIO(this.PisApiIsReady); + this.pisApi.OnFailedLoad += new PisApi.OnFailed(this.ApiIsFail); + } + + // init pss Api + if (this.pssApi == null || this.forceRequest) + { + this.pssApi = new PssApi(); + this.pssApi.OnLoaded += new PssApi.OnIO(this.PssApiIsReady); + this.pssApi.OnFailedLoad += new PssApi.OnFailed(this.ApiIsFail); + } + + if (this.waitForApi < 1) + { + if (this.Dispatcher != null) + { + this.Dispatcher.BeginInvoke(new Action(() => this.ProgressBar.Visibility = System.Windows.Visibility.Collapsed)); + } + else + { + this.ProgressBar.Visibility = System.Windows.Visibility.Collapsed; + } + } + } + + /// Places file is fail. + /// Stubbfel, 09.09.2013. + private void PlacesFileIsFail() + { + this.places.Model = new SpsModel(); + if (this.spsApi == null) + { + this.spsApi = new SpsApi(); + this.spsApi.OnLoaded += new SpsApi.OnIO(this.SpsApiIsReady); + this.spsApi.OnFailedLoad += new SpsApi.OnFailed(this.ApiIsFail); + this.spsApi.SetupCurrentPlaceRequest(Constants.SpsDomain_Buildings); + } + + this.spsApi.LoadData(); + this.waitForApi++; + } + + /// Places file is ready. + /// Stubbfel, 09.09.2013. + private void PlacesFileIsReady() + { + if (this.spsApi == null) + { + this.spsApi = new SpsApi(); + this.spsApi.OnLoaded += new SpsApi.OnIO(this.SpsApiIsReady); + this.spsApi.OnFailedLoad += new SpsApi.OnFailed(this.ApiIsFail); + this.spsApi.SetupCurrentPlaceRequest(Constants.SpsDomain_Buildings); + } + + this.spsApi.LoadData(); + this.waitForApi++; + } + + /// Pss API is ready. + /// Stubbfel, 09.09.2013. + private void PssApiIsReady() + { + this.waitForApi--; + this.places.Model.AddPlaces(this.pssApi.Model.Places.ToList()); + + this.CheckedSetupResultBox(); + } + + /// Pis API is ready. + /// Stubbfel, 09.09.2013. + private void PisApiIsReady() + { + this.waitForApi--; + this.places.Model.AddPlaces(this.pisApi.Model.Places.ToList()); + + this.CheckedSetupResultBox(); + } + + /// API is fail. + /// Stubbfel, 09.09.2013. + private void ApiIsFail() + { + if (this.Dispatcher != null) + { + this.Dispatcher.BeginInvoke(new Action(() => MessageBoxes.ShowMainModelErrorMessageBox(AppResources.MsgBox_ErrorMainModelLoadWeb))); + this.Dispatcher.BeginInvoke(new Action(() => this.ProgressBar.Visibility = Visibility.Collapsed)); + } + } + + /// Sps API is ready. + /// Stubbfel, 09.09.2013. + private void SpsApiIsReady() + { + this.waitForApi--; + this.places.Model.AddPlaces(this.spsApi.Model.Places.ToList()); + + this.searchPidList = this.spsApi.Model.CreatePidList(); + List infoNames = new List() { Constants.PisInformationName_Name }; + List serviceNames = new List() { Constants.PssServiceName_PlaceNews }; + + // load from pis api + if (this.forceRequest || !this.places.Model.ContainsInformationNames(this.searchPidList, infoNames)) + { + this.pisApi.SetupInformationRequest(this.searchPidList, infoNames); + this.pisApi.LoadData(); + this.waitForApi++; + } + + // load from pis api + if (this.forceRequest || !this.places.Model.ContainsServiceNames(this.searchPidList, serviceNames)) + { + this.pssApi.SetupServiceRequest(this.searchPidList, serviceNames); + this.pssApi.LoadData(); + this.waitForApi++; + } + + this.CheckedSetupResultBox(); + } + + /// Sets up the result box. + /// Stubbfel, 09.09.2013. + private void SetupResultBox() + { + this.ResultBox.ItemsSource = this.places.Model.FilterByPid(this.searchPidList); + this.ProgressBar.Visibility = Visibility.Collapsed; + this.places.SaveData(); + App.SaveToIsolatedStorage(Constants.IsolatedStorage_AllPlaces, this.places.Model); + this.forceRequest = false; + } + + /// Event handler. Called by UpdateButtonAppBar for click events. + /// Stubbfel, 09.09.2013. + /// Source of the event. + /// Event information. + private void UpdateButtonAppBar_Click(object sender, EventArgs e) + { + this.ProgressBar.Visibility = Visibility.Visible; + Thread thread = new Thread(delegate() { this.InitApiCurrentPositionForce(); }); + thread.Start(); + } + + /// Initialises the API current position force. + /// Stubbfel, 09.09.2013. + private void InitApiCurrentPositionForce() + { + Utilities.DetermineAndStoreCurrentPositionForce(); + this.forceRequest = true; + this.InitializeApi(); + } + + /// Event handler. Called by ApplicationBarMenuItem for click events. + /// Stubbfel, 09.09.2013. + /// Source of the event. + /// Event information. + private void ApplicationBarMenuItem_Click(object sender, EventArgs e) + { + } + + /// Event handler. Called by ApplicationBarMenuItem_Click for 1 events. + /// Stubbfel, 09.09.2013. + /// Source of the event. + /// Event information. + private void ApplicationBarMenuItem_Click_1(object sender, EventArgs e) + { + } + + /// Checked setup result box. + /// Stubbfel, 10.09.2013. + private void CheckedSetupResultBox() + { + if (this.waitForApi < 1) + { + if (this.Dispatcher != null) + { + this.Dispatcher.BeginInvoke(new Action(() => this.SetupResultBox())); + } + else + { + this.SetupResultBox(); + } + } + } + + #endregion + + #endregion + } +} \ No newline at end of file diff --git a/CampusAppWP8/CampusAppWP8/Pages/PlaceNews/ShowPad.xaml b/CampusAppWP8/CampusAppWP8/Pages/PlaceNews/ShowPad.xaml new file mode 100644 index 00000000..364bb4a0 --- /dev/null +++ b/CampusAppWP8/CampusAppWP8/Pages/PlaceNews/ShowPad.xaml @@ -0,0 +1,35 @@ + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/CampusAppWP8/CampusAppWP8/Pages/PlaceNews/ShowPad.xaml.cs b/CampusAppWP8/CampusAppWP8/Pages/PlaceNews/ShowPad.xaml.cs new file mode 100644 index 00000000..31828bcc --- /dev/null +++ b/CampusAppWP8/CampusAppWP8/Pages/PlaceNews/ShowPad.xaml.cs @@ -0,0 +1,56 @@ +//----------------------------------------------------------------------- +// +// Company copyright tag. +// +// stubbfel +// 09.09.2013 +//---------------------------------------------------------------------- + +namespace CampusAppWP8.Pages.PlaceNews +{ + using System; + using System.Windows.Navigation; + using CampusAppWP8.Model.GeoDb; + using CampusAppWP8.Resources; + using Microsoft.Phone.Controls; + + /// Show pad. + /// Stubbfel, 09.09.2013. + public partial class ShowPad : PhoneApplicationPage + { + #region Constructor + + /// Initializes a new instance of the ShowPad class. + /// Stubbfel, 09.09.2013. + public ShowPad() + { + this.InitializeComponent(); + } + + #endregion + + #region Method + + /// Wird aufgerufen, wenn eine Seite die aktive Seite in einem Frame wird. + /// Stubbfel, 09.09.2013. + /// Ein Objekt, das die Ereignisdaten enthält. + protected override void OnNavigatedTo(NavigationEventArgs e) + { + if (NavigationContext.QueryString.ContainsKey(Constants.ParamPlaceID)) + { + SpsModel model = App.LoadFromIsolatedStorage(Constants.IsolatedStorage_AllPlaces); + string placeId = NavigationContext.QueryString[Constants.ParamPlaceID]; + PlaceModel place = model.GetPlaceById(placeId); + if (place != null && place.Services != null && place.Services.Count > 0 && place.Informations != null && place.Informations.Count > 0) + { + this.Room.Text += " - " + place.Informations[0].InformationValue; + this.WebmailBrowser.Navigate(new Uri(place.Services[0].URLString, UriKind.Absolute)); + } + } + + base.OnNavigatedTo(e); + } + + #endregion + } +} \ No newline at end of file diff --git a/CampusAppWP8/CampusAppWP8/Pages/Setting/AppSettingPage.xaml.cs b/CampusAppWP8/CampusAppWP8/Pages/Setting/AppSettingPage.xaml.cs index a3406e04..905422f7 100644 --- a/CampusAppWP8/CampusAppWP8/Pages/Setting/AppSettingPage.xaml.cs +++ b/CampusAppWP8/CampusAppWP8/Pages/Setting/AppSettingPage.xaml.cs @@ -15,6 +15,8 @@ namespace CampusAppWP8.Pages.Setting /// public partial class AppSettingPage : PhoneApplicationPage { + #region Constructor + /// /// Initializes a new instance of the class. /// @@ -25,6 +27,10 @@ namespace CampusAppWP8.Pages.Setting OnlyWiFiToggle.IsChecked = Settings.AppSetting.OnlyWifi; } + #endregion + + #region Method + /// /// Override the OnNavigatedFrom method /// @@ -37,5 +43,7 @@ namespace CampusAppWP8.Pages.Setting Settings.AppSetting.OnlyWifi = OnlyWiFiToggle.IsChecked.Value; } } + + #endregion } } \ No newline at end of file diff --git a/CampusAppWP8/CampusAppWP8/Pages/Setting/UserProfil.xaml.cs b/CampusAppWP8/CampusAppWP8/Pages/Setting/UserProfil.xaml.cs index f4668df9..2a5f9a81 100644 --- a/CampusAppWP8/CampusAppWP8/Pages/Setting/UserProfil.xaml.cs +++ b/CampusAppWP8/CampusAppWP8/Pages/Setting/UserProfil.xaml.cs @@ -8,6 +8,7 @@ namespace CampusAppWP8.Pages.Setting { using System; + using System.Windows; using System.Windows.Navigation; using CampusAppWP8.Model.Setting; using CampusAppWP8.Model.Utility; @@ -19,11 +20,20 @@ namespace CampusAppWP8.Pages.Setting /// public partial class UserProfil : PhoneApplicationPage { + #region Member + /// /// Reference of the profileFile /// private UserProfilModel userProfil; + /// List of courses. + private CourseListPickerItemListModel courseList; + + #endregion + + #region Constructor + /// /// Initializes a new instance of the class. /// @@ -31,10 +41,15 @@ namespace CampusAppWP8.Pages.Setting { this.InitializeComponent(); this.userProfil = Settings.UserProfil; - - this.SetupListPickers(); + this.LoadListPicker(); } + #endregion + + #region Method + + #region protected + /// /// Override the OnNavigatedFrom method /// @@ -47,28 +62,42 @@ namespace CampusAppWP8.Pages.Setting } } + #endregion + + #region private + + /// Loads list picker. + /// Stubbfel, 10.09.2013. + private void LoadListPicker() + { + this.ProgressBar.Visibility = Visibility.Visible; + this.courseList = new CourseListPickerItemListModel(); + this.courseList.OnLoaded += new CourseListPickerItemListModel.OnIO(this.SetupListPickers); + this.courseList.LoadCourseList(); + } + /// /// Method sets the ItemSource of the ListPickers /// private void SetupListPickers() { - CourseListPickerItemListModel courseList = new CourseListPickerItemListModel(); DegreeListPickerItemListModel degreeList = new DegreeListPickerItemListModel(); SemesterListPickerItemListModel semesterList = new SemesterListPickerItemListModel(); RoleListPickerItemListModel roleList = new RoleListPickerItemListModel(); CampusListPickerItemListModel campusList = new CampusListPickerItemListModel(); - this.Course.ItemsSource = courseList.List; + this.Course.ItemsSource = this.courseList.List; this.Degree.ItemsSource = degreeList.List; this.Semster.ItemsSource = semesterList.List; this.Role.ItemsSource = roleList.List; this.Campus.ItemsSource = campusList.List; - this.Course.SelectedIndex = courseList.GetIndexOrDefault(this.userProfil.Course.ToString().PadLeft(3, '0')); + this.Course.SelectedIndex = this.courseList.GetIndexOrDefault(this.userProfil.Course.ToString().PadLeft(3, '0')); this.Degree.SelectedIndex = degreeList.GetIndexOrDefault(((int)this.userProfil.Degree).ToString()); this.Semster.SelectedIndex = semesterList.GetIndexOrDefault(this.userProfil.Semester.ToString()); this.Role.SelectedIndex = roleList.GetIndexOrDefault(this.userProfil.Role.ToString()); this.Campus.SelectedIndex = campusList.GetIndexOrDefault(((int)this.userProfil.DefaultCampus).ToString()); + this.ProgressBar.Visibility = Visibility.Collapsed; } /// @@ -89,5 +118,9 @@ namespace CampusAppWP8.Pages.Setting Logger.LogException(e); } } + + #endregion + + #endregion } } \ No newline at end of file diff --git a/CampusAppWP8/CampusAppWP8/Pages/StartPage.xaml b/CampusAppWP8/CampusAppWP8/Pages/StartPage.xaml index 4ec8dd6e..2502caf2 100644 --- a/CampusAppWP8/CampusAppWP8/Pages/StartPage.xaml +++ b/CampusAppWP8/CampusAppWP8/Pages/StartPage.xaml @@ -181,6 +181,12 @@ + + + + + + diff --git a/CampusAppWP8/CampusAppWP8/Pages/StartPage.xaml.cs b/CampusAppWP8/CampusAppWP8/Pages/StartPage.xaml.cs index 8b57e6a7..459a5316 100644 --- a/CampusAppWP8/CampusAppWP8/Pages/StartPage.xaml.cs +++ b/CampusAppWP8/CampusAppWP8/Pages/StartPage.xaml.cs @@ -12,6 +12,7 @@ namespace CampusAppWP8.Pages using System.Windows; using System.Windows.Controls; using System.Windows.Navigation; + using CampusAppWP8.Feed.Utility; using CampusAppWP8.Resources; using CampusAppWP8.Utility; using CampusAppWP8.Utility.Lui.MessageBoxes; @@ -23,6 +24,15 @@ namespace CampusAppWP8.Pages /// public partial class StartPage : PhoneApplicationPage { + #region Member + + /// List of initialise courses. + private CourseFeed initCourseList; + + #endregion + + #region Constructor + /// /// Initializes a new instance of the class. /// @@ -63,12 +73,21 @@ namespace CampusAppWP8.Pages } if (!Settings.AppSetting.InitApp) - { + { + this.initCourseList = new CourseFeed(); + this.initCourseList.OnLoaded += new CourseFeed.OnIO(this.StoreCourseFeed); + this.initCourseList.LoadData(); this.ShowOptIns(); Settings.AppSetting.InitApp = true; } } + #endregion + + #region Method + + #region protected + /// /// Methods overrides the OnNavigatedTo-Method /// @@ -78,6 +97,17 @@ namespace CampusAppWP8.Pages base.OnNavigatedTo(e); } + #endregion + + #region private + + /// Stores course feed. + /// Stubbfel, 10.09.2013. + private void StoreCourseFeed() + { + this.initCourseList.SaveData(); + } + /// /// Method handle OrientationPage /// @@ -190,7 +220,7 @@ namespace CampusAppWP8.Pages /// Event information. private void ApplicationBarMenuItem4_Click(object sender, EventArgs e) { - Uri url = new Uri("/Utility/QRScanner/QRScanner.xaml", UriKind.Relative); + Uri url = new Uri("/Pages/Dev/QRScanner.xaml", UriKind.Relative); NavigationService.Navigate(url); } @@ -237,5 +267,9 @@ namespace CampusAppWP8.Pages Settings.AppSetting.GeoWatchEnable = false; } } + + #endregion + + #endregion } } \ No newline at end of file diff --git a/CampusAppWP8/CampusAppWP8/Pages/StudentCouncil/StudentCouncilPage.xaml.cs b/CampusAppWP8/CampusAppWP8/Pages/StudentCouncil/StudentCouncilPage.xaml.cs index 63523e6f..06ab89bd 100644 --- a/CampusAppWP8/CampusAppWP8/Pages/StudentCouncil/StudentCouncilPage.xaml.cs +++ b/CampusAppWP8/CampusAppWP8/Pages/StudentCouncil/StudentCouncilPage.xaml.cs @@ -12,9 +12,9 @@ namespace CampusAppWP8.Pages.StudentCouncil using System.Windows.Navigation; using CampusAppWP8.Feed.StudentCouncil; using CampusAppWP8.Resources; + using CampusAppWP8.Utility; using CampusAppWP8.Utility.Lui.MessageBoxes; using Microsoft.Phone.Controls; - using CampusAppWP8.Utility; /// /// Class for the StudentCouncilPage @@ -60,7 +60,7 @@ namespace CampusAppWP8.Pages.StudentCouncil } this.ProgressBar.Visibility = System.Windows.Visibility.Visible; - this.feed.LoadData(Utilities.getLoadModus()); + this.feed.LoadData(Utilities.GetLoadModus()); } /// diff --git a/CampusAppWP8/CampusAppWP8/Pages/Webmail/WebmailPage.xaml.cs b/CampusAppWP8/CampusAppWP8/Pages/Webmail/WebmailPage.xaml.cs index 50afc636..0344e9d7 100644 --- a/CampusAppWP8/CampusAppWP8/Pages/Webmail/WebmailPage.xaml.cs +++ b/CampusAppWP8/CampusAppWP8/Pages/Webmail/WebmailPage.xaml.cs @@ -16,6 +16,8 @@ namespace CampusAppWP8.Pages.Webmail /// public partial class WebmailPage : PhoneApplicationPage { + #region Constructor + /// /// Initializes a new instance of the class. /// @@ -25,6 +27,10 @@ namespace CampusAppWP8.Pages.Webmail this.LoadWebmailPage(); } + #endregion + + #region Method + /// /// Method load WebmailPage /// @@ -32,5 +38,7 @@ namespace CampusAppWP8.Pages.Webmail { this.WebmailBrowser.Navigate(new Uri(Constants.UrlWebMail_Addr, UriKind.Absolute)); } + + #endregion } } \ No newline at end of file diff --git a/CampusAppWP8/CampusAppWP8/Resources/AppResources.Designer.cs b/CampusAppWP8/CampusAppWP8/Resources/AppResources.Designer.cs index 61657fb9..83b8bb35 100644 --- a/CampusAppWP8/CampusAppWP8/Resources/AppResources.Designer.cs +++ b/CampusAppWP8/CampusAppWP8/Resources/AppResources.Designer.cs @@ -663,6 +663,24 @@ namespace CampusAppWP8.Resources { } } + /// + /// Sucht eine lokalisierte Zeichenfolge, die Hinweis ähnelt. + /// + public static string MsgBox_InfoHeader { + get { + return ResourceManager.GetString("MsgBox_InfoHeader", resourceCulture); + } + } + + /// + /// Sucht eine lokalisierte Zeichenfolge, die Es gibt keine Ergebnisse zur gestellten Anfrage ähnelt. + /// + public static string MsgBox_NoResult { + get { + return ResourceManager.GetString("MsgBox_NoResult", resourceCulture); + } + } + /// /// Sucht eine lokalisierte Zeichenfolge, die News ähnelt. /// @@ -717,6 +735,33 @@ namespace CampusAppWP8.Resources { } } + /// + /// Sucht eine lokalisierte Zeichenfolge, die Einrichtung ähnelt. + /// + public static string PersonApp_Appointment { + get { + return ResourceManager.GetString("PersonApp_Appointment", resourceCulture); + } + } + + /// + /// Sucht eine lokalisierte Zeichenfolge, die Sitz ähnelt. + /// + public static string PersonApp_Building { + get { + return ResourceManager.GetString("PersonApp_Building", resourceCulture); + } + } + + /// + /// Sucht eine lokalisierte Zeichenfolge, die Tätigkeit ähnelt. + /// + public static string PersonApp_FunctionName { + get { + return ResourceManager.GetString("PersonApp_FunctionName", resourceCulture); + } + } + /// /// Sucht eine lokalisierte Zeichenfolge, die Personensuche ähnelt. /// @@ -726,6 +771,15 @@ namespace CampusAppWP8.Resources { } } + /// + /// Sucht eine lokalisierte Zeichenfolge, die Nachname ähnelt. + /// + public static string PersonApp_SearchTextLabel { + get { + return ResourceManager.GetString("PersonApp_SearchTextLabel", resourceCulture); + } + } + /// /// Sucht eine lokalisierte Zeichenfolge, die Personen ähnelt. /// @@ -735,6 +789,15 @@ namespace CampusAppWP8.Resources { } } + /// + /// Sucht eine lokalisierte Zeichenfolge, die Placenews ähnelt. + /// + public static string PlaceNewsApp_Title { + get { + return ResourceManager.GetString("PlaceNewsApp_Title", resourceCulture); + } + } + /// /// Sucht eine lokalisierte Zeichenfolge, die Die primäre Kamera steht nicht zur Verfügung. ähnelt. /// diff --git a/CampusAppWP8/CampusAppWP8/Resources/AppResources.resx b/CampusAppWP8/CampusAppWP8/Resources/AppResources.resx index ef7e888e..d164954e 100644 --- a/CampusAppWP8/CampusAppWP8/Resources/AppResources.resx +++ b/CampusAppWP8/CampusAppWP8/Resources/AppResources.resx @@ -436,5 +436,25 @@ Bearbeiten + + Einrichtung + + + Sitz + + + Tätigkeit + + + Nachname + + + Placenews + + + Hinweis + + + Es gibt keine Ergebnisse zur gestellten Anfrage \ No newline at end of file diff --git a/CampusAppWP8/CampusAppWP8/Resources/Constants.Designer.cs b/CampusAppWP8/CampusAppWP8/Resources/Constants.Designer.cs index f3192aca..c2a8bac7 100644 --- a/CampusAppWP8/CampusAppWP8/Resources/Constants.Designer.cs +++ b/CampusAppWP8/CampusAppWP8/Resources/Constants.Designer.cs @@ -60,6 +60,51 @@ namespace CampusAppWP8.Resources { } } + /// + /// Sucht eine lokalisierte Zeichenfolge, die Cottbus ähnelt. + /// + public static string Addr_CBMainCity { + get { + return ResourceManager.GetString("Addr_CBMainCity", resourceCulture); + } + } + + /// + /// Sucht eine lokalisierte Zeichenfolge, die BTU ähnelt. + /// + public static string Addr_CBMainCompanyName { + get { + return ResourceManager.GetString("Addr_CBMainCompanyName", resourceCulture); + } + } + + /// + /// Sucht eine lokalisierte Zeichenfolge, die De ähnelt. + /// + public static string Addr_CBMainCountry { + get { + return ResourceManager.GetString("Addr_CBMainCountry", resourceCulture); + } + } + + /// + /// Sucht eine lokalisierte Zeichenfolge, die Brandenburg ähnelt. + /// + public static string Addr_CBMainState { + get { + return ResourceManager.GetString("Addr_CBMainState", resourceCulture); + } + } + + /// + /// Sucht eine lokalisierte Zeichenfolge, die 03046 ähnelt. + /// + public static string Addr_CBMainZipCode { + get { + return ResourceManager.GetString("Addr_CBMainZipCode", resourceCulture); + } + } + /// /// Sucht eine lokalisierte Zeichenfolge, die DevMode ähnelt. /// @@ -294,6 +339,15 @@ namespace CampusAppWP8.Resources { } } + /// + /// Sucht eine lokalisierte Zeichenfolge, die allPlaces.xml ähnelt. + /// + public static string FilePlace_AllPlaces { + get { + return ResourceManager.GetString("FilePlace_AllPlaces", resourceCulture); + } + } + /// /// Sucht eine lokalisierte Zeichenfolge, die user.xml ähnelt. /// @@ -339,6 +393,15 @@ namespace CampusAppWP8.Resources { } } + /// + /// Sucht eine lokalisierte Zeichenfolge, die AllPlaces ähnelt. + /// + public static string IsolatedStorage_AllPlaces { + get { + return ResourceManager.GetString("IsolatedStorage_AllPlaces", resourceCulture); + } + } + /// /// Sucht eine lokalisierte Zeichenfolge, die IsolatedStorage_DepartmentFavoriteModel ähnelt. /// @@ -573,6 +636,15 @@ namespace CampusAppWP8.Resources { } } + /// + /// Sucht eine lokalisierte Zeichenfolge, die Uebersicht ähnelt. + /// + public static string ParamPersonList { + get { + return ResourceManager.GetString("ParamPersonList", resourceCulture); + } + } + /// /// Sucht eine lokalisierte Zeichenfolge, die pivotindex ähnelt. /// @@ -582,6 +654,15 @@ namespace CampusAppWP8.Resources { } } + /// + /// Sucht eine lokalisierte Zeichenfolge, die placeId ähnelt. + /// + public static string ParamPlaceID { + get { + return ResourceManager.GetString("ParamPlaceID", resourceCulture); + } + } + /// /// Sucht eine lokalisierte Zeichenfolge, die Url ähnelt. /// @@ -762,6 +843,24 @@ namespace CampusAppWP8.Resources { } } + /// + /// Sucht eine lokalisierte Zeichenfolge, die /Pages/PlaceNews/PlaceNews.xaml ähnelt. + /// + public static string PathPlaceNews_PlaceNewsPage { + get { + return ResourceManager.GetString("PathPlaceNews_PlaceNewsPage", resourceCulture); + } + } + + /// + /// Sucht eine lokalisierte Zeichenfolge, die /Pages/PlaceNews/ShowPad.xaml ähnelt. + /// + public static string PathPlaceNews_ShowPadPage { + get { + return ResourceManager.GetString("PathPlaceNews_ShowPadPage", resourceCulture); + } + } + /// /// Sucht eine lokalisierte Zeichenfolge, die /Pages/Setting/AppSettingPage.xaml ähnelt. /// @@ -789,6 +888,78 @@ namespace CampusAppWP8.Resources { } } + /// + /// Sucht eine lokalisierte Zeichenfolge, die Uebersicht ähnelt. + /// + public static string PersonListValidRootName { + get { + return ResourceManager.GetString("PersonListValidRootName", resourceCulture); + } + } + + /// + /// Sucht eine lokalisierte Zeichenfolge, die iname ähnelt. + /// + public static string PisApi_InformationNameKey { + get { + return ResourceManager.GetString("PisApi_InformationNameKey", resourceCulture); + } + } + + /// + /// Sucht eine lokalisierte Zeichenfolge, die pid ähnelt. + /// + public static string PisApi_PidListKey { + get { + return ResourceManager.GetString("PisApi_PidListKey", resourceCulture); + } + } + + /// + /// Sucht eine lokalisierte Zeichenfolge, die Name ähnelt. + /// + public static string PisInformationName_Name { + get { + return ResourceManager.GetString("PisInformationName_Name", resourceCulture); + } + } + + /// + /// Sucht eine lokalisierte Zeichenfolge, die typ ähnelt. + /// + public static string PisInformationName_Typ { + get { + return ResourceManager.GetString("PisInformationName_Typ", resourceCulture); + } + } + + /// + /// Sucht eine lokalisierte Zeichenfolge, die pid ähnelt. + /// + public static string PssApi_PidListKey { + get { + return ResourceManager.GetString("PssApi_PidListKey", resourceCulture); + } + } + + /// + /// Sucht eine lokalisierte Zeichenfolge, die sname ähnelt. + /// + public static string PssApi_ServiceNameKey { + get { + return ResourceManager.GetString("PssApi_ServiceNameKey", resourceCulture); + } + } + + /// + /// Sucht eine lokalisierte Zeichenfolge, die PlaceNews ähnelt. + /// + public static string PssServiceName_PlaceNews { + get { + return ResourceManager.GetString("PssServiceName_PlaceNews", resourceCulture); + } + } + /// /// Sucht eine lokalisierte Zeichenfolge, die [+-]{0,1}[0-9]+[.,]{0,1}[0-9]+[\s][+-]{0,1}[0-9]+[.,]{0,1}[0-9]+ ähnelt. /// @@ -817,7 +988,7 @@ namespace CampusAppWP8.Resources { } /// - /// Sucht eine lokalisierte Zeichenfolge, die 3 ähnelt. + /// Sucht eine lokalisierte Zeichenfolge, die 1 ähnelt. /// public static string SpsApi_CampusDomain { get { @@ -852,6 +1023,15 @@ namespace CampusAppWP8.Resources { } } + /// + /// Sucht eine lokalisierte Zeichenfolge, die 2 ähnelt. + /// + public static string SpsDomain_Buildings { + get { + return ResourceManager.GetString("SpsDomain_Buildings", resourceCulture); + } + } + /// /// Sucht eine lokalisierte Zeichenfolge, die ToggleContent ähnelt. /// @@ -987,6 +1167,33 @@ namespace CampusAppWP8.Resources { } } + /// + /// Sucht eine lokalisierte Zeichenfolge, die https://www.zv.tu-cottbus.de/CMS-Webservice/Person ähnelt. + /// + public static string UrlPerson_PersonSearchByName { + get { + return ResourceManager.GetString("UrlPerson_PersonSearchByName", resourceCulture); + } + } + + /// + /// Sucht eine lokalisierte Zeichenfolge, die http://141.43.76.140/service/pis ähnelt. + /// + public static string UrlPisService { + get { + return ResourceManager.GetString("UrlPisService", resourceCulture); + } + } + + /// + /// Sucht eine lokalisierte Zeichenfolge, die http://141.43.76.140/service/pss ähnelt. + /// + public static string UrlPssService { + get { + return ResourceManager.GetString("UrlPssService", resourceCulture); + } + } + /// /// Sucht eine lokalisierte Zeichenfolge, die http://141.43.76.140/service/sps ähnelt. /// diff --git a/CampusAppWP8/CampusAppWP8/Resources/Constants.resx b/CampusAppWP8/CampusAppWP8/Resources/Constants.resx index 6e07b8c8..4d8d7e59 100644 --- a/CampusAppWP8/CampusAppWP8/Resources/Constants.resx +++ b/CampusAppWP8/CampusAppWP8/Resources/Constants.resx @@ -391,7 +391,7 @@ http://www.studentenwerk-frankfurt.de/2011/ClassPackage/App_IKMZ_BTU/index.php?mensa=Senftenberg&v=1 - 3 + 1 domain @@ -461,5 +461,73 @@ AppointmentIndex + + Uebersicht + + + https://www.zv.tu-cottbus.de/CMS-Webservice/Person + + + Cottbus + + + BTU + + + De + + + Brandenburg + + + 03046 + + + Uebersicht + + + allPlaces.xml + + + AllPlaces + + + placeId + + + /Pages/PlaceNews/PlaceNews.xaml + + + /Pages/PlaceNews/ShowPad.xaml + + + iname + + + pid + + + Name + + + typ + + + pid + + + sname + + + PlaceNews + + + 2 + + + http://141.43.76.140/service/pis + + + http://141.43.76.140/service/pss \ No newline at end of file diff --git a/CampusAppWP8/CampusAppWP8/Resources/Icons.cs b/CampusAppWP8/CampusAppWP8/Resources/Icons.cs index b52d7047..eb719a52 100644 --- a/CampusAppWP8/CampusAppWP8/Resources/Icons.cs +++ b/CampusAppWP8/CampusAppWP8/Resources/Icons.cs @@ -33,6 +33,17 @@ namespace CampusAppWP8.Resources } } + /// + /// Gets the uri string of the AddContact icon. + /// + public static string AddContact + { + get + { + return Themerize("add_contact_159.png"); + } + } + /// /// Gets the uri string of the Campus icon. /// @@ -176,6 +187,17 @@ namespace CampusAppWP8.Resources } } + /// + /// Gets the uri string of the Lab icon. + /// + public static string Lab + { + get + { + return Themerize("lab_159.png"); + } + } + /// /// Gets the uri string of the Lamb icon. /// @@ -187,6 +209,17 @@ namespace CampusAppWP8.Resources } } + /// + /// Gets the uri string of the Lecture icon. + /// + public static string Lecture + { + get + { + return Themerize("lecture_159.png"); + } + } + /// /// Gets the uri string of the Lectures icon. /// @@ -275,6 +308,17 @@ namespace CampusAppWP8.Resources } } + /// + /// Gets the uri string of the Practise icon. + /// + public static string Practise + { + get + { + return Themerize("practise_159.png"); + } + } + /// /// Gets the uri string of the Schedule icon. /// @@ -308,6 +352,17 @@ namespace CampusAppWP8.Resources } } + /// + /// Gets the uri string of the Seminar icon. + /// + public static string Seminar + { + get + { + return Themerize("seminar_159.png"); + } + } + /// /// Gets the uri string of the StudentCouncil icon. /// diff --git a/CampusAppWP8/CampusAppWP8/Resources/Icons.resx b/CampusAppWP8/CampusAppWP8/Resources/Icons.resx index 1cdc52f7..35f73cf8 100644 --- a/CampusAppWP8/CampusAppWP8/Resources/Icons.resx +++ b/CampusAppWP8/CampusAppWP8/Resources/Icons.resx @@ -120,6 +120,9 @@ add_159.png + + add_contact_159.png + campus_159.png @@ -159,9 +162,15 @@ info_159.png + + lab_159.png + info_159.png + + lecture_159.png + lectures_159.png @@ -186,6 +195,9 @@ info_159.png + + practise_159.png + schedule_159.png @@ -195,6 +207,9 @@ search_place_159.png + + seminar_159.png + student_council_159.png diff --git a/CampusAppWP8/CampusAppWP8/Settings.cs b/CampusAppWP8/CampusAppWP8/Settings.cs index a09bbe44..a02b99fb 100644 --- a/CampusAppWP8/CampusAppWP8/Settings.cs +++ b/CampusAppWP8/CampusAppWP8/Settings.cs @@ -15,6 +15,8 @@ namespace CampusAppWP8 /// public static class Settings { + #region Member + /// /// reference of the user-profile-file /// @@ -25,6 +27,10 @@ namespace CampusAppWP8 /// private static AppSettings appSetting = new AppSettings(); + #endregion + + #region Property + /// /// Gets or sets the user-profile-file /// @@ -62,5 +68,7 @@ namespace CampusAppWP8 } } } + + #endregion } } diff --git a/CampusAppWP8/CampusAppWP8/ThemelizedIcons.cs b/CampusAppWP8/CampusAppWP8/ThemelizedIcons.cs index 0cf17d0f..e353db8e 100644 --- a/CampusAppWP8/CampusAppWP8/ThemelizedIcons.cs +++ b/CampusAppWP8/CampusAppWP8/ThemelizedIcons.cs @@ -14,11 +14,17 @@ namespace CampusAppWP8 /// public class ThemelizedIcons { + #region Member + /// /// Resource object. /// private static Icons themelized = new Icons(); + #endregion + + #region Property + /// /// Gets the resource object. /// @@ -29,5 +35,7 @@ namespace CampusAppWP8 return themelized; } } + + #endregion } } \ No newline at end of file diff --git a/CampusAppWP8/CampusAppWP8/Utility/File.cs b/CampusAppWP8/CampusAppWP8/Utility/File.cs index 3a444a0d..7905b1d9 100644 --- a/CampusAppWP8/CampusAppWP8/Utility/File.cs +++ b/CampusAppWP8/CampusAppWP8/Utility/File.cs @@ -18,6 +18,8 @@ namespace CampusAppWP8.Utility /// public class File { + #region Member + /// /// Folder object. /// @@ -28,6 +30,10 @@ namespace CampusAppWP8.Utility /// private string filename = string.Empty; + #endregion + + #region Constructor + /// Initializes a new instance of the class. /// Stubbfel, 03.09.2013. /// file name. @@ -36,11 +42,21 @@ namespace CampusAppWP8.Utility this.filename = filename; } + #endregion + + #region Events + /// /// Delegation of the write callback function prototype. /// public delegate void WriteCallbackFunc(); + #endregion + + #region Method + + #region public + /// Read data from file to a string. /// Stubbfel, 03.09.2013. /// data string. @@ -99,6 +115,10 @@ namespace CampusAppWP8.Utility return null; } + #endregion + + #region private + /// /// Read data synchronous from file. /// @@ -208,5 +228,9 @@ namespace CampusAppWP8.Utility onSavedCallback(); } } + + #endregion + + #endregion } } \ No newline at end of file diff --git a/CampusAppWP8/CampusAppWP8/Utility/Logger.cs b/CampusAppWP8/CampusAppWP8/Utility/Logger.cs index 6b8d3d33..4416a3b4 100644 --- a/CampusAppWP8/CampusAppWP8/Utility/Logger.cs +++ b/CampusAppWP8/CampusAppWP8/Utility/Logger.cs @@ -14,6 +14,8 @@ namespace CampusAppWP8.Utility /// public class Logger { + #region Method + /// /// Method log a Exception /// @@ -31,5 +33,7 @@ namespace CampusAppWP8.Utility { Console.WriteLine(msg); } + + #endregion } } diff --git a/CampusAppWP8/CampusAppWP8/Utility/Lui/Button/AddPersonButton.cs b/CampusAppWP8/CampusAppWP8/Utility/Lui/Button/AddPersonButton.cs new file mode 100644 index 00000000..f02e2040 --- /dev/null +++ b/CampusAppWP8/CampusAppWP8/Utility/Lui/Button/AddPersonButton.cs @@ -0,0 +1,69 @@ +//----------------------------------------------------------------------- +// +// Company copyright tag. +// +// stubbfel +// 09.09.2013 +//---------------------------------------------------------------------- + +namespace CampusAppWP8.Utility.Lui.Button +{ + using System; + using System.Windows; + using System.Windows.Controls; + using System.Windows.Media.Imaging; + using CampusAppWP8.Resources; + + /// Add person button. + /// Stubbfel, 12.09.2013. + public class AddPersonButton : System.Windows.Controls.Button + { + #region Member + + /// The person identifier property. + public static readonly DependencyProperty PersonIdProperty = DependencyProperty.Register("PersonID", typeof(object), typeof(AddPersonButton), new PropertyMetadata(false)); + + /// The function index property. + public static readonly DependencyProperty FunctionIndexProperty = DependencyProperty.Register("FunctionIndex", typeof(object), typeof(AddPersonButton), new PropertyMetadata(false)); + + /// The icon. + private static BitmapImage icon = new BitmapImage(new Uri(Icons.AddContact, UriKind.Relative)); + + #endregion + + #region Constructor + + /// Initializes a new instance of the AddPersonButton class. + /// Stubbfel, 12.09.2013. + public AddPersonButton() + : base() + { + this.Content = new Image + { + Source = icon + }; + } + + #endregion + + #region Property + + /// Gets or sets the identifier of the person. + /// The identifier of the person. + public object PersonId + { + get { return (object)this.GetValue(PersonIdProperty); } + set { this.SetValue(PersonIdProperty, value); } + } + + /// Gets or sets zero-based index of the function. + /// The function index. + public object FunctionIndex + { + get { return (object)this.GetValue(FunctionIndexProperty); } + set { this.SetValue(FunctionIndexProperty, value); } + } + + #endregion + } +} diff --git a/CampusAppWP8/CampusAppWP8/Utility/Lui/MessageBoxes/MessageBoxes.cs b/CampusAppWP8/CampusAppWP8/Utility/Lui/MessageBoxes/MessageBoxes.cs index f444fc12..45d20f39 100644 --- a/CampusAppWP8/CampusAppWP8/Utility/Lui/MessageBoxes/MessageBoxes.cs +++ b/CampusAppWP8/CampusAppWP8/Utility/Lui/MessageBoxes/MessageBoxes.cs @@ -15,6 +15,8 @@ namespace CampusAppWP8.Utility.Lui.MessageBoxes /// public class MessageBoxes { + #region Method + /// /// Method show the MessageBox for the GeoWatch-OptIn /// @@ -33,5 +35,16 @@ namespace CampusAppWP8.Utility.Lui.MessageBoxes { return MessageBox.Show(text, AppResources.MsgBox_ErrorHeader, MessageBoxButton.OK); } + + /// Shows the main model information message box. + /// Stubbfel, 10.09.2013. + /// custom text for the box. + /// result of the UserInteraction + public static MessageBoxResult ShowMainModelInfoMessageBox(string text) + { + return MessageBox.Show(text, AppResources.MsgBox_InfoHeader, MessageBoxButton.OK); + } + + #endregion } } diff --git a/CampusAppWP8/CampusAppWP8/Utility/NDEF/NDEFShortRecord.cs b/CampusAppWP8/CampusAppWP8/Utility/NDEF/NDEFShortRecord.cs index 06927893..438edc25 100644 --- a/CampusAppWP8/CampusAppWP8/Utility/NDEF/NDEFShortRecord.cs +++ b/CampusAppWP8/CampusAppWP8/Utility/NDEF/NDEFShortRecord.cs @@ -13,6 +13,8 @@ namespace CampusAppWP8.Utility.NDEF /// Stubbfel, 21.08.2013. public class NDEFShortRecord : NDEFRecord { + #region Constructor + /// Initializes a new instance of the NDEFShortRecord class. /// Stubbfel, 21.08.2013. public NDEFShortRecord() @@ -37,6 +39,10 @@ namespace CampusAppWP8.Utility.NDEF this.Payload = Encoding.UTF8.GetString(array, index + this.HeaderSize + this.PayloadPraefix.Length, payLoadSize); } + #endregion + + #region Method + /// Converts this NDEFShortRecord to a byte array. /// Stubbfel, 21.08.2013. /// This object as a byte[]. @@ -59,5 +65,7 @@ namespace CampusAppWP8.Utility.NDEF return array; } + + #endregion } } diff --git a/CampusAppWP8/CampusAppWP8/Utility/StringManager.cs b/CampusAppWP8/CampusAppWP8/Utility/StringManager.cs index 800be781..0445e8e6 100644 --- a/CampusAppWP8/CampusAppWP8/Utility/StringManager.cs +++ b/CampusAppWP8/CampusAppWP8/Utility/StringManager.cs @@ -7,9 +7,9 @@ //---------------------------------------------------------------------- namespace CampusAppWP8.Utility { - using CampusAppWP8.Resources; using System; using System.Text.RegularExpressions; + using CampusAppWP8.Resources; /// /// Class provides some special StringMethods @@ -23,6 +23,9 @@ namespace CampusAppWP8.Utility /// private static readonly string HtmlTagPattern = "<.*?>"; + /// The mail valid regular expression. + private static readonly string EMailValidRegex = @"^(?("")(""[^""]+?""@)|(([0-9a-z]((\.(?!\.))|[-!#\$%&'\*\+/=\?\^`\{\}\|~\w])*)(?<=[0-9a-z])@))(?(\[)(\[(\d{1,3}\.){3}\d{1,3}\])|(([0-9a-z][-\w]*[0-9a-z]*\.)+[a-z0-9]{2,17}))$"; + #endregion #region Methods @@ -33,7 +36,7 @@ namespace CampusAppWP8.Utility /// String with Html-Tags /// String without Html-Tags public static string StripHTML(string inputString) - { + { string result = Regex.Replace(inputString, HtmlTagPattern, string.Empty); return System.Net.HttpUtility.HtmlDecode(result); } @@ -48,11 +51,10 @@ namespace CampusAppWP8.Utility return str.ToString() + "\n"; } - /// - /// Method remove(TrimEND!) an Newline to a string - /// - /// input string - /// input string - newlineMethod remove(TrimEND!) an Newline to a string. + /// Stubbfel, 12.09.2013. + /// input string. + /// input string - newline. public static string RemoveNewLine(string str) { return str.TrimEnd('\n'); @@ -67,10 +69,10 @@ namespace CampusAppWP8.Utility // Return true if strIn is in valid e-mail format. try { - return Regex.IsMatch(strIn, - @"^(?("")(""[^""]+?""@)|(([0-9a-z]((\.(?!\.))|[-!#\$%&'\*\+/=\?\^`\{\}\|~\w])*)(?<=[0-9a-z])@))" + - @"(?(\[)(\[(\d{1,3}\.){3}\d{1,3}\])|(([0-9a-z][-\w]*[0-9a-z]*\.)+[a-z0-9]{2,17}))$", - RegexOptions.IgnoreCase); + return Regex.IsMatch( + strIn, + StringManager.EMailValidRegex, + RegexOptions.IgnoreCase); } catch (Exception) { @@ -78,11 +80,11 @@ namespace CampusAppWP8.Utility } } - /// Creates uni telefon number. - /// Stubbfel, 04.09.2013. - /// The input. - /// The new uni telefon number. - public static string CreateUniTelefonNumber(string input) + /// Creates uni telefon number. + /// Stubbfel, 04.09.2013. + /// The input. + /// The new uni telefon number. + public static string CreateUniTelefonNumber(string input) { string result = null; if (input.Length < 5) @@ -95,7 +97,7 @@ namespace CampusAppWP8.Utility } Regex regexObj = new Regex(@"[^\d]"); - result = regexObj.Replace(result.TrimStart('0'), ""); + result = regexObj.Replace(result.TrimStart('0'), string.Empty); result = Constants.DeTelPrefix + result; return result; } diff --git a/CampusAppWP8/CampusAppWP8/Utility/Utilities.cs b/CampusAppWP8/CampusAppWP8/Utility/Utilities.cs index b5543dd9..cbc4c010 100644 --- a/CampusAppWP8/CampusAppWP8/Utility/Utilities.cs +++ b/CampusAppWP8/CampusAppWP8/Utility/Utilities.cs @@ -12,7 +12,6 @@ namespace CampusAppWP8.Utility using System.Device.Location; using System.Globalization; using System.Linq; - using System.Threading; using System.Windows; using System.Windows.Controls; using System.Windows.Media; @@ -24,10 +23,7 @@ namespace CampusAppWP8.Utility /// public static class Utilities { - /// - /// ResetEvent for CampusDetermination - /// - private static ManualResetEvent waitForCampus = new ManualResetEvent(false); + #region Enums /// /// Comparison types. @@ -60,6 +56,10 @@ namespace CampusAppWP8.Utility GreaterEqual } + #endregion + + #region Method + /// /// Compares the difference between a specified DateTime and Now /// and the specified time difference (in Days). @@ -285,9 +285,9 @@ namespace CampusAppWP8.Utility } } - /// Query if the phone is in the uni network. Method compares only Networkname and Description! + /// Query if the phone is in the uni network. Method compares only Network name and Description! /// Stubbfel, 26.08.2013. - /// true if uni networkavailable, false if not. + /// true if uni network is available, false if not. public static bool IsUniNetworkAvailable() { NetworkInterfaceList networkInterfaceList = new NetworkInterfaceList(); @@ -302,12 +302,13 @@ namespace CampusAppWP8.Utility return true; } } + return false; } - /// Queries if a wifik is available. + /// Queries if a wifi is available. /// Stubbfel, 26.08.2013. - /// true if a wifik is available, false if not. + /// true if a wifi is available, false if not. public static bool IsWifiAvailable() { NetworkInterfaceList networkInterfaceList = new NetworkInterfaceList(); @@ -320,6 +321,7 @@ namespace CampusAppWP8.Utility return true; } } + return false; } @@ -327,7 +329,7 @@ namespace CampusAppWP8.Utility /// Stubbfel, 27.08.2013. /// Generic type parameter. /// The load modus< t> - public static MainModel.ForceType getLoadModus() + public static MainModel.ForceType GetLoadModus() { if (Settings.AppSetting.OnlyWifi && !Settings.AppSetting.WifiEnable) { @@ -338,5 +340,7 @@ namespace CampusAppWP8.Utility return MainModel.ForceType.INVALID; } } + + #endregion } } \ No newline at end of file diff --git a/CampusAppWP8/CampusAppWP8/Utility/XmlManager.cs b/CampusAppWP8/CampusAppWP8/Utility/XmlManager.cs index 75d1467e..118e8a11 100644 --- a/CampusAppWP8/CampusAppWP8/Utility/XmlManager.cs +++ b/CampusAppWP8/CampusAppWP8/Utility/XmlManager.cs @@ -16,6 +16,8 @@ namespace CampusAppWP8.Utility /// public class XmlManager { + #region Method + /// /// Method deserialization a string to a Model /// @@ -51,12 +53,11 @@ namespace CampusAppWP8.Utility return model; } - /// - /// Method serializes a model to a string. - /// - /// type of the model - /// model object - /// serialized string + /// Method serializes a model to a string. + /// Stubbfel, 12.09.2013. + /// type of the model. + /// model object. + /// serialized string. public static string SerializationToString(T model) { string retValue = string.Empty; @@ -84,5 +85,7 @@ namespace CampusAppWP8.Utility return retValue; } + + #endregion } } diff --git a/CampusAppWP8/CampusAppWPortalLib8/Model/GeoDb/PlaceInformation.cs b/CampusAppWP8/CampusAppWPortalLib8/Model/GeoDb/PlaceInformation.cs index 4768712b..050c92bf 100644 --- a/CampusAppWP8/CampusAppWPortalLib8/Model/GeoDb/PlaceInformation.cs +++ b/CampusAppWP8/CampusAppWPortalLib8/Model/GeoDb/PlaceInformation.cs @@ -7,20 +7,35 @@ //---------------------------------------------------------------------- namespace CampusAppWPortalLib8.Model.GeoDb { + using System; using System.Xml.Serialization; /// Information about the place. /// Stubbfel, 19.08.2013. - public class PlaceInformation + public class PlaceInformation : IEquatable { /// Gets or sets the name of the information. /// The name of the information. - [XmlElement("placeInformationName")] + [XmlAttribute("placeInformationName")] public string InformationName { get; set; } /// Gets or sets the information value. /// The information value. [XmlText] public string InformationValue { get; set; } + + /// 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)) + { + return true; + } + + return false; + } } } diff --git a/CampusAppWP8/CampusAppWPortalLib8/Model/GeoDb/PlaceModel.cs b/CampusAppWP8/CampusAppWPortalLib8/Model/GeoDb/PlaceModel.cs index 3b048ee8..6b533c75 100644 --- a/CampusAppWP8/CampusAppWPortalLib8/Model/GeoDb/PlaceModel.cs +++ b/CampusAppWP8/CampusAppWPortalLib8/Model/GeoDb/PlaceModel.cs @@ -8,13 +8,16 @@ namespace CampusAppWPortalLib8.Model.GeoDb { + using System; + using System.Collections.Generic; using System.Collections.ObjectModel; + using System.Text.RegularExpressions; using System.Xml.Serialization; /// /// Model for a place of the SPSService /// - public class PlaceModel + public class PlaceModel : IEquatable { /// /// Gets or sets the placeId @@ -34,6 +37,7 @@ namespace CampusAppWPortalLib8.Model.GeoDb [XmlAttribute("refpoint")] public string RefPoint { get; set; } + /// Gets or sets the information. /// The information. [XmlElement("placeInformation")] @@ -43,5 +47,121 @@ namespace CampusAppWPortalLib8.Model.GeoDb /// The services. [XmlElement("placeService")] public ObservableCollection Services { get; set; } + + /// Converts this object to a nfc string. + /// Stubbfel, 21.08.2013. + /// This object as a string. + public string ToNfcString() + { + string nfcStr = "{\"pid\":\"" + this.PlaceId + "\",\"parent\":\"" + this.ParentId + "\"}"; + 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. + public bool Equals(PlaceModel other) + { + if (other.PlaceId.Equals(this.PlaceId)) + { + return true; + } + + return false; + } + + /// Adds a place informations. + /// Stubbfel, 09.09.2013. + /// The place informations. + public void AddPlaceInformations(List placeInformations) + { + foreach (PlaceInformation info in placeInformations) + { + if (this.Informations.Contains(info)) + { + int index = this.Informations.IndexOf(info); + this.Informations[index].InformationValue = info.InformationValue; + } + else + { + this.Informations.Add(info); + } + } + } + + /// Adds a place services. + /// Stubbfel, 09.09.2013. + /// The place services. + public void AddPlaceServices(List placeServices) + { + foreach (PlaceService service in placeServices) + { + if (this.Services.Contains(service)) + { + int index = this.Services.IndexOf(service); + this.Services[index].Request = service.Request; + this.Services[index].SAP = service.SAP; + } + else + { + this.Services.Add(service); + } + } + } + + /// 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) + { + bool tmpResult = false; + foreach (PlaceInformation info in this.Informations) + { + if (name.Equals(info.InformationName)) + { + tmpResult = true; + break; + } + } + + if (!tmpResult) + { + return tmpResult; + } + } + + return true; + } + + /// 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) + { + bool tmpResult = false; + foreach (PlaceService service in this.Services) + { + if (name.Equals(service.ServiceName)) + { + tmpResult = true; + break; + } + } + + if (!tmpResult) + { + return tmpResult; + } + } + + return true; + } } } diff --git a/CampusAppWP8/CampusAppWPortalLib8/Model/GeoDb/PlaceService.cs b/CampusAppWP8/CampusAppWPortalLib8/Model/GeoDb/PlaceService.cs index 8a5f5bf8..220b59bb 100644 --- a/CampusAppWP8/CampusAppWPortalLib8/Model/GeoDb/PlaceService.cs +++ b/CampusAppWP8/CampusAppWPortalLib8/Model/GeoDb/PlaceService.cs @@ -8,11 +8,12 @@ namespace CampusAppWPortalLib8.Model.GeoDb { + using System; using System.Xml.Serialization; /// Place service. /// Stubbfel, 19.08.2013. - public class PlaceService + public class PlaceService : IEquatable { /// Gets or sets the name of the service. /// The name of the service. @@ -28,5 +29,29 @@ namespace CampusAppWPortalLib8.Model.GeoDb /// The request. [XmlElement("request")] public string Request { get; set; } + + /// Gets the URL string. + /// The URL string. + public string URLString + { + get + { + return this.SAP + this.Request; + } + } + + /// 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)) + { + return true; + } + + return false; + } } } diff --git a/CampusAppWP8/CampusAppWPortalLib8/Model/GeoDb/SpsModel.cs b/CampusAppWP8/CampusAppWPortalLib8/Model/GeoDb/SpsModel.cs index 378d7e90..ea41c617 100644 --- a/CampusAppWP8/CampusAppWPortalLib8/Model/GeoDb/SpsModel.cs +++ b/CampusAppWP8/CampusAppWPortalLib8/Model/GeoDb/SpsModel.cs @@ -23,6 +23,7 @@ namespace CampusAppWPortalLib8.Model.GeoDb /// Stubbfel, 20.08.2013. public SpsModel() { + this.HasChanged = false; this.Places = new ObservableCollection(); } @@ -32,6 +33,10 @@ namespace CampusAppWPortalLib8.Model.GeoDb [XmlElement("place")] public ObservableCollection Places { get; set; } + /// Gets a value indicating whether this object has changed. + /// true if this object has changed, false if not. + public bool HasChanged { get; set; } + /// Gets places by information. /// Stubbfel, 19.08.2013. /// The query. @@ -83,5 +88,113 @@ namespace CampusAppWPortalLib8.Model.GeoDb return resultplaces.ToList(); } + + /// Adds the places. + /// Stubbfel, 09.09.2013. + /// A list of places. + public void AddPlaces(List places) + { + foreach (PlaceModel place in places) + { + if (this.Places.Contains(place)) + { + int index = this.Places.IndexOf(place); + this.Places[index].AddPlaceInformations(place.Informations.ToList()); + this.Places[index].AddPlaceServices(place.Services.ToList()); + } + else + { + this.Places.Add(place); + } + } + this.HasChanged = true; + } + + /// Creates PID list. + /// Stubbfel, 09.09.2013. + /// The new PID list. + public List CreatePidList() + { + List pidList = new List(); + foreach (PlaceModel place in this.Places) + { + pidList.Add(place.PlaceId); + } + + return pidList; + } + + /// 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) + { + if (place.PlaceId.Equals(id)) + { + return place; + } + } + + 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. + public bool ContainsInformationNames(List pidList, List names) + { + foreach (string pid in pidList) + { + PlaceModel place = this.GetPlaceById(pid); + if (!place.ContainsInformationNames(names)) + { + return false; + } + } + + 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. + public bool ContainsServiceNames(List pidList, List names) + { + foreach (string pid in pidList) + { + PlaceModel place = this.GetPlaceById(pid); + if (!place.ContainsServiceNames(names)) + { + return false; + } + } + + return true; + } + + /// Filter by PID. + /// Stubbfel, 11.09.2013. + /// List of pids. + /// flitered list of places + public List FilterByPid(List pidList) + { + List fitlerList = new List(); + foreach (PlaceModel place in this.Places) + { + if (pidList.Contains(place.PlaceId)) + { + fitlerList.Add(place); + } + } + + return fitlerList; + } } } diff --git a/Doc/html/annotated.html b/Doc/html/annotated.html index 4472d9e4..3aef254a 100644 --- a/Doc/html/annotated.html +++ b/Doc/html/annotated.html @@ -110,144 +110,188 @@ $(document).ready(function(){initNavTree('annotated.html','');});
Here are the classes, structs, unions and interfaces with brief descriptions:
[detail level 12345]
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
\NCampusAppWP8
 oNFeed
 |oNDepartments
 |oNEvents
 |oNGeoApi
 |oNLecture
 |oNLink
 |oNMensa
 |oNNews
 |oNOpeninghours
 |\NStudentCouncil
 oNModel
 |oNCampusmap
 |oNDepartments
 |oNevents_news
 |oNGeoDb
 |oNLecture
 |oNLink
 |oNMensa
 |oNOpeninghours
 |oNRSS
 |oNSetting
 |oNStudentCouncil
 |oNUtility
 |\CXmlModel< T >Xml model io handler class.
 oNPages
 |oNCampusmap
 |oNDepartments
 |oNEvents
 |oNLecture
 |oNLinks
 |oNMensa
 |oNNews
 |oNOpeninghours
 |oNSetting
 |oNStudentCouncil
 |oNWebmail
 |\CStartPageClass for the StartPage
 oNResources
 |oCAppResourcesEine stark typisierte Ressourcenklasse zum Suchen von lokalisierten Zeichenfolgen usw.
 |oCConstantsEine stark typisierte Ressourcenklasse zum Suchen von lokalisierten Zeichenfolgen usw.
 |\CIconsIcons uri string.
 oNUtility
 |oNLui
 |oCFileFile class.
 |oCHttpRequestClass realize the access of restful HttpRequest
 |oCLoggerThis Class creates logs for the app
 |\CXmlManagerClass provides some Xml-methods
 oCApp
 oCConstAccess to Constants.rex
 oCLocalizedStringsBietet Zugriff auf Zeichenfolgenressourcen.
 oCMainModel< T >Base model io handling class.
 \CThemelizedIconsTheme icons.
 oNApi
 |oNGeoApi
 |oNLecture
 |\NPerson
 oNFeed
 |oNDepartments
 |oNEvents
 |oNExams
 |oNLink
 |oNMensa
 |oNNews
 |oNOpeninghours
 |oNStudentCouncil
 |\NUtility
 oNFile
 |oNDepartments
 |oNExams
 |\NPlaces
 oNModel
 |oNCampusmap
 |oNDepartments
 |oNevents_news
 |oNExams
 |oNGeoDb
 |oNLecture
 |oNLink
 |oNMensa
 |oNOpeninghours
 |oNPerson
 |oNRSS
 |oNSetting
 |oNStudentCouncil
 |oNUtility
 |oCBinaryModelBinary model.
 |\CXmlModel< T >Xml model io handler class.
 oNPages
 |oNCampusmap
 |oNDepartments
 |oNDev
 |oNEvents
 |oNExams
 |oNLecture
 |oNLinks
 |oNMensa
 |oNNews
 |oNOpeninghours
 |oNPerson
 |oNPlaceNews
 |oNSetting
 |oNStudentCouncil
 |oNWebmail
 |\CStartPageClass for the StartPage
 oNResources
 |oCAppResourcesEine stark typisierte Ressourcenklasse zum Suchen von lokalisierten Zeichenfolgen usw.
 |oCConstantsEine stark typisierte Ressourcenklasse zum Suchen von lokalisierten Zeichenfolgen usw.
 |\CIconsIcons uri string.
 oNUtility
 |oNLui
 |oNNDEF
 |oCFileFile class.
 |oCHttpRequestClass realize the access of restful HttpRequest
 |oCLoggerThis Class creates logs for the app
 |\CXmlManagerClass provides some Xml-methods
 oCApp
 oCConstAccess to Constants.rex
 oCLocalizedStringsLocalized strings.
 oCMainModel< T >Base model io handling class.
 \CThemelizedIconsTheme icons.
@@ -255,7 +299,7 @@ $(document).ready(function(){initNavTree('annotated.html','');});