Merge branch 'release/r#135' into develmaster
This commit is contained in:
65
CampusAppWP8/CampusAppDLL/CampusAppDLL.csproj
Normal file
65
CampusAppWP8/CampusAppDLL/CampusAppDLL.csproj
Normal file
@@ -0,0 +1,65 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<Project ToolsVersion="4.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
|
||||
<Import Project="$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props" Condition="Exists('$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props')" />
|
||||
<PropertyGroup>
|
||||
<Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
|
||||
<Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
|
||||
<ProjectGuid>{E4EC5B95-06FC-4304-97E2-9E3F9B980303}</ProjectGuid>
|
||||
<OutputType>Library</OutputType>
|
||||
<AppDesignerFolder>Properties</AppDesignerFolder>
|
||||
<RootNamespace>CampusAppDLL</RootNamespace>
|
||||
<AssemblyName>CampusAppDLL</AssemblyName>
|
||||
<TargetFrameworkVersion>v4.0</TargetFrameworkVersion>
|
||||
<FileAlignment>512</FileAlignment>
|
||||
<TargetFrameworkProfile>Client</TargetFrameworkProfile>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
|
||||
<DebugSymbols>true</DebugSymbols>
|
||||
<DebugType>full</DebugType>
|
||||
<Optimize>false</Optimize>
|
||||
<OutputPath>bin\Debug\</OutputPath>
|
||||
<DefineConstants>DEBUG;TRACE</DefineConstants>
|
||||
<ErrorReport>prompt</ErrorReport>
|
||||
<WarningLevel>4</WarningLevel>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
|
||||
<DebugType>pdbonly</DebugType>
|
||||
<Optimize>true</Optimize>
|
||||
<OutputPath>bin\Release\</OutputPath>
|
||||
<DefineConstants>TRACE</DefineConstants>
|
||||
<ErrorReport>prompt</ErrorReport>
|
||||
<WarningLevel>4</WarningLevel>
|
||||
</PropertyGroup>
|
||||
<ItemGroup>
|
||||
<Reference Include="System" />
|
||||
<Reference Include="System.Core" />
|
||||
<Reference Include="System.Xml.Linq" />
|
||||
<Reference Include="System.Data.DataSetExtensions" />
|
||||
<Reference Include="Microsoft.CSharp" />
|
||||
<Reference Include="System.Data" />
|
||||
<Reference Include="System.Xml" />
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<Compile Include="Model\Campusmap\CBMainMapModel.cs" />
|
||||
<Compile Include="Model\Campusmap\MapModel.cs" />
|
||||
<Compile Include="Model\GeoDb\PlaceInformation.cs" />
|
||||
<Compile Include="Model\GeoDb\PlaceModel.cs" />
|
||||
<Compile Include="Model\GeoDb\PlaceService.cs" />
|
||||
<Compile Include="Model\GeoDb\SpsModel.cs" />
|
||||
<Compile Include="Properties\AssemblyInfo.cs" />
|
||||
<Compile Include="Utility\Logger.cs" />
|
||||
<Compile Include="Utility\NDEF\NDEFMessage.cs" />
|
||||
<Compile Include="Utility\NDEF\NDEFRecord.cs" />
|
||||
<Compile Include="Utility\NDEF\NDEFShortRecord.cs" />
|
||||
<Compile Include="Utility\StringManager.cs" />
|
||||
<Compile Include="Utility\XmlManager.cs" />
|
||||
</ItemGroup>
|
||||
<Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
|
||||
<!-- To modify your build process, add your task inside one of the targets below and uncomment it.
|
||||
Other similar extension points exist, see Microsoft.Common.targets.
|
||||
<Target Name="BeforeBuild">
|
||||
</Target>
|
||||
<Target Name="AfterBuild">
|
||||
</Target>
|
||||
-->
|
||||
</Project>
|
||||
45
CampusAppWP8/CampusAppDLL/Model/Campusmap/CBMainMapModel.cs
Normal file
45
CampusAppWP8/CampusAppDLL/Model/Campusmap/CBMainMapModel.cs
Normal file
@@ -0,0 +1,45 @@
|
||||
//-----------------------------------------------------------------------------
|
||||
// <copyright file="CBMainMapModel.cs" company="BTU/IIT">
|
||||
// Company copyright tag.
|
||||
// </copyright>
|
||||
// <author>fiedlchr</author>
|
||||
// <sience>13.08.2013</sience>
|
||||
//-----------------------------------------------------------------------------
|
||||
using CampusAppDLL.Model.GeoDb;
|
||||
using CampusAppDLL.Utility;
|
||||
|
||||
namespace CampusAppDLL.Model.Campusmap
|
||||
{
|
||||
|
||||
/// <summary>
|
||||
/// Class for the MapModel of the mainCampus of cottbus
|
||||
/// </summary>
|
||||
public class CBMainMapModel : MapModel
|
||||
{
|
||||
/// <summary>Variable for the identify of the campus.</summary>
|
||||
private static readonly string Campus = "1";
|
||||
|
||||
/// <summary>
|
||||
/// Initializes a new instance of the <see cref="CBMainMapModel" /> class.
|
||||
/// </summary>
|
||||
public CBMainMapModel(string xmlFilePath) : base(xmlFilePath)
|
||||
{
|
||||
}
|
||||
|
||||
/// <summary>Loads the spatial./.</summary>
|
||||
/// <remarks>Stubbfel, 19.08.2013.</remarks>
|
||||
protected override void LoadSpatials(string xmlFilePath)
|
||||
{
|
||||
SpsModel model = XmlManager.DeserializationFileToModel<SpsModel>(xmlFilePath);
|
||||
|
||||
this.Spatial = new SpsModel();
|
||||
foreach (PlaceModel place in model.Places)
|
||||
{
|
||||
if (Campus.Equals(place.ParentId) || Campus.Equals(place.PlaceId))
|
||||
{
|
||||
this.Spatial.Places.Add(place);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
48
CampusAppWP8/CampusAppDLL/Model/Campusmap/MapModel.cs
Normal file
48
CampusAppWP8/CampusAppDLL/Model/Campusmap/MapModel.cs
Normal file
@@ -0,0 +1,48 @@
|
||||
//-----------------------------------------------------------------------
|
||||
// <copyright file="MapModel.cs" company="BTU/IIT">
|
||||
// Company copyright tag.
|
||||
// </copyright>
|
||||
// <author>stubbfel</author>
|
||||
// <sience>24.06.2013</sience>
|
||||
//----------------------------------------------------------------------
|
||||
namespace CampusAppDLL.Model.Campusmap
|
||||
{
|
||||
using CampusAppDLL.Model.GeoDb;
|
||||
using System;
|
||||
|
||||
/// <summary>
|
||||
/// This Class manage the properties of a Map
|
||||
/// </summary>
|
||||
public class MapModel
|
||||
{
|
||||
#region Constructors
|
||||
|
||||
/// <summary>
|
||||
/// Initializes a new instance of the <see cref="MapModel" /> class.
|
||||
/// </summary>
|
||||
public MapModel(string xmlFilePath)
|
||||
{
|
||||
this.LoadSpatials(xmlFilePath);
|
||||
}
|
||||
|
||||
#endregion
|
||||
|
||||
#region Property
|
||||
|
||||
/// <summary>Gets or sets the spatial of the map.</summary>
|
||||
/// <value>The spatial.</value>
|
||||
public SpsModel Spatial { get; set; }
|
||||
|
||||
#endregion
|
||||
|
||||
#region Methods
|
||||
|
||||
/// <summary>Loads the spatial./</summary>
|
||||
/// <remarks>Stubbfel, 19.08.2013.</remarks>
|
||||
protected virtual void LoadSpatials(string xmlFilePath)
|
||||
{
|
||||
}
|
||||
|
||||
#endregion
|
||||
}
|
||||
}
|
||||
26
CampusAppWP8/CampusAppDLL/Model/GeoDb/PlaceInformation.cs
Normal file
26
CampusAppWP8/CampusAppDLL/Model/GeoDb/PlaceInformation.cs
Normal file
@@ -0,0 +1,26 @@
|
||||
//-----------------------------------------------------------------------
|
||||
// <copyright file="PlaceInformation.cs" company="BTU/IIT">
|
||||
// Company copyright tag.
|
||||
// </copyright>
|
||||
// <author>stubbfel</author>
|
||||
// <sience>19.08.2013</sience>
|
||||
//----------------------------------------------------------------------
|
||||
namespace CampusAppDLL.Model.GeoDb
|
||||
{
|
||||
using System.Xml.Serialization;
|
||||
|
||||
/// <summary>Information about the place.</summary>
|
||||
/// <remarks>Stubbfel, 19.08.2013.</remarks>
|
||||
public class PlaceInformation
|
||||
{
|
||||
/// <summary>Gets or sets the name of the information.</summary>
|
||||
/// <value>The name of the information.</value>
|
||||
[XmlElement("placeInformationName")]
|
||||
public string InformationName { get; set; }
|
||||
|
||||
/// <summary>Gets or sets the information value.</summary>
|
||||
/// <value>The information value.</value>
|
||||
[XmlText]
|
||||
public string InformationValue { get; set; }
|
||||
}
|
||||
}
|
||||
47
CampusAppWP8/CampusAppDLL/Model/GeoDb/PlaceModel.cs
Normal file
47
CampusAppWP8/CampusAppDLL/Model/GeoDb/PlaceModel.cs
Normal file
@@ -0,0 +1,47 @@
|
||||
//-----------------------------------------------------------------------
|
||||
// <copyright file="PlaceModel.cs" company="BTU/IIT">
|
||||
// Company copyright tag.
|
||||
// </copyright>
|
||||
// <author>stubbfel</author>
|
||||
// <sience>08.08.2013</sience>
|
||||
//----------------------------------------------------------------------
|
||||
|
||||
namespace CampusAppDLL.Model.GeoDb
|
||||
{
|
||||
using System.Collections.ObjectModel;
|
||||
using System.Xml.Serialization;
|
||||
|
||||
/// <summary>
|
||||
/// Model for a place of the SPSService
|
||||
/// </summary>
|
||||
public class PlaceModel
|
||||
{
|
||||
/// <summary>
|
||||
/// Gets or sets the placeId
|
||||
/// </summary>
|
||||
[XmlAttribute("id")]
|
||||
public string PlaceId { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// Gets or sets the id of the "parent" of a place
|
||||
/// </summary>
|
||||
[XmlAttribute("parentId")]
|
||||
public string ParentId { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// Gets or sets the ReferencePoint of a place
|
||||
/// </summary>
|
||||
[XmlAttribute("refpoint")]
|
||||
public string RefPoint { get; set; }
|
||||
|
||||
/// <summary>Gets or sets the information.</summary>
|
||||
/// <value>The information.</value>
|
||||
[XmlElement("placeInformation")]
|
||||
public ObservableCollection<PlaceInformation> Informations { get; set; }
|
||||
|
||||
/// <summary>Gets or sets the services.</summary>
|
||||
/// <value>The services.</value>
|
||||
[XmlElement("placeService")]
|
||||
public ObservableCollection<PlaceService> Services { get; set; }
|
||||
}
|
||||
}
|
||||
32
CampusAppWP8/CampusAppDLL/Model/GeoDb/PlaceService.cs
Normal file
32
CampusAppWP8/CampusAppDLL/Model/GeoDb/PlaceService.cs
Normal file
@@ -0,0 +1,32 @@
|
||||
//-----------------------------------------------------------------------------
|
||||
// <copyright file="PlaceService.cs" company="BTU/IIT">
|
||||
// Company copyright tag.
|
||||
// </copyright>
|
||||
// <author>stubbfel</author>
|
||||
// <sience>19.08.2013</sience>
|
||||
//-----------------------------------------------------------------------------
|
||||
|
||||
namespace CampusAppDLL.Model.GeoDb
|
||||
{
|
||||
using System.Xml.Serialization;
|
||||
|
||||
/// <summary>Place service.</summary>
|
||||
/// <remarks>Stubbfel, 19.08.2013.</remarks>
|
||||
public class PlaceService
|
||||
{
|
||||
/// <summary>Gets or sets the name of the service.</summary>
|
||||
/// <value>The name of the service.</value>
|
||||
[XmlAttribute("placeServiceName")]
|
||||
public string ServiceName { get; set; }
|
||||
|
||||
/// <summary>Gets or sets the SAP of an service.</summary>
|
||||
/// <value>The sap.</value>
|
||||
[XmlElement("sap")]
|
||||
public string SAP { get; set; }
|
||||
|
||||
/// <summary>Gets or sets the request for a place.</summary>
|
||||
/// <value>The request.</value>
|
||||
[XmlElement("request")]
|
||||
public string Request { get; set; }
|
||||
}
|
||||
}
|
||||
87
CampusAppWP8/CampusAppDLL/Model/GeoDb/SpsModel.cs
Normal file
87
CampusAppWP8/CampusAppDLL/Model/GeoDb/SpsModel.cs
Normal file
@@ -0,0 +1,87 @@
|
||||
//-----------------------------------------------------------------------
|
||||
// <copyright file="SpsModel.cs" company="BTU/IIT">
|
||||
// Company copyright tag.
|
||||
// </copyright>
|
||||
// <author>stubbfel</author>
|
||||
// <sience>08.08.2013</sience>
|
||||
//----------------------------------------------------------------------
|
||||
|
||||
namespace CampusAppDLL.Model.GeoDb
|
||||
{
|
||||
using System.Collections.Generic;
|
||||
using System.Collections.ObjectModel;
|
||||
using System.Linq;
|
||||
using System.Xml.Serialization;
|
||||
|
||||
/// <summary>
|
||||
/// Model for a xml-response of the SPSService
|
||||
/// </summary>
|
||||
[XmlRoot("root")]
|
||||
public class SpsModel
|
||||
{
|
||||
/// <summary>Initializes a new instance of the SpsModel class.</summary>
|
||||
/// <remarks>Stubbfel, 20.08.2013.</remarks>
|
||||
public SpsModel()
|
||||
{
|
||||
this.Places = new ObservableCollection<PlaceModel>();
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Gets or sets a list of places
|
||||
/// </summary>
|
||||
[XmlElement("place")]
|
||||
public ObservableCollection<PlaceModel> Places { get; set; }
|
||||
|
||||
/// <summary>Gets places by information.</summary>
|
||||
/// <remarks>Stubbfel, 19.08.2013.</remarks>
|
||||
/// <param name="query"> The query.</param>
|
||||
/// <param name="ignoreCases"> (Optional) the ignore cases.</param>
|
||||
/// <param name="informationName">(Optional) name of the information.</param>
|
||||
/// <returns>The places by information.</returns>
|
||||
public List<PlaceModel> GetPlacesByInformation(string query, bool ignoreCases = true, string informationName = null)
|
||||
{
|
||||
string querryLow = string.Empty;
|
||||
IEnumerable<PlaceModel> resultplaces = null;
|
||||
|
||||
// select correct statement
|
||||
if (ignoreCases && informationName == null)
|
||||
{
|
||||
querryLow = query.ToLower();
|
||||
resultplaces = from place in this.Places
|
||||
from info in place.Informations
|
||||
where info.InformationValue.ToLower().Contains(querryLow)
|
||||
select place;
|
||||
}
|
||||
else if (ignoreCases && informationName != null)
|
||||
{
|
||||
querryLow = query.ToLower();
|
||||
resultplaces = from place in this.Places
|
||||
from info in place.Informations
|
||||
where info.InformationValue.ToLower().Contains(querryLow) && info.InformationName.Equals(informationName)
|
||||
select place;
|
||||
}
|
||||
else if (!ignoreCases && informationName == null)
|
||||
{
|
||||
resultplaces = from place in this.Places
|
||||
from info in place.Informations
|
||||
where info.InformationValue.Contains(querryLow)
|
||||
select place;
|
||||
}
|
||||
else if (!ignoreCases && informationName != null)
|
||||
{
|
||||
resultplaces = from place in this.Places
|
||||
from info in place.Informations
|
||||
where info.InformationValue.Contains(querryLow) && info.InformationName.Equals(informationName)
|
||||
select place;
|
||||
}
|
||||
|
||||
// null assert
|
||||
if (resultplaces == null)
|
||||
{
|
||||
return null;
|
||||
}
|
||||
|
||||
return resultplaces.ToList<PlaceModel>();
|
||||
}
|
||||
}
|
||||
}
|
||||
36
CampusAppWP8/CampusAppDLL/Properties/AssemblyInfo.cs
Normal file
36
CampusAppWP8/CampusAppDLL/Properties/AssemblyInfo.cs
Normal file
@@ -0,0 +1,36 @@
|
||||
using System.Reflection;
|
||||
using System.Runtime.CompilerServices;
|
||||
using System.Runtime.InteropServices;
|
||||
|
||||
// Allgemeine Informationen über eine Assembly werden über die folgenden
|
||||
// Attribute gesteuert. Ändern Sie diese Attributwerte, um die Informationen zu ändern,
|
||||
// die mit einer Assembly verknüpft sind.
|
||||
[assembly: AssemblyTitle("CampusAppDLL")]
|
||||
[assembly: AssemblyDescription("")]
|
||||
[assembly: AssemblyConfiguration("")]
|
||||
[assembly: AssemblyCompany("")]
|
||||
[assembly: AssemblyProduct("CampusAppDLL")]
|
||||
[assembly: AssemblyCopyright("Copyright © 2013")]
|
||||
[assembly: AssemblyTrademark("")]
|
||||
[assembly: AssemblyCulture("")]
|
||||
|
||||
// Durch Festlegen von ComVisible auf "false" werden die Typen in dieser Assembly unsichtbar
|
||||
// für COM-Komponenten. Wenn Sie auf einen Typ in dieser Assembly von
|
||||
// COM zugreifen müssen, legen Sie das ComVisible-Attribut für diesen Typ auf "true" fest.
|
||||
[assembly: ComVisible(false)]
|
||||
|
||||
// Die folgende GUID bestimmt die ID der Typbibliothek, wenn dieses Projekt für COM verfügbar gemacht wird
|
||||
[assembly: Guid("883d352f-0864-47db-8a04-f5eee0800a6d")]
|
||||
|
||||
// Versionsinformationen für eine Assembly bestehen aus den folgenden vier Werten:
|
||||
//
|
||||
// Hauptversion
|
||||
// Nebenversion
|
||||
// Buildnummer
|
||||
// Revision
|
||||
//
|
||||
// Sie können alle Werte angeben oder die standardmäßigen Build- und Revisionsnummern
|
||||
// übernehmen, indem Sie "*" eingeben:
|
||||
// [assembly: AssemblyVersion("1.0.*")]
|
||||
[assembly: AssemblyVersion("1.0.0.0")]
|
||||
[assembly: AssemblyFileVersion("1.0.0.0")]
|
||||
35
CampusAppWP8/CampusAppDLL/Utility/Logger.cs
Normal file
35
CampusAppWP8/CampusAppDLL/Utility/Logger.cs
Normal file
@@ -0,0 +1,35 @@
|
||||
//--------------------------------------------------------------------
|
||||
// <copyright file="Logger.cs" company="BTU/IIT">
|
||||
// Company copyright tag.
|
||||
// </copyright>
|
||||
// <author>stubbfel</author>
|
||||
// <sience>03.05.2013</sience>
|
||||
//----------------------------------------------------------------------
|
||||
namespace CampusAppDLL.Utility
|
||||
{
|
||||
using System;
|
||||
|
||||
/// <summary>
|
||||
/// This Class creates logs for the app
|
||||
/// </summary>
|
||||
public class Logger
|
||||
{
|
||||
/// <summary>
|
||||
/// Method log a Exception
|
||||
/// </summary>
|
||||
/// <param name="exception">exception which has to log</param>
|
||||
public static void LogException(Exception exception)
|
||||
{
|
||||
// Console.WriteLine(exception);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Log a message.
|
||||
/// </summary>
|
||||
/// <param name="msg">to be logged message</param>
|
||||
public static void LogMsg(string msg)
|
||||
{
|
||||
// Console.WriteLine(msg);
|
||||
}
|
||||
}
|
||||
}
|
||||
154
CampusAppWP8/CampusAppDLL/Utility/NDEF/NDEFMessage.cs
Normal file
154
CampusAppWP8/CampusAppDLL/Utility/NDEF/NDEFMessage.cs
Normal file
@@ -0,0 +1,154 @@
|
||||
//-----------------------------------------------------------------------
|
||||
// <copyright file="NDEFMessage.cs" company="BTU/IIT">
|
||||
// Company copyright tag.
|
||||
// </copyright>
|
||||
// <author>stubbfel</author>
|
||||
// <sience>21.08.2013</sience>
|
||||
//----------------------------------------------------------------------
|
||||
namespace CampusAppDLL.Utility.NDEF
|
||||
{
|
||||
using System.Collections.Generic;
|
||||
using System.IO;
|
||||
|
||||
/// <summary>Ndef message.</summary>
|
||||
/// <remarks>Stubbfel, 21.08.2013.</remarks>
|
||||
public class NDEFMessage
|
||||
{
|
||||
#region Members
|
||||
|
||||
/// <summary>The records.</summary>
|
||||
private List<NDEFRecord> records;
|
||||
|
||||
#endregion
|
||||
|
||||
#region constructors
|
||||
|
||||
/// <summary>Initializes a new instance of the NDEFMessage class.</summary>
|
||||
/// <remarks>Stubbfel, 21.08.2013.</remarks>
|
||||
/// <param name="content">The content.</param>
|
||||
/// <param name="type"> The type.</param>
|
||||
/// <param name="tnf"> (Optional) the tnf.</param>
|
||||
public NDEFMessage(string content, TYPEVAL type, NDEFRecord.TNFVAL tnf = NDEFRecord.TNFVAL.WKT)
|
||||
{
|
||||
this.records = new List<NDEFRecord>();
|
||||
float recordsCount = (float)content.Length / NDEFRecord.MaxRecordPayLoad;
|
||||
NDEFRecord tmpRecord = null;
|
||||
string praefix = NDEFMessage.GetPraefix(type);
|
||||
|
||||
for (int i = 0; recordsCount > 0; i++)
|
||||
{
|
||||
tmpRecord = new NDEFShortRecord();
|
||||
tmpRecord.Type = type;
|
||||
tmpRecord.TNF = tnf;
|
||||
tmpRecord.PayloadPraefix = praefix;
|
||||
int recordsize = 255;
|
||||
if (content.Length < (i + 1) * recordsize)
|
||||
{
|
||||
recordsize = content.Length - (i * recordsize);
|
||||
}
|
||||
|
||||
tmpRecord.Payload = content.Substring(i * 255, recordsize);
|
||||
if (i == 0)
|
||||
{
|
||||
tmpRecord.MB = NDEFRecord.NDEFFlags.MBSET;
|
||||
}
|
||||
|
||||
this.records.Add(tmpRecord);
|
||||
recordsCount--;
|
||||
}
|
||||
|
||||
this.records[this.records.IndexOf(tmpRecord)].ME = NDEFRecord.NDEFFlags.MESET;
|
||||
}
|
||||
|
||||
/// <summary>Initializes a new instance of the NDEFMessage class.</summary>
|
||||
/// <remarks>Stubbfel, 21.08.2013.</remarks>
|
||||
/// <param name="array">The array.</param>
|
||||
public NDEFMessage(byte[] array)
|
||||
{
|
||||
this.records = new List<NDEFRecord>();
|
||||
|
||||
NDEFRecord tmpRecord = null;
|
||||
for (int i = 0; i < array.Length; i += tmpRecord.RecordSize)
|
||||
{
|
||||
tmpRecord = new NDEFShortRecord(array, i);
|
||||
|
||||
this.records.Add(tmpRecord);
|
||||
}
|
||||
}
|
||||
|
||||
#endregion
|
||||
|
||||
#region enum
|
||||
|
||||
/// <summary>Values that represent TYPEVAL.</summary>
|
||||
/// <remarks>Stubbfel, 21.08.2013.</remarks>
|
||||
public enum TYPEVAL
|
||||
{
|
||||
/// <summary>An enum constant representing the empty option.</summary>
|
||||
EMPTY = 0x00,
|
||||
|
||||
/// <summary>An enum constant representing the URL option.</summary>
|
||||
URL = 0x55,
|
||||
|
||||
/// <summary>An enum constant representing the text option.</summary>
|
||||
TEXT = 0x54,
|
||||
}
|
||||
|
||||
#endregion
|
||||
|
||||
#region Methods
|
||||
/// <summary>Gets a praefix.</summary>
|
||||
/// <remarks>Stubbfel, 21.08.2013.</remarks>
|
||||
/// <param name="type">The type.</param>
|
||||
/// <returns>The praefix.</returns>
|
||||
public static string GetPraefix(TYPEVAL type)
|
||||
{
|
||||
string praefix = string.Empty;
|
||||
|
||||
switch (type)
|
||||
{
|
||||
case TYPEVAL.TEXT:
|
||||
praefix = "\x02" + "de";
|
||||
break;
|
||||
case TYPEVAL.URL:
|
||||
praefix = "\x01";
|
||||
break;
|
||||
default:
|
||||
break;
|
||||
}
|
||||
|
||||
return praefix;
|
||||
}
|
||||
|
||||
/// <summary>Gets the content.</summary>
|
||||
/// <remarks>Stubbfel, 21.08.2013.</remarks>
|
||||
/// <returns>The content.</returns>
|
||||
public string GetContent()
|
||||
{
|
||||
string result = string.Empty;
|
||||
|
||||
foreach (NDEFRecord record in this.records)
|
||||
{
|
||||
result += record.Payload;
|
||||
}
|
||||
|
||||
return result;
|
||||
}
|
||||
|
||||
/// <summary>Converts this object to a byte array.</summary>
|
||||
/// <remarks>Stubbfel, 21.08.2013.</remarks>
|
||||
/// <returns>This object as a byte[].</returns>
|
||||
public byte[] ToByteArray()
|
||||
{
|
||||
MemoryStream ms = new MemoryStream();
|
||||
foreach (NDEFRecord record in this.records)
|
||||
{
|
||||
ms.Write(record.ToByteArray(), 0, record.RecordSize);
|
||||
}
|
||||
|
||||
return ms.ToArray();
|
||||
}
|
||||
|
||||
#endregion
|
||||
}
|
||||
}
|
||||
188
CampusAppWP8/CampusAppDLL/Utility/NDEF/NDEFRecord.cs
Normal file
188
CampusAppWP8/CampusAppDLL/Utility/NDEF/NDEFRecord.cs
Normal file
@@ -0,0 +1,188 @@
|
||||
//-----------------------------------------------------------------------
|
||||
// <copyright file="NDEFRecord.cs" company="BTU/IIT">
|
||||
// Company copyright tag.
|
||||
// </copyright>
|
||||
// <author>stubbfel</author>
|
||||
// <sience>21.08.2013</sience>
|
||||
//----------------------------------------------------------------------
|
||||
namespace CampusAppDLL.Utility.NDEF
|
||||
{
|
||||
using System.IO;
|
||||
using System.Text;
|
||||
|
||||
/// <summary>Ndef record of a NDEFMessage.</summary>
|
||||
/// <remarks>Stubbfel, 21.08.2013.</remarks>
|
||||
public abstract class NDEFRecord
|
||||
{
|
||||
#region Members
|
||||
|
||||
/// <summary>The maximum record pay load.</summary>
|
||||
public const int MaxRecordPayLoad = 255;
|
||||
|
||||
/// <summary>Size of the type.</summary>
|
||||
protected const byte TypeSize = 0x01;
|
||||
|
||||
#endregion
|
||||
|
||||
#region Constructors
|
||||
/// <summary>Initializes a new instance of the NDEFRecord class.</summary>
|
||||
/// <remarks>Stubbfel, 21.08.2013.</remarks>
|
||||
public NDEFRecord()
|
||||
{
|
||||
}
|
||||
|
||||
/// <summary>Initializes a new instance of the NDEFRecord class.</summary>
|
||||
/// <remarks>Stubbfel, 21.08.2013.</remarks>
|
||||
/// <param name="array">The array.</param>
|
||||
/// <param name="index">(Optional) zero-based index of the.</param>
|
||||
public NDEFRecord(byte[] array, int index = 0)
|
||||
{
|
||||
this.FormatFlags = array[index];
|
||||
}
|
||||
|
||||
#endregion
|
||||
|
||||
#region enum
|
||||
|
||||
/// <summary>Values that represent NDEFFlags.</summary>
|
||||
/// <remarks>Stubbfel, 21.08.2013.</remarks>
|
||||
public enum NDEFFlags
|
||||
{
|
||||
/// <summary>An Enum constant representing the UNSET option.</summary>
|
||||
UNSET = 0x00,
|
||||
|
||||
/// <summary>An Enum constant representing the Message begin option.</summary>
|
||||
MBSET = 0x80,
|
||||
|
||||
/// <summary>An Enum constant representing the Message end option.</summary>
|
||||
MESET = 0x40,
|
||||
|
||||
/// <summary>An Enum constant representing the CHUNK FLAG option.</summary>
|
||||
CFSET = 0x20,
|
||||
|
||||
/// <summary>An Enum constant representing the Short Record set option.</summary>
|
||||
SRSET = 0x10,
|
||||
|
||||
/// <summary>An Enum constant representing the ID length option.</summary>
|
||||
ILSET = 0x08,
|
||||
|
||||
/// <summary>An enum constant representing the tnfset option.</summary>
|
||||
TNFSET = 0x03
|
||||
}
|
||||
|
||||
/// <summary>Values that represent TNFVAL.</summary>
|
||||
/// <remarks>Stubbfel, 21.08.2013.</remarks>
|
||||
public enum TNFVAL
|
||||
{
|
||||
/// <summary>An enum constant representing the empty option.</summary>
|
||||
EMPTY = 0x00,
|
||||
|
||||
/// <summary>An enum constant representing the Well-Know-Type option.</summary>
|
||||
WKT = 0x01,
|
||||
|
||||
/// <summary>An enum constant representing the MediaType option.</summary>
|
||||
MEDIATYPE = 0x02,
|
||||
|
||||
/// <summary>An enum constant representing the URI option.</summary>
|
||||
URI = 0x03,
|
||||
|
||||
/// <summary>An enum constant representing the NFCE option.</summary>
|
||||
NFCE = 0x04,
|
||||
|
||||
/// <summary>An enum constant representing the unknow option.</summary>
|
||||
unknow = 0x05,
|
||||
|
||||
/// <summary>An enum constant representing the unchanged option.</summary>
|
||||
UNCHANGED = 0x06,
|
||||
|
||||
/// <summary>An enum constant representing the reserved option.</summary>
|
||||
RESERVED = 0x07
|
||||
}
|
||||
|
||||
#endregion
|
||||
|
||||
#region Properties
|
||||
/// <summary>Gets or sets the MBFlag.</summary>
|
||||
/// <value>The MBFlag.</value>
|
||||
public NDEFFlags MB { get; set; }
|
||||
|
||||
/// <summary>Gets or sets MEFlag.</summary>
|
||||
/// <value>The MEFlag .</value>
|
||||
public NDEFFlags ME { get; set; }
|
||||
|
||||
/// <summary>Gets or sets the CFFlag.</summary>
|
||||
/// <value>The CFFlag.</value>
|
||||
public NDEFFlags CF { get; set; }
|
||||
|
||||
/// <summary>Gets or sets the SRFlag.</summary>
|
||||
/// <value>The SRFlag.</value>
|
||||
public NDEFFlags SR { get; set; }
|
||||
|
||||
/// <summary>Gets or sets the ILFlag.</summary>
|
||||
/// <value>The ILFlag.</value>
|
||||
public NDEFFlags IL { get; set; }
|
||||
|
||||
/// <summary>Gets or sets the TNFField.</summary>
|
||||
/// <value>The TNFField.</value>
|
||||
public TNFVAL TNF { get; set; }
|
||||
|
||||
/// <summary>Gets or sets the type.</summary>
|
||||
/// <value>The type.</value>
|
||||
public NDEFMessage.TYPEVAL Type { get; set; }
|
||||
|
||||
/// <summary>Gets or sets the format flags.</summary>
|
||||
/// <value>The format flags.</value>
|
||||
public byte FormatFlags
|
||||
{
|
||||
get
|
||||
{
|
||||
return (byte)((byte)this.TNF | ((byte)this.MB) | ((byte)this.ME) | ((byte)this.CF) | ((byte)this.SR) | ((byte)this.IL));
|
||||
}
|
||||
|
||||
protected set
|
||||
{
|
||||
this.TNF = (TNFVAL)(value & (byte)NDEFFlags.TNFSET);
|
||||
this.MB = (NDEFFlags)(value & (byte)NDEFFlags.MBSET);
|
||||
this.ME = (NDEFFlags)(value & (byte)NDEFFlags.MESET);
|
||||
this.CF = (NDEFFlags)(value & (byte)NDEFFlags.CFSET);
|
||||
this.SR = (NDEFFlags)(value & (byte)NDEFFlags.SRSET);
|
||||
this.IL = (NDEFFlags)(value & (byte)NDEFFlags.ILSET);
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>Gets or sets the payload.</summary>
|
||||
/// <value>The payload.</value>
|
||||
public string Payload { get; set; }
|
||||
|
||||
/// <summary>Gets the size of the record.</summary>
|
||||
/// <value>The size of the record.</value>
|
||||
public int RecordSize
|
||||
{
|
||||
get
|
||||
{
|
||||
return this.HeaderSize + this.Payload.Length + this.PayloadPraefix.Length;
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>Gets or sets the payload praefix.</summary>
|
||||
/// <value>The payload praefix.</value>
|
||||
public string PayloadPraefix { get; set; }
|
||||
|
||||
/// <summary>Gets or sets the size of the header.</summary>
|
||||
/// <value>The size of the header.</value>
|
||||
protected int HeaderSize { get; set; }
|
||||
|
||||
#endregion
|
||||
|
||||
#region Methods
|
||||
|
||||
/// <summary>Converts the record to a byte array.</summary>
|
||||
/// <remarks>Stubbfel, 21.08.2013.</remarks>
|
||||
/// <returns>This object as a byte[].</returns>
|
||||
public abstract byte[] ToByteArray();
|
||||
|
||||
#endregion
|
||||
}
|
||||
}
|
||||
|
||||
// End of Utility\NDEF\NDEFRecord.cs
|
||||
63
CampusAppWP8/CampusAppDLL/Utility/NDEF/NDEFShortRecord.cs
Normal file
63
CampusAppWP8/CampusAppDLL/Utility/NDEF/NDEFShortRecord.cs
Normal file
@@ -0,0 +1,63 @@
|
||||
//-----------------------------------------------------------------------
|
||||
// <copyright file="NDEFShortRecord.cs" company="BTU/IIT">
|
||||
// Company copyright tag.
|
||||
// </copyright>
|
||||
// <author>stubbfel</author>
|
||||
// <sience>21.08.2013</sience>
|
||||
//----------------------------------------------------------------------
|
||||
namespace CampusAppDLL.Utility.NDEF
|
||||
{
|
||||
using System.Text;
|
||||
|
||||
/// <summary>Ndef short record.</summary>
|
||||
/// <remarks>Stubbfel, 21.08.2013.</remarks>
|
||||
public class NDEFShortRecord : NDEFRecord
|
||||
{
|
||||
/// <summary>Initializes a new instance of the NDEFShortRecord class.</summary>
|
||||
/// <remarks>Stubbfel, 21.08.2013.</remarks>
|
||||
public NDEFShortRecord()
|
||||
{
|
||||
this.HeaderSize = 4;
|
||||
this.SR = NDEFFlags.SRSET;
|
||||
this.IL = NDEFFlags.UNSET;
|
||||
this.CF = NDEFFlags.UNSET;
|
||||
}
|
||||
|
||||
/// <summary>Initializes a new instance of the NDEFShortRecord class.</summary>
|
||||
/// <remarks>Stubbfel, 21.08.2013.</remarks>
|
||||
/// <param name="array">The array.</param>
|
||||
/// <param name="index">(Optional) zero-based index of the.</param>
|
||||
public NDEFShortRecord(byte[] array, int index = 0)
|
||||
: base(array)
|
||||
{
|
||||
this.HeaderSize = 4;
|
||||
this.Type = (NDEFMessage.TYPEVAL)array[index + 3];
|
||||
this.PayloadPraefix = NDEFMessage.GetPraefix(this.Type);
|
||||
int payLoadSize = array[index + 2] - this.PayloadPraefix.Length;
|
||||
this.Payload = Encoding.UTF8.GetString(array, index + this.HeaderSize + this.PayloadPraefix.Length, payLoadSize);
|
||||
}
|
||||
|
||||
/// <summary>Converts this NDEFShortRecord to a byte array.</summary>
|
||||
/// <remarks>Stubbfel, 21.08.2013.</remarks>
|
||||
/// <returns>This object as a byte[].</returns>
|
||||
public override byte[] ToByteArray()
|
||||
{
|
||||
byte[] payloadAr = Encoding.UTF8.GetBytes(this.PayloadPraefix + this.Payload);
|
||||
byte[] array = new byte[payloadAr.Length + this.HeaderSize];
|
||||
|
||||
array[0] = this.FormatFlags;
|
||||
array[1] = NDEFRecord.TypeSize;
|
||||
array[2] = (byte)(Payload.Length + this.PayloadPraefix.Length);
|
||||
array[3] = (byte)this.Type;
|
||||
|
||||
int i = this.HeaderSize;
|
||||
foreach (byte b in payloadAr)
|
||||
{
|
||||
array[i] = b;
|
||||
i++;
|
||||
}
|
||||
|
||||
return array;
|
||||
}
|
||||
}
|
||||
}
|
||||
59
CampusAppWP8/CampusAppDLL/Utility/StringManager.cs
Normal file
59
CampusAppWP8/CampusAppDLL/Utility/StringManager.cs
Normal file
@@ -0,0 +1,59 @@
|
||||
//-----------------------------------------------------------------------
|
||||
// <copyright file="StringManager.cs" company="BTU/IIT">
|
||||
// Company copyright tag.
|
||||
// </copyright>
|
||||
// <author>stubbfel</author>
|
||||
// <sience>06.06.2013</sience>
|
||||
//----------------------------------------------------------------------
|
||||
namespace CampusAppDLL.Utility
|
||||
{
|
||||
using System.Text.RegularExpressions;
|
||||
|
||||
/// <summary>
|
||||
/// Class provides some special StringMethods
|
||||
/// </summary>
|
||||
public static class StringManager
|
||||
{
|
||||
#region Members
|
||||
|
||||
/// <summary>
|
||||
/// Patter for Html-Tags
|
||||
/// </summary>
|
||||
private static readonly string HtmlTagPattern = "<.*?>";
|
||||
|
||||
#endregion
|
||||
|
||||
#region Methods
|
||||
|
||||
/// <summary>
|
||||
/// Method removes Html-Tag of a String
|
||||
/// </summary>
|
||||
/// <param name="inputString">String with Html-Tags</param>
|
||||
/// <returns>String without Html-Tags</returns>
|
||||
public static string StripHTML(string inputString)
|
||||
{
|
||||
return Regex.Replace(inputString, HtmlTagPattern, string.Empty);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Method add an Newline to a string
|
||||
/// </summary>
|
||||
/// <param name="str">input string</param>
|
||||
/// <returns>input string + newline</returns>
|
||||
public static string AddNewLine(string str)
|
||||
{
|
||||
return str.ToString() + "\n";
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Method remove(TrimEND!) an Newline to a string
|
||||
/// </summary>
|
||||
/// <param name="str">input string</param>
|
||||
/// <returns>input string - newline</returns
|
||||
public static string RemoveNewLine(string str)
|
||||
{
|
||||
return str.TrimEnd('\n');
|
||||
}
|
||||
#endregion
|
||||
}
|
||||
}
|
||||
88
CampusAppWP8/CampusAppDLL/Utility/XmlManager.cs
Normal file
88
CampusAppWP8/CampusAppDLL/Utility/XmlManager.cs
Normal file
@@ -0,0 +1,88 @@
|
||||
//-----------------------------------------------------------------------
|
||||
// <copyright file="XmlManager.cs" company="BTU/IIT">
|
||||
// Company copyright tag.
|
||||
// </copyright>
|
||||
// <author>stubbfel</author>
|
||||
// <sience>18.06.2013</sience>
|
||||
//----------------------------------------------------------------------
|
||||
namespace CampusAppDLL.Utility
|
||||
{
|
||||
using System.IO;
|
||||
using System.Xml.Linq;
|
||||
using System.Xml.Serialization;
|
||||
|
||||
/// <summary>
|
||||
/// Class provides some Xml-methods
|
||||
/// </summary>
|
||||
public class XmlManager
|
||||
{
|
||||
/// <summary>
|
||||
/// Method deserialization a string to a Model
|
||||
/// </summary>
|
||||
/// <typeparam name="T">the model</typeparam>
|
||||
/// <param name="xmlString">the XmlString</param>
|
||||
/// <param name="validRootName">name of the RootTag</param>
|
||||
/// <returns>return the deserialization of the model</returns>
|
||||
public static T DeserializationToModel<T>(string xmlString, string validRootName)
|
||||
{
|
||||
XmlSerializer serializer = new XmlSerializer(typeof(T));
|
||||
XDocument document = XDocument.Parse(xmlString);
|
||||
if (!document.Root.Name.ToString().Equals(validRootName))
|
||||
{
|
||||
XElement content = document.Root;
|
||||
document = new XDocument();
|
||||
document.Add(new XElement(validRootName, content));
|
||||
}
|
||||
|
||||
T model = (T)serializer.Deserialize(document.CreateReader());
|
||||
return model;
|
||||
}
|
||||
|
||||
/// <summary>Deserialization a xml file to a model.</summary>
|
||||
/// <remarks>Stubbfel, 20.08.2013.</remarks>
|
||||
/// <typeparam name="T">Generic type parameter.</typeparam>
|
||||
/// <param name="xmlFilePath">Path to the a XmlFile.</param>
|
||||
/// <returns>model of the XmlFile.</returns>
|
||||
public static T DeserializationFileToModel<T>(string xmlFilePath)
|
||||
{
|
||||
XmlSerializer serializer = new XmlSerializer(typeof(T));
|
||||
XDocument document = XDocument.Load(xmlFilePath);
|
||||
T model = (T)serializer.Deserialize(document.CreateReader());
|
||||
return model;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Method serializes a model to a string.
|
||||
/// </summary>
|
||||
/// <typeparam name="T">type of the model</typeparam>
|
||||
/// <param name="model">model object</param>
|
||||
/// <returns>serialized string</returns>
|
||||
public static string SerializationToString<T>(T model)
|
||||
{
|
||||
string retValue = string.Empty;
|
||||
|
||||
XmlSerializerNamespaces ns = new XmlSerializerNamespaces();
|
||||
ns.Add(string.Empty, string.Empty);
|
||||
|
||||
XmlSerializer serializer = new XmlSerializer(typeof(T));
|
||||
TextWriter writer = new StringWriter();
|
||||
|
||||
serializer.Serialize(writer, model, ns);
|
||||
|
||||
retValue = writer.ToString();
|
||||
|
||||
if (retValue.StartsWith("<?xml") == true)
|
||||
{
|
||||
int endTag = retValue.IndexOf("?>");
|
||||
retValue = retValue.Substring(endTag + 2);
|
||||
|
||||
if (retValue.StartsWith("\r\n") == true)
|
||||
{
|
||||
retValue = retValue.Substring(2);
|
||||
}
|
||||
}
|
||||
|
||||
return retValue;
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -9,14 +9,20 @@ Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "CampusAppWPortalLib8", "Cam
|
||||
EndProject
|
||||
Project("{888888A0-9F3D-457C-B088-3A5042F75D52}") = "IconCreator", "IconCreator\IconCreator.pyproj", "{78E8DC22-F4E1-42D9-BA04-93EA031C630C}"
|
||||
EndProject
|
||||
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "CampusAppDLL", "CampusAppDLL\CampusAppDLL.csproj", "{E4EC5B95-06FC-4304-97E2-9E3F9B980303}"
|
||||
EndProject
|
||||
Global
|
||||
GlobalSection(SolutionConfigurationPlatforms) = preSolution
|
||||
Debug|Any CPU = Debug|Any CPU
|
||||
Debug|ARM = Debug|ARM
|
||||
Debug|Mixed Platforms = Debug|Mixed Platforms
|
||||
Debug|Win32 = Debug|Win32
|
||||
Debug|x64 = Debug|x64
|
||||
Debug|x86 = Debug|x86
|
||||
Release|Any CPU = Release|Any CPU
|
||||
Release|ARM = Release|ARM
|
||||
Release|Mixed Platforms = Release|Mixed Platforms
|
||||
Release|Win32 = Release|Win32
|
||||
Release|x64 = Release|x64
|
||||
Release|x86 = Release|x86
|
||||
EndGlobalSection
|
||||
@@ -27,6 +33,12 @@ 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|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
|
||||
{120B88CC-F3F0-4C5A-A3FD-C26E835338CC}.Debug|x64.ActiveCfg = Debug|Any CPU
|
||||
{120B88CC-F3F0-4C5A-A3FD-C26E835338CC}.Debug|x86.ActiveCfg = Debug|x86
|
||||
{120B88CC-F3F0-4C5A-A3FD-C26E835338CC}.Debug|x86.Build.0 = Debug|x86
|
||||
@@ -37,6 +49,12 @@ Global
|
||||
{120B88CC-F3F0-4C5A-A3FD-C26E835338CC}.Release|ARM.ActiveCfg = Release|ARM
|
||||
{120B88CC-F3F0-4C5A-A3FD-C26E835338CC}.Release|ARM.Build.0 = Release|ARM
|
||||
{120B88CC-F3F0-4C5A-A3FD-C26E835338CC}.Release|ARM.Deploy.0 = Release|ARM
|
||||
{120B88CC-F3F0-4C5A-A3FD-C26E835338CC}.Release|Mixed Platforms.ActiveCfg = Release|x86
|
||||
{120B88CC-F3F0-4C5A-A3FD-C26E835338CC}.Release|Mixed Platforms.Build.0 = Release|x86
|
||||
{120B88CC-F3F0-4C5A-A3FD-C26E835338CC}.Release|Mixed Platforms.Deploy.0 = Release|x86
|
||||
{120B88CC-F3F0-4C5A-A3FD-C26E835338CC}.Release|Win32.ActiveCfg = Release|x86
|
||||
{120B88CC-F3F0-4C5A-A3FD-C26E835338CC}.Release|Win32.Build.0 = Release|x86
|
||||
{120B88CC-F3F0-4C5A-A3FD-C26E835338CC}.Release|Win32.Deploy.0 = Release|x86
|
||||
{120B88CC-F3F0-4C5A-A3FD-C26E835338CC}.Release|x64.ActiveCfg = Release|Any CPU
|
||||
{120B88CC-F3F0-4C5A-A3FD-C26E835338CC}.Release|x86.ActiveCfg = Release|x86
|
||||
{120B88CC-F3F0-4C5A-A3FD-C26E835338CC}.Release|x86.Build.0 = Release|x86
|
||||
@@ -47,6 +65,12 @@ 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|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
|
||||
{E49420AA-3023-42EF-8255-67B1F5E52B43}.Debug|x64.ActiveCfg = Debug|x64
|
||||
{E49420AA-3023-42EF-8255-67B1F5E52B43}.Debug|x64.Build.0 = Debug|x64
|
||||
{E49420AA-3023-42EF-8255-67B1F5E52B43}.Debug|x64.Deploy.0 = Debug|x64
|
||||
@@ -59,6 +83,12 @@ Global
|
||||
{E49420AA-3023-42EF-8255-67B1F5E52B43}.Release|ARM.ActiveCfg = Release|ARM
|
||||
{E49420AA-3023-42EF-8255-67B1F5E52B43}.Release|ARM.Build.0 = Release|ARM
|
||||
{E49420AA-3023-42EF-8255-67B1F5E52B43}.Release|ARM.Deploy.0 = Release|ARM
|
||||
{E49420AA-3023-42EF-8255-67B1F5E52B43}.Release|Mixed Platforms.ActiveCfg = Release|x86
|
||||
{E49420AA-3023-42EF-8255-67B1F5E52B43}.Release|Mixed Platforms.Build.0 = Release|x86
|
||||
{E49420AA-3023-42EF-8255-67B1F5E52B43}.Release|Mixed Platforms.Deploy.0 = Release|x86
|
||||
{E49420AA-3023-42EF-8255-67B1F5E52B43}.Release|Win32.ActiveCfg = Release|x86
|
||||
{E49420AA-3023-42EF-8255-67B1F5E52B43}.Release|Win32.Build.0 = Release|x86
|
||||
{E49420AA-3023-42EF-8255-67B1F5E52B43}.Release|Win32.Deploy.0 = Release|x86
|
||||
{E49420AA-3023-42EF-8255-67B1F5E52B43}.Release|x64.ActiveCfg = Release|x64
|
||||
{E49420AA-3023-42EF-8255-67B1F5E52B43}.Release|x64.Build.0 = Release|x64
|
||||
{E49420AA-3023-42EF-8255-67B1F5E52B43}.Release|x64.Deploy.0 = Release|x64
|
||||
@@ -68,21 +98,47 @@ Global
|
||||
{67D80BE2-0FB7-44C8-A495-7D44FC2AC262}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
|
||||
{67D80BE2-0FB7-44C8-A495-7D44FC2AC262}.Debug|Any CPU.Build.0 = Debug|Any CPU
|
||||
{67D80BE2-0FB7-44C8-A495-7D44FC2AC262}.Debug|ARM.ActiveCfg = Debug|Any CPU
|
||||
{67D80BE2-0FB7-44C8-A495-7D44FC2AC262}.Debug|Mixed Platforms.ActiveCfg = Debug|Any CPU
|
||||
{67D80BE2-0FB7-44C8-A495-7D44FC2AC262}.Debug|Mixed Platforms.Build.0 = Debug|Any CPU
|
||||
{67D80BE2-0FB7-44C8-A495-7D44FC2AC262}.Debug|Win32.ActiveCfg = Debug|Any CPU
|
||||
{67D80BE2-0FB7-44C8-A495-7D44FC2AC262}.Debug|x64.ActiveCfg = Debug|Any CPU
|
||||
{67D80BE2-0FB7-44C8-A495-7D44FC2AC262}.Debug|x86.ActiveCfg = Debug|Any CPU
|
||||
{67D80BE2-0FB7-44C8-A495-7D44FC2AC262}.Release|Any CPU.ActiveCfg = Release|Any CPU
|
||||
{67D80BE2-0FB7-44C8-A495-7D44FC2AC262}.Release|Any CPU.Build.0 = Release|Any CPU
|
||||
{67D80BE2-0FB7-44C8-A495-7D44FC2AC262}.Release|ARM.ActiveCfg = Release|Any CPU
|
||||
{67D80BE2-0FB7-44C8-A495-7D44FC2AC262}.Release|Mixed Platforms.ActiveCfg = Release|Any CPU
|
||||
{67D80BE2-0FB7-44C8-A495-7D44FC2AC262}.Release|Mixed Platforms.Build.0 = Release|Any CPU
|
||||
{67D80BE2-0FB7-44C8-A495-7D44FC2AC262}.Release|Win32.ActiveCfg = Release|Any CPU
|
||||
{67D80BE2-0FB7-44C8-A495-7D44FC2AC262}.Release|x64.ActiveCfg = Release|Any CPU
|
||||
{67D80BE2-0FB7-44C8-A495-7D44FC2AC262}.Release|x86.ActiveCfg = Release|Any CPU
|
||||
{78E8DC22-F4E1-42D9-BA04-93EA031C630C}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
|
||||
{78E8DC22-F4E1-42D9-BA04-93EA031C630C}.Debug|ARM.ActiveCfg = Debug|Any CPU
|
||||
{78E8DC22-F4E1-42D9-BA04-93EA031C630C}.Debug|Mixed Platforms.ActiveCfg = Debug|Any CPU
|
||||
{78E8DC22-F4E1-42D9-BA04-93EA031C630C}.Debug|Win32.ActiveCfg = Debug|Any CPU
|
||||
{78E8DC22-F4E1-42D9-BA04-93EA031C630C}.Debug|x64.ActiveCfg = Debug|Any CPU
|
||||
{78E8DC22-F4E1-42D9-BA04-93EA031C630C}.Debug|x86.ActiveCfg = Debug|Any CPU
|
||||
{78E8DC22-F4E1-42D9-BA04-93EA031C630C}.Release|Any CPU.ActiveCfg = Release|Any CPU
|
||||
{78E8DC22-F4E1-42D9-BA04-93EA031C630C}.Release|ARM.ActiveCfg = Release|Any CPU
|
||||
{78E8DC22-F4E1-42D9-BA04-93EA031C630C}.Release|Mixed Platforms.ActiveCfg = Release|Any CPU
|
||||
{78E8DC22-F4E1-42D9-BA04-93EA031C630C}.Release|Win32.ActiveCfg = Release|Any CPU
|
||||
{78E8DC22-F4E1-42D9-BA04-93EA031C630C}.Release|x64.ActiveCfg = Release|Any CPU
|
||||
{78E8DC22-F4E1-42D9-BA04-93EA031C630C}.Release|x86.ActiveCfg = Release|Any CPU
|
||||
{E4EC5B95-06FC-4304-97E2-9E3F9B980303}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
|
||||
{E4EC5B95-06FC-4304-97E2-9E3F9B980303}.Debug|Any CPU.Build.0 = Debug|Any CPU
|
||||
{E4EC5B95-06FC-4304-97E2-9E3F9B980303}.Debug|ARM.ActiveCfg = Debug|Any CPU
|
||||
{E4EC5B95-06FC-4304-97E2-9E3F9B980303}.Debug|Mixed Platforms.ActiveCfg = Debug|Any CPU
|
||||
{E4EC5B95-06FC-4304-97E2-9E3F9B980303}.Debug|Mixed Platforms.Build.0 = Debug|Any CPU
|
||||
{E4EC5B95-06FC-4304-97E2-9E3F9B980303}.Debug|Win32.ActiveCfg = Debug|Any CPU
|
||||
{E4EC5B95-06FC-4304-97E2-9E3F9B980303}.Debug|x64.ActiveCfg = Debug|Any CPU
|
||||
{E4EC5B95-06FC-4304-97E2-9E3F9B980303}.Debug|x86.ActiveCfg = Debug|Any CPU
|
||||
{E4EC5B95-06FC-4304-97E2-9E3F9B980303}.Release|Any CPU.ActiveCfg = Release|Any CPU
|
||||
{E4EC5B95-06FC-4304-97E2-9E3F9B980303}.Release|Any CPU.Build.0 = Release|Any CPU
|
||||
{E4EC5B95-06FC-4304-97E2-9E3F9B980303}.Release|ARM.ActiveCfg = Release|Any CPU
|
||||
{E4EC5B95-06FC-4304-97E2-9E3F9B980303}.Release|Mixed Platforms.ActiveCfg = Release|Any CPU
|
||||
{E4EC5B95-06FC-4304-97E2-9E3F9B980303}.Release|Mixed Platforms.Build.0 = Release|Any CPU
|
||||
{E4EC5B95-06FC-4304-97E2-9E3F9B980303}.Release|Win32.ActiveCfg = Release|Any CPU
|
||||
{E4EC5B95-06FC-4304-97E2-9E3F9B980303}.Release|x64.ActiveCfg = Release|Any CPU
|
||||
{E4EC5B95-06FC-4304-97E2-9E3F9B980303}.Release|x86.ActiveCfg = Release|Any CPU
|
||||
EndGlobalSection
|
||||
GlobalSection(SolutionProperties) = preSolution
|
||||
HideSolutionNode = FALSE
|
||||
|
||||
@@ -5,16 +5,12 @@
|
||||
// <author>stubbfel</author>
|
||||
// <sience>12.08.2013</sience>
|
||||
//----------------------------------------------------------------------
|
||||
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;
|
||||
|
||||
/// <summary>
|
||||
/// Class for SPSAPI
|
||||
|
||||
@@ -5,7 +5,7 @@
|
||||
// <author>stubbfel</author>
|
||||
// <sience>06.08.2013</sience>
|
||||
//----------------------------------------------------------------------
|
||||
namespace CampusAppWP8.Feed.GeoApi
|
||||
namespace CampusAppWP8.Api.GeoApi
|
||||
{
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
|
||||
@@ -5,7 +5,7 @@
|
||||
// <author>stubbfel</author>
|
||||
// <sience>13.06.2013</sience>
|
||||
//----------------------------------------------------------------------
|
||||
namespace CampusAppWP8.Feed.Lecture
|
||||
namespace CampusAppWP8.Api.Lecture
|
||||
{
|
||||
using CampusAppWP8.Model;
|
||||
using CampusAppWP8.Model.Lecture;
|
||||
|
||||
27
CampusAppWP8/CampusAppWP8/Api/Person/PersonSearchApi.cs
Normal file
27
CampusAppWP8/CampusAppWP8/Api/Person/PersonSearchApi.cs
Normal file
@@ -0,0 +1,27 @@
|
||||
//-----------------------------------------------------------------------------
|
||||
// <copyright file="PersonSearchApi.cs" company="BTU/IIT">
|
||||
// Company copyright tag.
|
||||
// </copyright>
|
||||
// <author>stubbfel</author>
|
||||
// <sience>05.09.2013</sience>
|
||||
//-----------------------------------------------------------------------------
|
||||
|
||||
namespace CampusAppWP8.Api.Person
|
||||
{
|
||||
using CampusAppWP8.Model;
|
||||
using CampusAppWP8.Model.Person;
|
||||
using CampusAppWP8.Resources;
|
||||
|
||||
/// <summary>Person search api.</summary>
|
||||
/// <remarks>Stubbfel, 05.09.2013.</remarks>
|
||||
public class PersonSearchApi : XmlModel<PersonListModel>
|
||||
{
|
||||
/// <summary>Initializes a new instance of the PersonSearchApi class.</summary>
|
||||
/// <remarks>Stubbfel, 05.09.2013.</remarks>
|
||||
public PersonSearchApi()
|
||||
: base(ModelType.Feed, Constants.UrlPerson_PersonSearchByName)
|
||||
{
|
||||
this.ValidRootName = Constants.PersonListValidRootName;
|
||||
}
|
||||
}
|
||||
}
|
||||
BIN
CampusAppWP8/CampusAppWP8/Assets/Icons/DarkTheme/person_159.png
Normal file
BIN
CampusAppWP8/CampusAppWP8/Assets/Icons/DarkTheme/person_159.png
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 1.2 KiB |
BIN
CampusAppWP8/CampusAppWP8/Assets/Icons/LightTheme/person_159.png
Normal file
BIN
CampusAppWP8/CampusAppWP8/Assets/Icons/LightTheme/person_159.png
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 1.1 KiB |
@@ -95,6 +95,7 @@
|
||||
<ItemGroup>
|
||||
<Compile Include="Api\GeoApi\CampusSpsApi.cs" />
|
||||
<Compile Include="Api\GeoApi\SpsApi.cs" />
|
||||
<Compile Include="Api\Person\PersonSearchApi.cs" />
|
||||
<Compile Include="App.xaml.cs">
|
||||
<DependentUpon>App.xaml</DependentUpon>
|
||||
</Compile>
|
||||
@@ -118,6 +119,9 @@
|
||||
<Compile Include="Model\GeoDb\PlaceService.cs" />
|
||||
<Compile Include="Model\GeoDb\SpsModel.cs" />
|
||||
<Compile Include="Model\Mensa\MealModel.cs" />
|
||||
<Compile Include="Model\Person\PersonFunctionModel.cs" />
|
||||
<Compile Include="Model\Person\PersonListModel.cs" />
|
||||
<Compile Include="Model\Person\PersonModel.cs" />
|
||||
<Compile Include="Model\Setting\AppSettings.cs" />
|
||||
<Compile Include="Model\Setting\UserProfilModel.cs" />
|
||||
<Compile Include="Model\Utility\CourseListPickerItemListModel.cs" />
|
||||
@@ -127,6 +131,10 @@
|
||||
<Compile Include="Pages\Exams\Exams.xaml.cs">
|
||||
<DependentUpon>Exams.xaml</DependentUpon>
|
||||
</Compile>
|
||||
<Compile Include="Pages\Person\PersonPage.xaml.cs">
|
||||
<DependentUpon>PersonPage.xaml</DependentUpon>
|
||||
</Compile>
|
||||
<Compile Include="Utility\Lui\Button\AddPersonButton.cs" />
|
||||
<Compile Include="Utility\NDEF\NDEFMessage.cs" />
|
||||
<Compile Include="Utility\NDEF\NDEFRecord.cs" />
|
||||
<Compile Include="Utility\NDEF\NDEFShortRecord.cs" />
|
||||
@@ -351,6 +359,10 @@
|
||||
<SubType>Designer</SubType>
|
||||
<Generator>MSBuild:Compile</Generator>
|
||||
</Page>
|
||||
<Page Include="Pages\Person\PersonPage.xaml">
|
||||
<SubType>Designer</SubType>
|
||||
<Generator>MSBuild:Compile</Generator>
|
||||
</Page>
|
||||
<Page Include="Pages\Setting\AppSettingPage.xaml">
|
||||
<SubType>Designer</SubType>
|
||||
<Generator>MSBuild:Compile</Generator>
|
||||
@@ -411,6 +423,7 @@
|
||||
<Content Include="Assets\Icons\DarkTheme\exams_159.png" />
|
||||
<Content Include="Assets\Icons\DarkTheme\favorite_159.png" />
|
||||
<Content Include="Assets\Icons\DarkTheme\info_159.png" />
|
||||
<Content Include="Assets\Icons\DarkTheme\person_159.png" />
|
||||
<Content Include="Assets\Icons\DarkTheme\phone_159.png" />
|
||||
<Content Include="Assets\Icons\DarkTheme\search_place_159.png" />
|
||||
<Content Include="Assets\Icons\DarkTheme\update_159.png" />
|
||||
@@ -437,6 +450,7 @@
|
||||
<Content Include="Assets\Icons\DarkTheme\openhours_159.png" />
|
||||
<Content Include="Assets\Icons\LightTheme\openhours_159.png" />
|
||||
<Content Include="Assets\Icons\DarkTheme\schedule_159.png" />
|
||||
<Content Include="Assets\Icons\LightTheme\person_159.png" />
|
||||
<Content Include="Assets\Icons\LightTheme\phone_159.png" />
|
||||
<Content Include="Assets\Icons\LightTheme\schedule_159.png" />
|
||||
<Content Include="Assets\Icons\DarkTheme\search_159.png" />
|
||||
|
||||
179
CampusAppWP8/CampusAppWP8/Model/Person/PersonFunctionModel.cs
Normal file
179
CampusAppWP8/CampusAppWP8/Model/Person/PersonFunctionModel.cs
Normal file
@@ -0,0 +1,179 @@
|
||||
//-----------------------------------------------------------------------------
|
||||
// <copyright file="PersonFunctionModel.cs" company="BTU/IIT">
|
||||
// Company copyright tag.
|
||||
// </copyright>
|
||||
// <author>stubbfel</author>
|
||||
// <sience>05.09.2013</sience>
|
||||
//-----------------------------------------------------------------------------
|
||||
namespace CampusAppWP8.Model.Person
|
||||
{
|
||||
using System.Xml.Serialization;
|
||||
using CampusAppWP8.Utility;
|
||||
|
||||
/// <summary>Person function model.</summary>
|
||||
/// <remarks>Stubbfel, 05.09.2013.</remarks>
|
||||
public class PersonFunctionModel
|
||||
{
|
||||
/// <summary>The first tel.</summary>
|
||||
private string tel1;
|
||||
|
||||
/// <summary>The second tel.</summary>
|
||||
private string tel2;
|
||||
|
||||
/// <summary>The fax.</summary>
|
||||
private string fax;
|
||||
|
||||
/// <summary>The mail.</summary>
|
||||
private string mail;
|
||||
|
||||
/// <summary>The function.</summary>
|
||||
private string function;
|
||||
|
||||
/// <summary>The appointment.</summary>
|
||||
private string appointment;
|
||||
|
||||
/// <summary>The building.</summary>
|
||||
private string building;
|
||||
|
||||
/// <summary>Gets or sets the tel 1.</summary>
|
||||
/// <value>The tel 1.</value>
|
||||
[XmlAttribute("telefon")]
|
||||
public string Tel1
|
||||
{
|
||||
get
|
||||
{
|
||||
return this.tel1;
|
||||
}
|
||||
|
||||
set
|
||||
{
|
||||
if (value != null && value != string.Empty && value != this.tel1)
|
||||
{
|
||||
this.tel1 = StringManager.CreateUniTelefonNumber(value);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>Gets or sets the tel 2.</summary>
|
||||
/// <value>The tel 2.</value>
|
||||
[XmlAttribute("telefon2")]
|
||||
public string Tel2
|
||||
{
|
||||
get
|
||||
{
|
||||
return this.tel2;
|
||||
}
|
||||
|
||||
set
|
||||
{
|
||||
if (value != null && value != string.Empty && value != this.tel2)
|
||||
{
|
||||
this.tel2 = StringManager.CreateUniTelefonNumber(value);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>Gets or sets the fax.</summary>
|
||||
/// <value>The fax.</value>
|
||||
[XmlAttribute("fax")]
|
||||
public string Fax
|
||||
{
|
||||
get
|
||||
{
|
||||
return this.fax;
|
||||
}
|
||||
|
||||
set
|
||||
{
|
||||
if (value != null && value != string.Empty && value != this.fax)
|
||||
{
|
||||
this.fax = StringManager.CreateUniTelefonNumber(value);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>Gets or sets the function.</summary>
|
||||
/// <value>The function.</value>
|
||||
[XmlAttribute("funktion")]
|
||||
public string Function
|
||||
{
|
||||
get
|
||||
{
|
||||
return this.function;
|
||||
}
|
||||
|
||||
set
|
||||
{
|
||||
if (value != this.function)
|
||||
{
|
||||
this.function = StringManager.StripHTML(value);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>Gets or sets the appointment.</summary>
|
||||
/// <value>The appointment.</value>
|
||||
[XmlAttribute("einrichtung")]
|
||||
public string Appointment
|
||||
{
|
||||
get
|
||||
{
|
||||
return this.appointment;
|
||||
}
|
||||
|
||||
set
|
||||
{
|
||||
if (value != this.appointment)
|
||||
{
|
||||
this.appointment = StringManager.StripHTML(value);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>Gets or sets the building.</summary>
|
||||
/// <value>The building.</value>
|
||||
[XmlAttribute("gebaeude")]
|
||||
public string Building
|
||||
{
|
||||
get
|
||||
{
|
||||
return this.building;
|
||||
}
|
||||
|
||||
set
|
||||
{
|
||||
if (value != this.building)
|
||||
{
|
||||
this.building = StringManager.StripHTML(value);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>Gets or sets the mail.</summary>
|
||||
/// <value>The mail.</value>
|
||||
[XmlAttribute("mail")]
|
||||
public string Mail
|
||||
{
|
||||
get
|
||||
{
|
||||
return this.mail;
|
||||
}
|
||||
|
||||
set
|
||||
{
|
||||
if (value != null && value != this.mail && StringManager.IsValidEmail(value))
|
||||
{
|
||||
this.mail = value;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>Gets or sets the identifier of the person.</summary>
|
||||
/// <value>The identifier of the person.</value>
|
||||
public string PersonID { get; set; }
|
||||
|
||||
/// <summary>Gets or sets zero-based index of the function.</summary>
|
||||
/// <value>The function index.</value>
|
||||
public int FunctionIndex { get; set; }
|
||||
}
|
||||
}
|
||||
79
CampusAppWP8/CampusAppWP8/Model/Person/PersonListModel.cs
Normal file
79
CampusAppWP8/CampusAppWP8/Model/Person/PersonListModel.cs
Normal file
@@ -0,0 +1,79 @@
|
||||
//-----------------------------------------------------------------------------
|
||||
// <copyright file="PersonListModel.cs" company="BTU/IIT">
|
||||
// Company copyright tag.
|
||||
// </copyright>
|
||||
// <author>stubbfel</author>
|
||||
// <sience>05.09.2013</sience>
|
||||
//-----------------------------------------------------------------------------
|
||||
|
||||
namespace CampusAppWP8.Model.Person
|
||||
{
|
||||
using System.Collections.Generic;
|
||||
using System.Collections.ObjectModel;
|
||||
using System.Xml.Serialization;
|
||||
|
||||
/// <summary>Person list model.</summary>
|
||||
/// <remarks>Stubbfel, 05.09.2013.</remarks>
|
||||
[XmlRoot("Uebersicht")]
|
||||
public class PersonListModel
|
||||
{
|
||||
/// <summary>Gets or sets the persons.</summary>
|
||||
/// <value>The persons.</value>
|
||||
[XmlElement("person")]
|
||||
public ObservableCollection<PersonModel> Persons { get; set; }
|
||||
|
||||
/// <summary>Sets person identifier to function.</summary>
|
||||
/// <remarks>Stubbfel, 05.09.2013.</remarks>
|
||||
public void SetPersonIdToFunction()
|
||||
{
|
||||
foreach (PersonModel person in this.Persons)
|
||||
{
|
||||
person.SetPersonIdToFunction();
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>Gets a person.</summary>
|
||||
/// <remarks>Stubbfel, 05.09.2013.</remarks>
|
||||
/// <param name="id">The identifier.</param>
|
||||
/// <returns>The person.</returns>
|
||||
public PersonModel GetPerson(string id)
|
||||
{
|
||||
foreach (PersonModel tmpPerson in this.Persons)
|
||||
{
|
||||
if (tmpPerson.ID.Equals(id))
|
||||
{
|
||||
return tmpPerson;
|
||||
}
|
||||
}
|
||||
|
||||
return null;
|
||||
}
|
||||
|
||||
/// <summary>Removes the non function and set identifiers person.</summary>
|
||||
/// <remarks>Stubbfel, 05.09.2013.</remarks>
|
||||
public void RemoveNonFunctionAndSetIdsPerson()
|
||||
{
|
||||
this.RemoveNonFunctionPerson();
|
||||
this.SetPersonIdToFunction();
|
||||
}
|
||||
|
||||
/// <summary>Removes the non function person.</summary>
|
||||
/// <remarks>Stubbfel, 05.09.2013.</remarks>
|
||||
public void RemoveNonFunctionPerson()
|
||||
{
|
||||
List<PersonModel> removeList = new List<PersonModel>();
|
||||
foreach (PersonModel tmpPerson in this.Persons)
|
||||
{
|
||||
if (tmpPerson.Functions.Count < 1)
|
||||
{
|
||||
removeList.Add(tmpPerson);
|
||||
}
|
||||
}
|
||||
|
||||
foreach (PersonModel removePerson in removeList)
|
||||
{
|
||||
this.Persons.Remove(removePerson);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
157
CampusAppWP8/CampusAppWP8/Model/Person/PersonModel.cs
Normal file
157
CampusAppWP8/CampusAppWP8/Model/Person/PersonModel.cs
Normal file
@@ -0,0 +1,157 @@
|
||||
//-----------------------------------------------------------------------------
|
||||
// <copyright file="PersonModel.cs" company="BTU/IIT">
|
||||
// Company copyright tag.
|
||||
// </copyright>
|
||||
// <author>stubbfel</author>
|
||||
// <sience>05.09.2013</sience>
|
||||
//-----------------------------------------------------------------------------
|
||||
namespace CampusAppWP8.Model.Person
|
||||
{
|
||||
using System.Collections.ObjectModel;
|
||||
using System.Xml.Serialization;
|
||||
using CampusAppWP8.Utility;
|
||||
|
||||
/// <summary>Person model.</summary>
|
||||
/// <remarks>Stubbfel, 05.09.2013.</remarks>
|
||||
public class PersonModel
|
||||
{
|
||||
/// <summary>The akadgrad.</summary>
|
||||
private string akadgrad;
|
||||
|
||||
/// <summary>Name of the sur.</summary>
|
||||
private string surName;
|
||||
|
||||
/// <summary>The person's first name.</summary>
|
||||
private string firstName;
|
||||
|
||||
/// <summary>The identifier.</summary>
|
||||
private string id;
|
||||
|
||||
/// <summary>The functions.</summary>
|
||||
private ObservableCollection<PersonFunctionModel> functions;
|
||||
|
||||
/// <summary>Gets or sets the identifier.</summary>
|
||||
/// <value>The identifier.</value>
|
||||
[XmlAttribute("id")]
|
||||
public string ID
|
||||
{
|
||||
get
|
||||
{
|
||||
return this.id;
|
||||
}
|
||||
|
||||
set
|
||||
{
|
||||
if (value != this.id)
|
||||
{
|
||||
this.id = value;
|
||||
this.SetPersonIdToFunction();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>Gets or sets the akadgrad.</summary>
|
||||
/// <value>The akadgrad.</value>
|
||||
[XmlAttribute("akadgrad")]
|
||||
public string Akadgrad
|
||||
{
|
||||
get
|
||||
{
|
||||
return this.akadgrad;
|
||||
}
|
||||
|
||||
set
|
||||
{
|
||||
if (value != this.akadgrad)
|
||||
{
|
||||
this.akadgrad = StringManager.StripHTML(value);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>Gets or sets the name of the sur.</summary>
|
||||
/// <value>The name of the sur.</value>
|
||||
[XmlAttribute("nachname")]
|
||||
public string SurName
|
||||
{
|
||||
get
|
||||
{
|
||||
return this.surName;
|
||||
}
|
||||
|
||||
set
|
||||
{
|
||||
if (value != this.surName)
|
||||
{
|
||||
this.surName = StringManager.StripHTML(value);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>Gets or sets the person's first name.</summary>
|
||||
/// <value>The name of the first.</value>
|
||||
[XmlAttribute("vorname")]
|
||||
public string FirstName
|
||||
{
|
||||
get
|
||||
{
|
||||
return this.firstName;
|
||||
}
|
||||
|
||||
set
|
||||
{
|
||||
if (value != this.firstName)
|
||||
{
|
||||
this.firstName = StringManager.StripHTML(value);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>Gets or sets the functions of a person.</summary>
|
||||
/// <value>The functions.</value>
|
||||
[XmlElement("funktion")]
|
||||
public ObservableCollection<PersonFunctionModel> Functions
|
||||
{
|
||||
get
|
||||
{
|
||||
return this.functions;
|
||||
}
|
||||
|
||||
set
|
||||
{
|
||||
if (value != this.functions)
|
||||
{
|
||||
this.functions = value;
|
||||
this.SetPersonIdToFunction();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>Gets the name of a Person (FirstName SurName).</summary>
|
||||
/// <value>The name of a Person.</value>
|
||||
public string FullName
|
||||
{
|
||||
get
|
||||
{
|
||||
return this.Akadgrad + " " + this.FirstName + " " + this.SurName;
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>Sets person identifier to function.</summary>
|
||||
/// <remarks>Stubbfel, 05.09.2013.</remarks>
|
||||
public void SetPersonIdToFunction()
|
||||
{
|
||||
if (this.id == null || this.id.Equals(string.Empty) || this.functions == null)
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
int index = 0;
|
||||
foreach (PersonFunctionModel function in this.functions)
|
||||
{
|
||||
function.PersonID = this.ID;
|
||||
function.FunctionIndex = index++;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -51,7 +51,7 @@
|
||||
<Image Source="{Binding Path=ThemelizedIcon.Search, Source={StaticResource ThemelizedIcons}}" Width="60"/>
|
||||
</Button>-->
|
||||
<StackPanel Grid.Column="0" VerticalAlignment="Center">
|
||||
<TextBox Name="QString" InputScope="Text" AcceptsReturn="True" />
|
||||
<TextBox Name="QString" InputScope="Text" AcceptsReturn="False" />
|
||||
</StackPanel>
|
||||
<Button Grid.Column="1" Click="Button_Click2">
|
||||
<Image Source="{Binding Path=ThemelizedIcon.Search, Source={StaticResource ThemelizedIcons}}" Width="60"/>
|
||||
|
||||
@@ -50,7 +50,7 @@ namespace CampusAppWP8.Pages.Departments
|
||||
DepartmentIndexPage.feed.OnFailedWeb += new DepartmentFeed.OnFailed(this.FeedIsFailedWeb);
|
||||
DepartmentIndexPage.feed.OnFailedFile += new DepartmentFeed.OnFailed(this.FeedIsFailedFile);
|
||||
|
||||
DepartmentIndexPage.feed.LoadData(Utilities.getLoadModus<Model.Departments.DepartmentModel>());
|
||||
DepartmentIndexPage.feed.LoadData(Utilities.GetLoadModus<Model.Departments.DepartmentModel>());
|
||||
|
||||
if (DepartmentIndexPage.favorite == null)
|
||||
{
|
||||
|
||||
@@ -49,7 +49,7 @@ namespace CampusAppWP8.Pages.Events
|
||||
EventIndexPage.eventFeed.OnLoaded += new EventFeed.OnIO(this.SetupEventPageList);
|
||||
EventIndexPage.eventFeed.OnFailedWeb += new EventFeed.OnFailed(this.FeedIsFailedWeb);
|
||||
EventIndexPage.eventFeed.OnFailedFile += new EventFeed.OnFailed(this.FeedIsFailedFile);
|
||||
EventIndexPage.eventFeed.LoadData(Utilities.getLoadModus<Model.RSS.RSSViewModel>());
|
||||
EventIndexPage.eventFeed.LoadData(Utilities.GetLoadModus<Model.RSS.RSSViewModel>());
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
|
||||
@@ -10,7 +10,7 @@
|
||||
FontFamily="{StaticResource PhoneFontFamilyNormal}"
|
||||
FontSize="{StaticResource PhoneFontSizeNormal}"
|
||||
Foreground="{StaticResource PhoneForegroundBrush}"
|
||||
SupportedOrientations="Portrait" Orientation="Portrait"
|
||||
SupportedOrientations="PortraitOrLandscape" Orientation="Portrait"
|
||||
mc:Ignorable="d"
|
||||
shell:SystemTray.IsVisible="True">
|
||||
|
||||
|
||||
@@ -47,7 +47,7 @@ namespace CampusAppWP8.Pages.Exams
|
||||
}
|
||||
|
||||
this.ProgressBar.Visibility = System.Windows.Visibility.Visible;
|
||||
this.feed.LoadData(Utilities.getLoadModus<Model.Exams.ExamListModel>());
|
||||
this.feed.LoadData(Utilities.GetLoadModus<Model.Exams.ExamListModel>());
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
|
||||
@@ -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;
|
||||
@@ -159,9 +159,6 @@ namespace CampusAppWP8.Pages.Lecture
|
||||
/// <summary>
|
||||
/// Method send a request to the Feed
|
||||
/// </summary>
|
||||
/// <remarks>
|
||||
/// have to refactors
|
||||
/// </remarks>
|
||||
/// <param name="sender">sender of this event</param>
|
||||
/// <param name="e"> events arguments</param>
|
||||
private void SendRequest(object sender, RoutedEventArgs e)
|
||||
|
||||
@@ -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<Model.Link.LinkListModel>());
|
||||
this.clubLinkFeed.LoadData(Utilities.getLoadModus<Model.Link.LinkListModel>());
|
||||
this.commonLinkFeed.LoadData(Utilities.GetLoadModus<Model.Link.LinkListModel>());
|
||||
this.clubLinkFeed.LoadData(Utilities.GetLoadModus<Model.Link.LinkListModel>());
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
|
||||
@@ -11,7 +11,7 @@ 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.Lui.MessageBoxes;
|
||||
@@ -177,7 +177,7 @@ namespace CampusAppWP8.Pages.Mensa
|
||||
}
|
||||
else
|
||||
{
|
||||
this.feed.LoadData(Utilities.getLoadModus<Model.Mensa.MenuWeekModel>());
|
||||
this.feed.LoadData(Utilities.GetLoadModus<Model.Mensa.MenuWeekModel>());
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -49,7 +49,7 @@ 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<Model.RSS.RSSViewModel>());
|
||||
NewsIndexPage.newsFeed.LoadData(Utilities.GetLoadModus<Model.RSS.RSSViewModel>());
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
|
||||
@@ -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<Model.Openinghours.OpeninghoursModel>());
|
||||
this.feed.LoadData(Utilities.GetLoadModus<Model.Openinghours.OpeninghoursModel>());
|
||||
}
|
||||
|
||||
this.isNewInstance = true;
|
||||
|
||||
126
CampusAppWP8/CampusAppWP8/Pages/Person/PersonPage.xaml
Normal file
126
CampusAppWP8/CampusAppWP8/Pages/Person/PersonPage.xaml
Normal file
@@ -0,0 +1,126 @@
|
||||
<phone:PhoneApplicationPage
|
||||
x:Class="CampusAppWP8.Pages.Person.PersonPage"
|
||||
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
|
||||
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
|
||||
xmlns:phone="clr-namespace:Microsoft.Phone.Controls;assembly=Microsoft.Phone"
|
||||
xmlns:shell="clr-namespace:Microsoft.Phone.Shell;assembly=Microsoft.Phone"
|
||||
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
|
||||
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
|
||||
xmlns:lui="clr-namespace:CampusAppWP8.Utility.Lui.Button"
|
||||
FontFamily="{StaticResource PhoneFontFamilyNormal}"
|
||||
FontSize="{StaticResource PhoneFontSizeNormal}"
|
||||
Foreground="{StaticResource PhoneForegroundBrush}"
|
||||
SupportedOrientations="PortraitOrLandscape" Orientation="Portrait"
|
||||
mc:Ignorable="d"
|
||||
shell:SystemTray.IsVisible="True">
|
||||
|
||||
<!--LayoutRoot ist das Stammraster, in dem alle anderen Seiteninhalte platziert werden-->
|
||||
<Grid x:Name="LayoutRoot" Background="Transparent">
|
||||
<Grid.RowDefinitions>
|
||||
<RowDefinition Height="Auto"/>
|
||||
<RowDefinition Height="*"/>
|
||||
</Grid.RowDefinitions>
|
||||
|
||||
<ProgressBar Name="ProgressBar" Grid.Row="1" Visibility="Collapsed" IsIndeterminate="True"/>
|
||||
|
||||
<!--TitlePanel enthält den Namen der Anwendung und den Seitentitel-->
|
||||
<StackPanel Grid.Row="0" Margin="12,17,0,28">
|
||||
<TextBlock Text="{Binding Path=LocalizedResources.ApplicationTitle, Source={StaticResource LocalizedStrings}}" Style="{StaticResource PhoneTextNormalStyle}"/>
|
||||
<TextBlock Text="{Binding Path=LocalizedResources.PersonApp_Header, Source={StaticResource LocalizedStrings}}" Margin="9,-7,0,0" Style="{StaticResource PhoneTextTitle2Style}"/>
|
||||
</StackPanel>
|
||||
|
||||
<!--ContentPanel - zusätzliche Inhalte hier platzieren-->
|
||||
<Grid x:Name="ContentPanel" Grid.Row="1" Margin="12,0,12,0">
|
||||
<Grid.RowDefinitions>
|
||||
<RowDefinition Height="Auto"/>
|
||||
<RowDefinition Height="Auto"/>
|
||||
<RowDefinition Height="*"/>
|
||||
</Grid.RowDefinitions>
|
||||
<StackPanel Orientation="Horizontal" Grid.Row="0">
|
||||
<TextBlock Text="{Binding Path=LocalizedResources.PersonApp_SearchTextLabel, Source={StaticResource LocalizedStrings}}"/>
|
||||
<TextBlock Text=" : "/>
|
||||
</StackPanel>
|
||||
|
||||
<Grid Grid.Row="1">
|
||||
<Grid.ColumnDefinitions>
|
||||
<ColumnDefinition Width="*"/>
|
||||
<ColumnDefinition Width="auto"/>
|
||||
</Grid.ColumnDefinitions>
|
||||
<TextBox Name="SearchName" AcceptsReturn="False" Grid.Column="0" InputScope="PersonalSurname"/>
|
||||
<Button Grid.Column="1" Click="SendRequest">
|
||||
<Image Source="{Binding Path=ThemelizedIcon.Search, Source={StaticResource ThemelizedIcons}}" Width="50"/>
|
||||
</Button>
|
||||
</Grid>
|
||||
<ListBox x:Name="ResultBox" Grid.Row="2">
|
||||
<ListBox.ItemContainerStyle>
|
||||
<Style TargetType="ListBoxItem">
|
||||
<Setter Property="HorizontalContentAlignment" Value="Stretch"/>
|
||||
<Setter Property="HorizontalAlignment" Value="Stretch"/>
|
||||
</Style>
|
||||
</ListBox.ItemContainerStyle>
|
||||
<ListBox.ItemTemplate>
|
||||
<DataTemplate>
|
||||
<StackPanel>
|
||||
<lui:ToggleButton ToggleContentTag="{Binding Path=Constants.ToggleContent, Source={StaticResource Const}}" Style="{StaticResource ListButtonStyle}">
|
||||
<TextBlock Text="{Binding FullName}" TextWrapping="Wrap"/>
|
||||
</lui:ToggleButton>
|
||||
<StackPanel Tag="{Binding Path=Constants.ToggleContent, Source={StaticResource Const}}" Visibility="Collapsed">
|
||||
<ListBox ItemsSource="{Binding Functions}">
|
||||
<ListBox.ItemContainerStyle>
|
||||
<Style TargetType="ListBoxItem">
|
||||
<Setter Property="HorizontalContentAlignment" Value="Stretch"/>
|
||||
<Setter Property="HorizontalAlignment" Value="Stretch"/>
|
||||
</Style>
|
||||
</ListBox.ItemContainerStyle>
|
||||
<ListBox.ItemTemplate>
|
||||
<DataTemplate>
|
||||
<Border BorderBrush="{StaticResource PhoneBorderBrush}" BorderThickness="0,0,0,1" >
|
||||
<Grid>
|
||||
<Grid.RowDefinitions>
|
||||
<RowDefinition Height="auto"/>
|
||||
<RowDefinition Height="auto"/>
|
||||
<RowDefinition Height="auto"/>
|
||||
<RowDefinition Height="auto"/>
|
||||
</Grid.RowDefinitions>
|
||||
<Grid.ColumnDefinitions>
|
||||
<ColumnDefinition Width="auto"/>
|
||||
<ColumnDefinition Width="*"/>
|
||||
</Grid.ColumnDefinitions>
|
||||
|
||||
<StackPanel Orientation="Horizontal" Grid.Row="0" Grid.Column="0">
|
||||
<TextBlock Text="{Binding Path=LocalizedResources.PersonApp_FunctionName, Source={StaticResource LocalizedStrings}}" />
|
||||
<TextBlock Text=" : "/>
|
||||
</StackPanel>
|
||||
<TextBlock Text="{Binding Function}" Grid.Row="0" Grid.Column="1" TextWrapping="Wrap"/>
|
||||
|
||||
<StackPanel Orientation="Horizontal" Grid.Row="1" Grid.Column="0">
|
||||
<TextBlock Text="{Binding Path=LocalizedResources.PersonApp_Appointment, Source={StaticResource LocalizedStrings}}"/>
|
||||
<TextBlock Text=" : "/>
|
||||
</StackPanel>
|
||||
<TextBlock Text="{Binding Appointment}" Grid.Row="1" Grid.Column="1" TextWrapping="Wrap"/>
|
||||
|
||||
<StackPanel Orientation="Horizontal" Grid.Row="2" Grid.Column="0">
|
||||
<TextBlock Text ="{Binding Path=LocalizedResources.PersonApp_Building, Source={StaticResource LocalizedStrings}}" />
|
||||
<TextBlock Text=" : "/>
|
||||
</StackPanel>
|
||||
<TextBlock Text="{Binding Building}" Grid.Row="2" Grid.Column="1" TextWrapping="Wrap"/>
|
||||
|
||||
<StackPanel Grid.Row="3" Grid.Column="1" Orientation="Horizontal">
|
||||
<lui:EmailButton EmailAddress="{Binding Mail}" Height="100" />
|
||||
<lui:PhoneButton Number="{Binding Tel1}" Height="100" />
|
||||
<lui:AddPersonButton Height="100" Click="Button_Click" PersonId="{Binding PersonID}" FunctionIndex="{Binding FunctionIndex}" />
|
||||
</StackPanel>
|
||||
</Grid>
|
||||
</Border>
|
||||
</DataTemplate>
|
||||
</ListBox.ItemTemplate>
|
||||
</ListBox>
|
||||
</StackPanel>
|
||||
</StackPanel>
|
||||
</DataTemplate>
|
||||
</ListBox.ItemTemplate>
|
||||
</ListBox>
|
||||
</Grid>
|
||||
</Grid>
|
||||
|
||||
</phone:PhoneApplicationPage>
|
||||
131
CampusAppWP8/CampusAppWP8/Pages/Person/PersonPage.xaml.cs
Normal file
131
CampusAppWP8/CampusAppWP8/Pages/Person/PersonPage.xaml.cs
Normal file
@@ -0,0 +1,131 @@
|
||||
//-----------------------------------------------------------------------
|
||||
// <copyright file="PersonPage.xaml.cs" company="BTU/IIT">
|
||||
// Company copyright tag.
|
||||
// </copyright>
|
||||
// <author>stubbfel</author>
|
||||
// <sience>09.09.2013</sience>
|
||||
//----------------------------------------------------------------------
|
||||
|
||||
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;
|
||||
|
||||
/// <summary>Person page.</summary>
|
||||
/// <remarks>Stubbfel, 09.09.2013.</remarks>
|
||||
public partial class PersonPage : PhoneApplicationPage
|
||||
{
|
||||
/// <summary>The API.</summary>
|
||||
private PersonSearchApi api;
|
||||
|
||||
/// <summary>Initializes a new instance of the PersonPage class.</summary>
|
||||
/// <remarks>Stubbfel, 09.09.2013.</remarks>
|
||||
public PersonPage()
|
||||
{
|
||||
this.InitializeComponent();
|
||||
}
|
||||
|
||||
/// <summary>Sends a request.</summary>
|
||||
/// <remarks>Stubbfel, 09.09.2013.</remarks>
|
||||
/// <param name="sender">Source of the event.</param>
|
||||
/// <param name="e"> Routed event information.</param>
|
||||
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<UrlParamModel> parameterList = this.CreateUrlParameter(query);
|
||||
this.api.SetUriParams(parameterList);
|
||||
this.api.LoadData();
|
||||
}
|
||||
|
||||
/// <summary>Creates URL parameter.</summary>
|
||||
/// <remarks>Stubbfel, 09.09.2013.</remarks>
|
||||
/// <param name="name">The name.</param>
|
||||
/// <returns>The new URL parameter.</returns>
|
||||
private List<UrlParamModel> CreateUrlParameter(string name)
|
||||
{
|
||||
List<UrlParamModel> parameterList = new List<UrlParamModel>();
|
||||
parameterList.Add(new CleanUrlParamModel(Constants.ParamPersonList, name));
|
||||
return parameterList;
|
||||
}
|
||||
|
||||
/// <summary>API is fail.</summary>
|
||||
/// <remarks>Stubbfel, 09.09.2013.</remarks>
|
||||
private void ApiIsFail()
|
||||
{
|
||||
MessageBoxResult result = MessageBoxes.ShowMainModelErrorMessageBox(AppResources.MsgBox_ErrorMainModelLoad);
|
||||
this.ProgressBar.Visibility = Visibility.Collapsed;
|
||||
}
|
||||
|
||||
/// <summary>API is ready.</summary>
|
||||
/// <remarks>Stubbfel, 09.09.2013.</remarks>
|
||||
private void ApiIsReady()
|
||||
{
|
||||
this.SetupResultBox();
|
||||
this.ProgressBar.Visibility = Visibility.Collapsed;
|
||||
}
|
||||
|
||||
/// <summary>Sets up the result box.</summary>
|
||||
/// <remarks>Stubbfel, 09.09.2013.</remarks>
|
||||
private void SetupResultBox()
|
||||
{
|
||||
this.api.Model.RemoveNonFunctionAndSetIdsPerson();
|
||||
this.ResultBox.ItemsSource = this.api.Model.Persons;
|
||||
}
|
||||
|
||||
/// <summary>Event handler. Called by Button for click events.</summary>
|
||||
/// <remarks>Stubbfel, 09.09.2013.</remarks>
|
||||
/// <param name="sender">Source of the event.</param>
|
||||
/// <param name="e"> Routed event information.</param>
|
||||
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();
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -174,6 +174,13 @@
|
||||
<TextBlock Name="examinationAppButtonText" Text="{Binding Path=LocalizedResources.ExaminationApp_Title, Source={StaticResource LocalizedStrings}}" Style="{StaticResource StartPageButtonText}"/>
|
||||
</StackPanel>
|
||||
</lui:NavigateButton>
|
||||
|
||||
<lui:NavigateButton Name="personAppButton" Url="{Binding Path=Constants.PathPerson_Person, Source={StaticResource Const}}" Grid.Column="1" Style="{StaticResource StartPageButton}">
|
||||
<StackPanel Style="{StaticResource StartPageStackPanelStyle}">
|
||||
<Image Source="{Binding Path=ThemelizedIcon.Person, Source={StaticResource ThemelizedIcons}}" Style="{StaticResource StartPageButtonImg}"/>
|
||||
<TextBlock Name="personAppButtonText" Text="{Binding Path=LocalizedResources.PersonApp_Title, Source={StaticResource LocalizedStrings}}" Style="{StaticResource StartPageButtonText}"/>
|
||||
</StackPanel>
|
||||
</lui:NavigateButton>
|
||||
</Grid>
|
||||
|
||||
</StackPanel>
|
||||
|
||||
@@ -60,7 +60,7 @@ namespace CampusAppWP8.Pages.StudentCouncil
|
||||
}
|
||||
|
||||
this.ProgressBar.Visibility = System.Windows.Visibility.Visible;
|
||||
this.feed.LoadData(Utilities.getLoadModus<Model.StudentCouncil.StudentCouncilListModel>());
|
||||
this.feed.LoadData(Utilities.GetLoadModus<Model.StudentCouncil.StudentCouncilListModel>());
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
|
||||
@@ -699,6 +699,60 @@ namespace CampusAppWP8.Resources {
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Sucht eine lokalisierte Zeichenfolge, die Einrichtung ähnelt.
|
||||
/// </summary>
|
||||
public static string PersonApp_Appointment {
|
||||
get {
|
||||
return ResourceManager.GetString("PersonApp_Appointment", resourceCulture);
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Sucht eine lokalisierte Zeichenfolge, die Sitz ähnelt.
|
||||
/// </summary>
|
||||
public static string PersonApp_Building {
|
||||
get {
|
||||
return ResourceManager.GetString("PersonApp_Building", resourceCulture);
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Sucht eine lokalisierte Zeichenfolge, die Tätigkeit ähnelt.
|
||||
/// </summary>
|
||||
public static string PersonApp_FunctionName {
|
||||
get {
|
||||
return ResourceManager.GetString("PersonApp_FunctionName", resourceCulture);
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Sucht eine lokalisierte Zeichenfolge, die Personensuche ähnelt.
|
||||
/// </summary>
|
||||
public static string PersonApp_Header {
|
||||
get {
|
||||
return ResourceManager.GetString("PersonApp_Header", resourceCulture);
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Sucht eine lokalisierte Zeichenfolge, die Nachname ähnelt.
|
||||
/// </summary>
|
||||
public static string PersonApp_SearchTextLabel {
|
||||
get {
|
||||
return ResourceManager.GetString("PersonApp_SearchTextLabel", resourceCulture);
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Sucht eine lokalisierte Zeichenfolge, die Personen ähnelt.
|
||||
/// </summary>
|
||||
public static string PersonApp_Title {
|
||||
get {
|
||||
return ResourceManager.GetString("PersonApp_Title", resourceCulture);
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Sucht eine lokalisierte Zeichenfolge, die Die primäre Kamera steht nicht zur Verfügung. ähnelt.
|
||||
/// </summary>
|
||||
|
||||
@@ -425,4 +425,22 @@
|
||||
<data name="ExaminationApp_Header" xml:space="preserve">
|
||||
<value>Prüfungsordnungen</value>
|
||||
</data>
|
||||
<data name="PersonApp_Header" xml:space="preserve">
|
||||
<value>Personensuche</value>
|
||||
</data>
|
||||
<data name="PersonApp_Title" xml:space="preserve">
|
||||
<value>Personen</value>
|
||||
</data>
|
||||
<data name="PersonApp_Appointment" xml:space="preserve">
|
||||
<value>Einrichtung</value>
|
||||
</data>
|
||||
<data name="PersonApp_Building" xml:space="preserve">
|
||||
<value>Sitz</value>
|
||||
</data>
|
||||
<data name="PersonApp_FunctionName" xml:space="preserve">
|
||||
<value>Tätigkeit</value>
|
||||
</data>
|
||||
<data name="PersonApp_SearchTextLabel" xml:space="preserve">
|
||||
<value>Nachname</value>
|
||||
</data>
|
||||
</root>
|
||||
@@ -60,6 +60,51 @@ namespace CampusAppWP8.Resources {
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Sucht eine lokalisierte Zeichenfolge, die Cottbus ähnelt.
|
||||
/// </summary>
|
||||
public static string Addr_CBMainCity {
|
||||
get {
|
||||
return ResourceManager.GetString("Addr_CBMainCity", resourceCulture);
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Sucht eine lokalisierte Zeichenfolge, die BTU ähnelt.
|
||||
/// </summary>
|
||||
public static string Addr_CBMainCompanyName {
|
||||
get {
|
||||
return ResourceManager.GetString("Addr_CBMainCompanyName", resourceCulture);
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Sucht eine lokalisierte Zeichenfolge, die De ähnelt.
|
||||
/// </summary>
|
||||
public static string Addr_CBMainCountry {
|
||||
get {
|
||||
return ResourceManager.GetString("Addr_CBMainCountry", resourceCulture);
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Sucht eine lokalisierte Zeichenfolge, die Brandenburg ähnelt.
|
||||
/// </summary>
|
||||
public static string Addr_CBMainState {
|
||||
get {
|
||||
return ResourceManager.GetString("Addr_CBMainState", resourceCulture);
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Sucht eine lokalisierte Zeichenfolge, die 03046 ähnelt.
|
||||
/// </summary>
|
||||
public static string Addr_CBMainZipCode {
|
||||
get {
|
||||
return ResourceManager.GetString("Addr_CBMainZipCode", resourceCulture);
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Sucht eine lokalisierte Zeichenfolge, die DevMode ähnelt.
|
||||
/// </summary>
|
||||
@@ -132,6 +177,15 @@ namespace CampusAppWP8.Resources {
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Sucht eine lokalisierte Zeichenfolge, die +49 ähnelt.
|
||||
/// </summary>
|
||||
public static string DeTelPrefix {
|
||||
get {
|
||||
return ResourceManager.GetString("DeTelPrefix", resourceCulture);
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Sucht eine lokalisierte Zeichenfolge, die ExamsPage.LastPivotIndex ähnelt.
|
||||
/// </summary>
|
||||
@@ -555,6 +609,15 @@ namespace CampusAppWP8.Resources {
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Sucht eine lokalisierte Zeichenfolge, die Uebersicht ähnelt.
|
||||
/// </summary>
|
||||
public static string ParamPersonList {
|
||||
get {
|
||||
return ResourceManager.GetString("ParamPersonList", resourceCulture);
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Sucht eine lokalisierte Zeichenfolge, die pivotindex ähnelt.
|
||||
/// </summary>
|
||||
@@ -735,6 +798,15 @@ namespace CampusAppWP8.Resources {
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Sucht eine lokalisierte Zeichenfolge, die /Pages/Person/PersonPage.xaml ähnelt.
|
||||
/// </summary>
|
||||
public static string PathPerson_Person {
|
||||
get {
|
||||
return ResourceManager.GetString("PathPerson_Person", resourceCulture);
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Sucht eine lokalisierte Zeichenfolge, die /Pages/Setting/AppSettingPage.xaml ähnelt.
|
||||
/// </summary>
|
||||
@@ -762,6 +834,15 @@ namespace CampusAppWP8.Resources {
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Sucht eine lokalisierte Zeichenfolge, die Uebersicht ähnelt.
|
||||
/// </summary>
|
||||
public static string PersonListValidRootName {
|
||||
get {
|
||||
return ResourceManager.GetString("PersonListValidRootName", resourceCulture);
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Sucht eine lokalisierte Zeichenfolge, die [+-]{0,1}[0-9]+[.,]{0,1}[0-9]+[\s][+-]{0,1}[0-9]+[.,]{0,1}[0-9]+ ähnelt.
|
||||
/// </summary>
|
||||
@@ -834,6 +915,15 @@ namespace CampusAppWP8.Resources {
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Sucht eine lokalisierte Zeichenfolge, die 035569 ähnelt.
|
||||
/// </summary>
|
||||
public static string UniCBTelPrefix {
|
||||
get {
|
||||
return ResourceManager.GetString("UniCBTelPrefix", resourceCulture);
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Sucht eine lokalisierte Zeichenfolge, die http://www.tu-cottbus.de/campusapp-data/professorships.xml ähnelt.
|
||||
/// </summary>
|
||||
@@ -951,6 +1041,15 @@ namespace CampusAppWP8.Resources {
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Sucht eine lokalisierte Zeichenfolge, die https://www.zv.tu-cottbus.de/CMS-Webservice/Person ähnelt.
|
||||
/// </summary>
|
||||
public static string UrlPerson_PersonSearchByName {
|
||||
get {
|
||||
return ResourceManager.GetString("UrlPerson_PersonSearchByName", resourceCulture);
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Sucht eine lokalisierte Zeichenfolge, die http://141.43.76.140/service/sps ähnelt.
|
||||
/// </summary>
|
||||
|
||||
@@ -450,4 +450,37 @@
|
||||
<data name="ExamPageModelKey" xml:space="preserve">
|
||||
<value>ExamsPage.LastPivotIndex</value>
|
||||
</data>
|
||||
<data name="PathPerson_Person" xml:space="preserve">
|
||||
<value>/Pages/Person/PersonPage.xaml</value>
|
||||
</data>
|
||||
<data name="DeTelPrefix" xml:space="preserve">
|
||||
<value>+49</value>
|
||||
</data>
|
||||
<data name="UniCBTelPrefix" xml:space="preserve">
|
||||
<value>035569</value>
|
||||
</data>
|
||||
<data name="PersonListValidRootName" xml:space="preserve">
|
||||
<value>Uebersicht</value>
|
||||
</data>
|
||||
<data name="UrlPerson_PersonSearchByName" xml:space="preserve">
|
||||
<value>https://www.zv.tu-cottbus.de/CMS-Webservice/Person</value>
|
||||
</data>
|
||||
<data name="Addr_CBMainCity" xml:space="preserve">
|
||||
<value>Cottbus</value>
|
||||
</data>
|
||||
<data name="Addr_CBMainCompanyName" xml:space="preserve">
|
||||
<value>BTU</value>
|
||||
</data>
|
||||
<data name="Addr_CBMainCountry" xml:space="preserve">
|
||||
<value>De</value>
|
||||
</data>
|
||||
<data name="Addr_CBMainState" xml:space="preserve">
|
||||
<value>Brandenburg</value>
|
||||
</data>
|
||||
<data name="Addr_CBMainZipCode" xml:space="preserve">
|
||||
<value>03046</value>
|
||||
</data>
|
||||
<data name="ParamPersonList" xml:space="preserve">
|
||||
<value>Uebersicht</value>
|
||||
</data>
|
||||
</root>
|
||||
@@ -242,6 +242,17 @@ namespace CampusAppWP8.Resources
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Gets the uri string of the Person icon.
|
||||
/// </summary>
|
||||
public static string Person
|
||||
{
|
||||
get
|
||||
{
|
||||
return Themerize("person_159.png");
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Gets the uri string of the Phone icon.
|
||||
/// </summary>
|
||||
|
||||
@@ -177,6 +177,9 @@
|
||||
<data name="Openhours" xml:space="preserve">
|
||||
<value>openhours_159.png</value>
|
||||
</data>
|
||||
<data name="Person" xml:space="preserve">
|
||||
<value>person_159.png</value>
|
||||
</data>
|
||||
<data name="Phone" xml:space="preserve">
|
||||
<value>phone_159.png</value>
|
||||
</data>
|
||||
|
||||
@@ -1,6 +1,7 @@
|
||||
<StyleCopSettings Version="105">
|
||||
<GlobalSettings>
|
||||
<CollectionProperty Name="RecognizedWords">
|
||||
<Value>api</Value>
|
||||
<Value>enum</Value>
|
||||
<Value>Stubbfel</Value>
|
||||
</CollectionProperty>
|
||||
|
||||
@@ -0,0 +1,43 @@
|
||||
using CampusAppWP8.Resources;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
using System.Windows;
|
||||
using System.Windows.Controls;
|
||||
using System.Windows.Media.Imaging;
|
||||
|
||||
namespace CampusAppWP8.Utility.Lui.Button
|
||||
{
|
||||
public class AddPersonButton : System.Windows.Controls.Button
|
||||
{
|
||||
private static BitmapImage icon = new BitmapImage(new Uri(Icons.Add, UriKind.Relative));
|
||||
|
||||
public AddPersonButton()
|
||||
: base()
|
||||
{
|
||||
this.Content = new Image
|
||||
{
|
||||
Source = icon
|
||||
};
|
||||
}
|
||||
|
||||
public static readonly DependencyProperty PersonIdProperty = DependencyProperty.Register("PersonID", typeof(object), typeof(AddPersonButton), new PropertyMetadata(false));
|
||||
|
||||
|
||||
public static readonly DependencyProperty FunctionIndexProperty = DependencyProperty.Register("FunctionIndex", typeof(object), typeof(AddPersonButton), new PropertyMetadata(false));
|
||||
|
||||
public object PersonId
|
||||
{
|
||||
get { return (object)this.GetValue(PersonIdProperty); }
|
||||
set { this.SetValue(PersonIdProperty, value); }
|
||||
}
|
||||
|
||||
public object FunctionIndex
|
||||
{
|
||||
get { return (object)this.GetValue(FunctionIndexProperty); }
|
||||
set { this.SetValue(FunctionIndexProperty, value); }
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -7,6 +7,8 @@
|
||||
//----------------------------------------------------------------------
|
||||
namespace CampusAppWP8.Utility
|
||||
{
|
||||
using CampusAppWP8.Resources;
|
||||
using System;
|
||||
using System.Text.RegularExpressions;
|
||||
|
||||
/// <summary>
|
||||
@@ -55,6 +57,48 @@ namespace CampusAppWP8.Utility
|
||||
{
|
||||
return str.TrimEnd('\n');
|
||||
}
|
||||
|
||||
/// <summary>Query if 'strIn' is valid email.</summary>
|
||||
/// <remarks>Stubbfel, 04.09.2013.</remarks>
|
||||
/// <param name="strIn">The in.</param>
|
||||
/// <returns>true if valid email, false if not.</returns>
|
||||
public static bool IsValidEmail(string strIn)
|
||||
{
|
||||
// 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);
|
||||
}
|
||||
catch (Exception)
|
||||
{
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>Creates uni telefon number.</summary>
|
||||
/// <remarks>Stubbfel, 04.09.2013.</remarks>
|
||||
/// <param name="input">The input.</param>
|
||||
/// <returns>The new uni telefon number.</returns>
|
||||
public static string CreateUniTelefonNumber(string input)
|
||||
{
|
||||
string result = null;
|
||||
if (input.Length < 5)
|
||||
{
|
||||
result = Constants.UniCBTelPrefix + input.TrimStart('0');
|
||||
}
|
||||
else
|
||||
{
|
||||
result = input;
|
||||
}
|
||||
|
||||
Regex regexObj = new Regex(@"[^\d]");
|
||||
result = regexObj.Replace(result.TrimStart('0'), "");
|
||||
result = Constants.DeTelPrefix + result;
|
||||
return result;
|
||||
}
|
||||
#endregion
|
||||
}
|
||||
}
|
||||
|
||||
@@ -302,12 +302,13 @@ namespace CampusAppWP8.Utility
|
||||
return true;
|
||||
}
|
||||
}
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
/// <summary>Queries if a wifik is available.</summary>
|
||||
/// <summary>Queries if a wifi is available.</summary>
|
||||
/// <remarks>Stubbfel, 26.08.2013.</remarks>
|
||||
/// <returns>true if a wifik is available, false if not.</returns>
|
||||
/// <returns>true if a wifi is available, false if not.</returns>
|
||||
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
|
||||
/// <remarks>Stubbfel, 27.08.2013.</remarks>
|
||||
/// <typeparam name="T">Generic type parameter.</typeparam>
|
||||
/// <returns>The load modus< t></returns>
|
||||
public static MainModel<T>.ForceType getLoadModus<T>()
|
||||
public static MainModel<T>.ForceType GetLoadModus<T>()
|
||||
{
|
||||
if (Settings.AppSetting.OnlyWifi && !Settings.AppSetting.WifiEnable)
|
||||
{
|
||||
|
||||
@@ -33,6 +33,12 @@
|
||||
<WarningLevel>4</WarningLevel>
|
||||
</PropertyGroup>
|
||||
<ItemGroup>
|
||||
<Compile Include="Model\Campusmap\CBMainMapModel.cs" />
|
||||
<Compile Include="Model\Campusmap\MapModel.cs" />
|
||||
<Compile Include="Model\GeoDb\PlaceInformation.cs" />
|
||||
<Compile Include="Model\GeoDb\PlaceModel.cs" />
|
||||
<Compile Include="Model\GeoDb\PlaceService.cs" />
|
||||
<Compile Include="Model\GeoDb\SpsModel.cs" />
|
||||
<Compile Include="Properties\AssemblyInfo.cs" />
|
||||
<Compile Include="Utility\Logger.cs" />
|
||||
<Compile Include="Utility\NDEF\NDEFMessage.cs" />
|
||||
|
||||
@@ -0,0 +1,45 @@
|
||||
//-----------------------------------------------------------------------------
|
||||
// <copyright file="CBMainMapModel.cs" company="BTU/IIT">
|
||||
// Company copyright tag.
|
||||
// </copyright>
|
||||
// <author>fiedlchr</author>
|
||||
// <sience>13.08.2013</sience>
|
||||
//-----------------------------------------------------------------------------
|
||||
using CampusAppWPortalLib8.Model.GeoDb;
|
||||
using CampusAppWPortalLib8.Utility;
|
||||
|
||||
namespace CampusAppWPortalLib8.Model.Campusmap
|
||||
{
|
||||
|
||||
/// <summary>
|
||||
/// Class for the MapModel of the mainCampus of cottbus
|
||||
/// </summary>
|
||||
public class CBMainMapModel : MapModel
|
||||
{
|
||||
/// <summary>Variable for the identify of the campus.</summary>
|
||||
private static readonly string Campus = "1";
|
||||
|
||||
/// <summary>
|
||||
/// Initializes a new instance of the <see cref="CBMainMapModel" /> class.
|
||||
/// </summary>
|
||||
public CBMainMapModel(string xmlFilePath) : base(xmlFilePath)
|
||||
{
|
||||
}
|
||||
|
||||
/// <summary>Loads the spatial./.</summary>
|
||||
/// <remarks>Stubbfel, 19.08.2013.</remarks>
|
||||
protected override void LoadSpatials(string xmlFilePath)
|
||||
{
|
||||
SpsModel model = XmlManager.DeserializationFileToModel<SpsModel>(xmlFilePath);
|
||||
|
||||
this.Spatial = new SpsModel();
|
||||
foreach (PlaceModel place in model.Places)
|
||||
{
|
||||
if (Campus.Equals(place.ParentId) || Campus.Equals(place.PlaceId))
|
||||
{
|
||||
this.Spatial.Places.Add(place);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,48 @@
|
||||
//-----------------------------------------------------------------------
|
||||
// <copyright file="MapModel.cs" company="BTU/IIT">
|
||||
// Company copyright tag.
|
||||
// </copyright>
|
||||
// <author>stubbfel</author>
|
||||
// <sience>24.06.2013</sience>
|
||||
//----------------------------------------------------------------------
|
||||
namespace CampusAppWPortalLib8.Model.Campusmap
|
||||
{
|
||||
using CampusAppWPortalLib8.Model.GeoDb;
|
||||
using System;
|
||||
|
||||
/// <summary>
|
||||
/// This Class manage the properties of a Map
|
||||
/// </summary>
|
||||
public class MapModel
|
||||
{
|
||||
#region Constructors
|
||||
|
||||
/// <summary>
|
||||
/// Initializes a new instance of the <see cref="MapModel" /> class.
|
||||
/// </summary>
|
||||
public MapModel(string xmlFilePath)
|
||||
{
|
||||
this.LoadSpatials(xmlFilePath);
|
||||
}
|
||||
|
||||
#endregion
|
||||
|
||||
#region Property
|
||||
|
||||
/// <summary>Gets or sets the spatial of the map.</summary>
|
||||
/// <value>The spatial.</value>
|
||||
public SpsModel Spatial { get; set; }
|
||||
|
||||
#endregion
|
||||
|
||||
#region Methods
|
||||
|
||||
/// <summary>Loads the spatial./</summary>
|
||||
/// <remarks>Stubbfel, 19.08.2013.</remarks>
|
||||
protected virtual void LoadSpatials(string xmlFilePath)
|
||||
{
|
||||
}
|
||||
|
||||
#endregion
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,26 @@
|
||||
//-----------------------------------------------------------------------
|
||||
// <copyright file="PlaceInformation.cs" company="BTU/IIT">
|
||||
// Company copyright tag.
|
||||
// </copyright>
|
||||
// <author>stubbfel</author>
|
||||
// <sience>19.08.2013</sience>
|
||||
//----------------------------------------------------------------------
|
||||
namespace CampusAppWPortalLib8.Model.GeoDb
|
||||
{
|
||||
using System.Xml.Serialization;
|
||||
|
||||
/// <summary>Information about the place.</summary>
|
||||
/// <remarks>Stubbfel, 19.08.2013.</remarks>
|
||||
public class PlaceInformation
|
||||
{
|
||||
/// <summary>Gets or sets the name of the information.</summary>
|
||||
/// <value>The name of the information.</value>
|
||||
[XmlElement("placeInformationName")]
|
||||
public string InformationName { get; set; }
|
||||
|
||||
/// <summary>Gets or sets the information value.</summary>
|
||||
/// <value>The information value.</value>
|
||||
[XmlText]
|
||||
public string InformationValue { get; set; }
|
||||
}
|
||||
}
|
||||
47
CampusAppWP8/CampusAppWPortalLib8/Model/GeoDb/PlaceModel.cs
Normal file
47
CampusAppWP8/CampusAppWPortalLib8/Model/GeoDb/PlaceModel.cs
Normal file
@@ -0,0 +1,47 @@
|
||||
//-----------------------------------------------------------------------
|
||||
// <copyright file="PlaceModel.cs" company="BTU/IIT">
|
||||
// Company copyright tag.
|
||||
// </copyright>
|
||||
// <author>stubbfel</author>
|
||||
// <sience>08.08.2013</sience>
|
||||
//----------------------------------------------------------------------
|
||||
|
||||
namespace CampusAppWPortalLib8.Model.GeoDb
|
||||
{
|
||||
using System.Collections.ObjectModel;
|
||||
using System.Xml.Serialization;
|
||||
|
||||
/// <summary>
|
||||
/// Model for a place of the SPSService
|
||||
/// </summary>
|
||||
public class PlaceModel
|
||||
{
|
||||
/// <summary>
|
||||
/// Gets or sets the placeId
|
||||
/// </summary>
|
||||
[XmlAttribute("id")]
|
||||
public string PlaceId { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// Gets or sets the id of the "parent" of a place
|
||||
/// </summary>
|
||||
[XmlAttribute("parentId")]
|
||||
public string ParentId { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// Gets or sets the ReferencePoint of a place
|
||||
/// </summary>
|
||||
[XmlAttribute("refpoint")]
|
||||
public string RefPoint { get; set; }
|
||||
|
||||
/// <summary>Gets or sets the information.</summary>
|
||||
/// <value>The information.</value>
|
||||
[XmlElement("placeInformation")]
|
||||
public ObservableCollection<PlaceInformation> Informations { get; set; }
|
||||
|
||||
/// <summary>Gets or sets the services.</summary>
|
||||
/// <value>The services.</value>
|
||||
[XmlElement("placeService")]
|
||||
public ObservableCollection<PlaceService> Services { get; set; }
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,32 @@
|
||||
//-----------------------------------------------------------------------------
|
||||
// <copyright file="PlaceService.cs" company="BTU/IIT">
|
||||
// Company copyright tag.
|
||||
// </copyright>
|
||||
// <author>stubbfel</author>
|
||||
// <sience>19.08.2013</sience>
|
||||
//-----------------------------------------------------------------------------
|
||||
|
||||
namespace CampusAppWPortalLib8.Model.GeoDb
|
||||
{
|
||||
using System.Xml.Serialization;
|
||||
|
||||
/// <summary>Place service.</summary>
|
||||
/// <remarks>Stubbfel, 19.08.2013.</remarks>
|
||||
public class PlaceService
|
||||
{
|
||||
/// <summary>Gets or sets the name of the service.</summary>
|
||||
/// <value>The name of the service.</value>
|
||||
[XmlAttribute("placeServiceName")]
|
||||
public string ServiceName { get; set; }
|
||||
|
||||
/// <summary>Gets or sets the SAP of an service.</summary>
|
||||
/// <value>The sap.</value>
|
||||
[XmlElement("sap")]
|
||||
public string SAP { get; set; }
|
||||
|
||||
/// <summary>Gets or sets the request for a place.</summary>
|
||||
/// <value>The request.</value>
|
||||
[XmlElement("request")]
|
||||
public string Request { get; set; }
|
||||
}
|
||||
}
|
||||
87
CampusAppWP8/CampusAppWPortalLib8/Model/GeoDb/SpsModel.cs
Normal file
87
CampusAppWP8/CampusAppWPortalLib8/Model/GeoDb/SpsModel.cs
Normal file
@@ -0,0 +1,87 @@
|
||||
//-----------------------------------------------------------------------
|
||||
// <copyright file="SpsModel.cs" company="BTU/IIT">
|
||||
// Company copyright tag.
|
||||
// </copyright>
|
||||
// <author>stubbfel</author>
|
||||
// <sience>08.08.2013</sience>
|
||||
//----------------------------------------------------------------------
|
||||
|
||||
namespace CampusAppWPortalLib8.Model.GeoDb
|
||||
{
|
||||
using System.Collections.Generic;
|
||||
using System.Collections.ObjectModel;
|
||||
using System.Linq;
|
||||
using System.Xml.Serialization;
|
||||
|
||||
/// <summary>
|
||||
/// Model for a xml-response of the SPSService
|
||||
/// </summary>
|
||||
[XmlRoot("root")]
|
||||
public class SpsModel
|
||||
{
|
||||
/// <summary>Initializes a new instance of the SpsModel class.</summary>
|
||||
/// <remarks>Stubbfel, 20.08.2013.</remarks>
|
||||
public SpsModel()
|
||||
{
|
||||
this.Places = new ObservableCollection<PlaceModel>();
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Gets or sets a list of places
|
||||
/// </summary>
|
||||
[XmlElement("place")]
|
||||
public ObservableCollection<PlaceModel> Places { get; set; }
|
||||
|
||||
/// <summary>Gets places by information.</summary>
|
||||
/// <remarks>Stubbfel, 19.08.2013.</remarks>
|
||||
/// <param name="query"> The query.</param>
|
||||
/// <param name="ignoreCases"> (Optional) the ignore cases.</param>
|
||||
/// <param name="informationName">(Optional) name of the information.</param>
|
||||
/// <returns>The places by information.</returns>
|
||||
public List<PlaceModel> GetPlacesByInformation(string query, bool ignoreCases = true, string informationName = null)
|
||||
{
|
||||
string querryLow = string.Empty;
|
||||
IEnumerable<PlaceModel> resultplaces = null;
|
||||
|
||||
// select correct statement
|
||||
if (ignoreCases && informationName == null)
|
||||
{
|
||||
querryLow = query.ToLower();
|
||||
resultplaces = from place in this.Places
|
||||
from info in place.Informations
|
||||
where info.InformationValue.ToLower().Contains(querryLow)
|
||||
select place;
|
||||
}
|
||||
else if (ignoreCases && informationName != null)
|
||||
{
|
||||
querryLow = query.ToLower();
|
||||
resultplaces = from place in this.Places
|
||||
from info in place.Informations
|
||||
where info.InformationValue.ToLower().Contains(querryLow) && info.InformationName.Equals(informationName)
|
||||
select place;
|
||||
}
|
||||
else if (!ignoreCases && informationName == null)
|
||||
{
|
||||
resultplaces = from place in this.Places
|
||||
from info in place.Informations
|
||||
where info.InformationValue.Contains(querryLow)
|
||||
select place;
|
||||
}
|
||||
else if (!ignoreCases && informationName != null)
|
||||
{
|
||||
resultplaces = from place in this.Places
|
||||
from info in place.Informations
|
||||
where info.InformationValue.Contains(querryLow) && info.InformationName.Equals(informationName)
|
||||
select place;
|
||||
}
|
||||
|
||||
// null assert
|
||||
if (resultplaces == null)
|
||||
{
|
||||
return null;
|
||||
}
|
||||
|
||||
return resultplaces.ToList<PlaceModel>();
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user