refactor utility
This commit is contained in:
@@ -1,28 +1,25 @@
|
||||
//-----------------------------------------------------------------------
|
||||
// <copyright file="AppUriMapper.cs" company="BTU/IIT">
|
||||
// Company copyright tag.
|
||||
// The MIT License (MIT). Copyright (c) 2013 BTU/IIT.
|
||||
// </copyright>
|
||||
// <author>stubbfel</author>
|
||||
// <sience>26.09.2013</sience>
|
||||
//----------------------------------------------------------------------
|
||||
|
||||
// <author>Stubbfel</author>
|
||||
// <date>15.10.2013</date>
|
||||
// <summary>Implements the application URI mapper class</summary>
|
||||
//-----------------------------------------------------------------------
|
||||
namespace CampusAppWP8.Utility
|
||||
{
|
||||
using System;
|
||||
using System.Windows.Navigation;
|
||||
using CampusAppWP8.Resources;
|
||||
using System.Windows.Controls;
|
||||
|
||||
/// <summary>
|
||||
/// Class map Uri to AppPages
|
||||
/// </summary>
|
||||
|
||||
/// <summary> Class map Uri to AppPages. </summary>
|
||||
/// <remarks> Stubbfel, 15.10.2013. </remarks>
|
||||
/// <seealso cref="T:System.Windows.Navigation.UriMapperBase"/>
|
||||
public class AppUriMapper : UriMapperBase
|
||||
{
|
||||
/// <summary>
|
||||
/// Method overrides MapUri from UriMapperBase
|
||||
/// </summary>
|
||||
/// <param name="uri">the url</param>
|
||||
/// <returns>the mapped url</returns>
|
||||
/// <summary> Method overrides MapUri from UriMapperBase. </summary>
|
||||
/// <remarks> Stubbfel, 15.10.2013. </remarks>
|
||||
/// <seealso cref="M:System.Windows.Navigation.UriMapperBase.MapUri(Uri)"/>
|
||||
public override Uri MapUri(Uri uri)
|
||||
{
|
||||
string tempUri = uri.ToString();
|
||||
|
||||
@@ -1,11 +1,11 @@
|
||||
//-----------------------------------------------------------------------
|
||||
// <copyright file="BackgroundTasks.cs" company="BTU/IIT">
|
||||
// Company copyright tag.
|
||||
// The MIT License (MIT). Copyright (c) 2013 BTU/IIT.
|
||||
// </copyright>
|
||||
// <author>stubbfel</author>
|
||||
// <sience>18.09.2013</sience>
|
||||
//----------------------------------------------------------------------
|
||||
|
||||
// <author>Stubbfel</author>
|
||||
// <date>15.10.2013</date>
|
||||
// <summary>Implements the background tasks class</summary>
|
||||
//-----------------------------------------------------------------------
|
||||
namespace CampusAppWP8.Utility
|
||||
{
|
||||
using System;
|
||||
@@ -13,16 +13,15 @@ namespace CampusAppWP8.Utility
|
||||
using CampusAppWPortalLib8.Utility;
|
||||
using Microsoft.Phone.Scheduler;
|
||||
|
||||
/// <summary>
|
||||
/// Class provide some static methods for background tasks
|
||||
/// </summary>
|
||||
/// <summary> Class provide some static methods for background tasks. </summary>
|
||||
/// <remarks> Stubbfel, 15.10.2013. </remarks>
|
||||
/// <seealso cref="T:CampusAppWPortalLib8.Utility.AbstractBackgroundTasks"/>
|
||||
public class BackgroundTasks : AbstractBackgroundTasks
|
||||
{
|
||||
/// <summary>
|
||||
/// Method start a certain PerodicTask
|
||||
/// </summary>
|
||||
/// <param name="taskName">name of the task</param>
|
||||
/// <param name="taskDesc">description of the task</param>
|
||||
/// <summary> Method start a certain PerodicTask. </summary>
|
||||
/// <remarks> Stubbfel, 15.10.2013. </remarks>
|
||||
/// <param name="taskName"> name of the task. </param>
|
||||
/// <param name="taskDesc"> description of the task. </param>
|
||||
public static void StartPerodicTask(string taskName, string taskDesc)
|
||||
{
|
||||
BackgroundTasks.StopPerodicTask(BackgroundTasks.LastAddedTaskName);
|
||||
@@ -48,10 +47,9 @@ namespace CampusAppWP8.Utility
|
||||
BackgroundTasks.LastAddedTaskName = taskName;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Method stop a certain PerodicTask
|
||||
/// </summary>
|
||||
/// <param name="taskName">name of the task</param>
|
||||
/// <summary> Method stop a certain PerodicTask. </summary>
|
||||
/// <remarks> Stubbfel, 15.10.2013. </remarks>
|
||||
/// <param name="taskName"> name of the task. </param>
|
||||
public static void StopPerodicTask(string taskName)
|
||||
{
|
||||
if (taskName == null)
|
||||
@@ -73,22 +71,19 @@ namespace CampusAppWP8.Utility
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Method start BTUCampusAppBackgroundTask
|
||||
/// </summary>
|
||||
/// <summary> Method start BTUCampusAppBackgroundTask. </summary>
|
||||
/// <remarks> Stubbfel, 15.10.2013. </remarks>
|
||||
public static void StartBTUCampusAppTask()
|
||||
{
|
||||
int campusId = (int)Settings.UserProfil.DefaultCampus;
|
||||
BackgroundTasks.StartPerodicTask(Constants.BackgroundTask_BTUCampusApp, AppResources.BackGroundTaskDesc_BTUCampusApp + " - Feed " + campusId);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Method stop BTUCampusAppBackgroundTask
|
||||
/// </summary>
|
||||
/// <summary> Method stop BTUCampusAppBackgroundTask. </summary>
|
||||
/// <remarks> Stubbfel, 15.10.2013. </remarks>
|
||||
public static void StopBTUCampusAppTask()
|
||||
{
|
||||
BackgroundTasks.StopPerodicTask(Constants.BackgroundTask_BTUCampusApp);
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,23 +1,38 @@
|
||||
//-----------------------------------------------------------------------------
|
||||
//-----------------------------------------------------------------------
|
||||
// <copyright file="BoolToVisibilityConverter.cs" company="BTU/IIT">
|
||||
// Company copyright tag.
|
||||
// The MIT License (MIT). Copyright (c) 2013 BTU/IIT.
|
||||
// </copyright>
|
||||
// <author>fiedlchr</author>
|
||||
// <sience>10.10.2013</sience>
|
||||
//-----------------------------------------------------------------------------
|
||||
// <date>15.10.2013</date>
|
||||
// <summary>Implements to visibility converter class</summary>
|
||||
//-----------------------------------------------------------------------
|
||||
namespace CampusAppWP8.Utility
|
||||
{
|
||||
using System;
|
||||
using System.Windows;
|
||||
using System.Windows.Data;
|
||||
|
||||
/// <summary> to visibility converter. </summary>
|
||||
/// <remarks> fiedlchr, 15.10.2013. </remarks>
|
||||
/// <seealso cref="T:System.Windows.Data.IValueConverter"/>
|
||||
public sealed class BoolToVisibilityConverter : IValueConverter
|
||||
{
|
||||
/// <summary>
|
||||
/// Ändert die Quelldaten vor der Übergabe an das Ziel zur Anzeige in der Benutzeroberfläche.
|
||||
/// </summary>
|
||||
/// <remarks> fiedlchr, 15.10.2013. </remarks>
|
||||
/// <seealso cref="M:System.Windows.Data.IValueConverter.Convert(object,Type,object,System.Globalization.CultureInfo)"/>
|
||||
public object Convert(object value, Type targetType, object parameter, System.Globalization.CultureInfo language)
|
||||
{
|
||||
return (value is bool && (bool)value) ? Visibility.Visible : Visibility.Collapsed;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Ändert die Zieldaten vor der Übergabe an das Quellobjekt. Diese Methode wird nur in
|
||||
/// <see cref="F:System.Windows.Data.BindingMode.TwoWay" />-Bindungen aufgerufen.
|
||||
/// </summary>
|
||||
/// <remarks> fiedlchr, 15.10.2013. </remarks>
|
||||
/// <seealso cref="M:System.Windows.Data.IValueConverter.ConvertBack(object,Type,object,System.Globalization.CultureInfo)"/>
|
||||
public object ConvertBack(object value, Type targetType, object parameter, System.Globalization.CultureInfo language)
|
||||
{
|
||||
return (value is Visibility && (Visibility)value == Visibility.Visible);
|
||||
|
||||
@@ -1,10 +1,11 @@
|
||||
//-----------------------------------------------------------------------------
|
||||
//-----------------------------------------------------------------------
|
||||
// <copyright file="File.cs" company="BTU/IIT">
|
||||
// Company copyright tag.
|
||||
// The MIT License (MIT). Copyright (c) 2013 BTU/IIT.
|
||||
// </copyright>
|
||||
// <author>fiedlchr</author>
|
||||
// <sience>03.05.2013</sience>
|
||||
//-----------------------------------------------------------------------------
|
||||
// <date>15.10.2013</date>
|
||||
// <summary>Implements the file class</summary>
|
||||
//-----------------------------------------------------------------------
|
||||
namespace CampusAppWP8.Utility
|
||||
{
|
||||
using System;
|
||||
@@ -14,30 +15,26 @@ namespace CampusAppWP8.Utility
|
||||
using CampusAppWPortalLib8.Utility;
|
||||
using Windows.Storage;
|
||||
|
||||
/// <summary>
|
||||
/// File class.
|
||||
/// </summary>
|
||||
/// <summary> File class. </summary>
|
||||
/// <remarks> fiedlchr, 15.10.2013. </remarks>
|
||||
/// <seealso cref="T:CampusAppWPortalLib8.Utility.AbstractFile"/>
|
||||
public class File : AbstractFile
|
||||
{
|
||||
#region Member
|
||||
|
||||
/// <summary>
|
||||
/// Folder object.
|
||||
/// </summary>
|
||||
/// <summary> Folder object. </summary>
|
||||
private static readonly IStorageFolder LocalFolder = ApplicationData.Current.LocalFolder;
|
||||
|
||||
/// <summary>
|
||||
/// File name.
|
||||
/// </summary>
|
||||
/// <summary> File name. </summary>
|
||||
private string filename = string.Empty;
|
||||
|
||||
#endregion
|
||||
|
||||
#region Constructor
|
||||
|
||||
/// <summary>Initializes a new instance of the <see cref="File" /> class.</summary>
|
||||
/// <remarks>Stubbfel, 03.09.2013.</remarks>
|
||||
/// <param name="filename"> file name.</param>
|
||||
/// <summary> Initializes a new instance of the <see cref="File" /> class. </summary>
|
||||
/// <remarks> fiedlchr, 03.09.2013. </remarks>
|
||||
/// <param name="filename"> file name. </param>
|
||||
public File(string filename)
|
||||
{
|
||||
this.filename = filename;
|
||||
@@ -49,9 +46,9 @@ namespace CampusAppWP8.Utility
|
||||
|
||||
#region public
|
||||
|
||||
/// <summary>Read data from file to a string.</summary>
|
||||
/// <remarks>Stubbfel, 03.09.2013.</remarks>
|
||||
/// <returns>data string.</returns>
|
||||
/// <summary> Read data from file to a string. </summary>
|
||||
/// <remarks> fiedlchr, 03.09.2013. </remarks>
|
||||
/// <seealso cref="M:CampusAppWPortalLib8.Utility.AbstractFile.ReadFile()"/>
|
||||
public override byte[] ReadFile()
|
||||
{
|
||||
byte[] retValue = null;
|
||||
@@ -64,31 +61,27 @@ namespace CampusAppWP8.Utility
|
||||
return retValue;
|
||||
}
|
||||
|
||||
/// <summary>Write bytes to the file.</summary>
|
||||
/// <remarks>Stubbfel, 03.09.2013.</remarks>
|
||||
/// <param name="data"> data byte array.</param>
|
||||
/// <param name="onSavedCallback"> callback function, called after writing is done.</param>
|
||||
/// <param name="onFailedCallback">callback function, called when writing failed.</param>
|
||||
/// <summary> Write bytes to the file. </summary>
|
||||
/// <remarks> fiedlchr, 03.09.2013. </remarks>
|
||||
/// <seealso cref="M:CampusAppWPortalLib8.Utility.AbstractFile.WriteFile(byte[],WriteCallbackFunc,WriteCallbackFunc)"/>
|
||||
public override void WriteFile(byte[] data, WriteCallbackFunc onSavedCallback, WriteCallbackFunc onFailedCallback)
|
||||
{
|
||||
Thread th = new Thread(delegate() { this.WriteAsync(data, onSavedCallback, onFailedCallback); });
|
||||
th.Start();
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Return a info object of the file.
|
||||
/// </summary>
|
||||
/// <returns>info of the file</returns>
|
||||
/// <summary> Return a info object of the file. </summary>
|
||||
/// <remarks> fiedlchr, 15.10.2013. </remarks>
|
||||
/// <returns> info of the file. </returns>
|
||||
public FileInfo GetFileInfo()
|
||||
{
|
||||
FileInfo info = new FileInfo(File.LocalFolder.Path + "\\" + this.filename);
|
||||
return info;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Check if a file is existing.
|
||||
/// </summary>
|
||||
/// <returns>true, if file exists, otherwise false</returns>
|
||||
/// <summary> Check if a file is existing. </summary>
|
||||
/// <remarks> fiedlchr, 15.10.2013. </remarks>
|
||||
/// <seealso cref="M:CampusAppWPortalLib8.Utility.AbstractFile.Exist()"/>
|
||||
public override bool Exist()
|
||||
{
|
||||
FileInfo info = this.GetFileInfo();
|
||||
@@ -102,9 +95,9 @@ namespace CampusAppWP8.Utility
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>Converts this object to a storage file.</summary>
|
||||
/// <remarks>Stubbfel, 03.09.2013.</remarks>
|
||||
/// <returns>Storage File</returns>
|
||||
/// <summary> Converts this object to a storage file. </summary>
|
||||
/// <remarks> fiedlchr, 03.09.2013. </remarks>
|
||||
/// <returns> Storage File. </returns>
|
||||
public async Task<StorageFile> AsStorageFile()
|
||||
{
|
||||
if (this.Exist())
|
||||
@@ -119,10 +112,9 @@ namespace CampusAppWP8.Utility
|
||||
|
||||
#region private
|
||||
|
||||
/// <summary>
|
||||
/// Read data synchronous from file.
|
||||
/// </summary>
|
||||
/// <returns>data string</returns>
|
||||
/// <summary> Read data synchronous from file. </summary>
|
||||
/// <remarks> fiedlchr, 15.10.2013. </remarks>
|
||||
/// <returns> data string. </returns>
|
||||
private byte[] ReadSync()
|
||||
{
|
||||
byte[] retValue = null;
|
||||
@@ -139,12 +131,11 @@ namespace CampusAppWP8.Utility
|
||||
return retValue;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Write data asynchronous to file.
|
||||
/// </summary>
|
||||
/// <param name="data">data array.</param>
|
||||
/// <param name="onSavedCallback">callback function, called when writing is done.</param>
|
||||
/// <param name="onFailedCallback">callback function, called when writing failed.</param>
|
||||
/// <summary> Write data asynchronous to file. </summary>
|
||||
/// <remarks> fiedlchr, 15.10.2013. </remarks>
|
||||
/// <param name="data"> data array. </param>
|
||||
/// <param name="onSavedCallback"> callback function, called when writing is done. </param>
|
||||
/// <param name="onFailedCallback"> callback function, called when writing failed. </param>
|
||||
private async void WriteAsync(byte[] data, WriteCallbackFunc onSavedCallback, WriteCallbackFunc onFailedCallback)
|
||||
{
|
||||
Logger.LogMsg("writeasync file: " + this.filename);
|
||||
|
||||
@@ -1,37 +1,33 @@
|
||||
//-----------------------------------------------------------------------
|
||||
// <copyright file="HttpRequest.cs" company="BTU/IIT">
|
||||
// Company copyright tag.
|
||||
// The MIT License (MIT). Copyright (c) 2013 BTU/IIT.
|
||||
// </copyright>
|
||||
// <author>stubbfel</author>
|
||||
// <sience>10.06.2013</sience>
|
||||
//----------------------------------------------------------------------using System;
|
||||
// <author>Stubbfel</author>
|
||||
// <date>15.10.2013</date>
|
||||
// <summary>Implements the HTTP request class</summary>
|
||||
//-----------------------------------------------------------------------
|
||||
namespace CampusAppWP8.Utility
|
||||
{
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Net;
|
||||
using CampusAppWP8.Model.Utility;
|
||||
using CampusAppWPortalLib8.Model.Utility;
|
||||
using CampusAppWPortalLib8.Utility;
|
||||
|
||||
/// <summary>
|
||||
/// Class realize the access of restful HttpRequest
|
||||
/// </summary>
|
||||
/// <summary> Class realize the access of restful HttpRequest. </summary>
|
||||
/// <remarks> Stubbfel, 15.10.2013. </remarks>
|
||||
/// <seealso cref="T:CampusAppWPortalLib8.Utility.AbstractHttpRequest"/>
|
||||
public class HttpRequest : AbstractHttpRequest
|
||||
{
|
||||
#region Constructor
|
||||
|
||||
/// <summary>
|
||||
/// Initializes a new instance of the <see cref="HttpRequest" /> class.
|
||||
/// </summary>
|
||||
/// <summary> Initializes a new instance of the <see cref="HttpRequest" /> class. </summary>
|
||||
/// <remarks> Stubbfel, 15.10.2013. </remarks>
|
||||
public HttpRequest()
|
||||
{
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Initializes a new instance of the <see cref="HttpRequest" /> class.
|
||||
/// </summary>
|
||||
/// <param name="apiBaseAddress">the url of the HttpRequest base address</param>
|
||||
/// <summary> Initializes a new instance of the <see cref="HttpRequest" /> class. </summary>
|
||||
/// <remarks> Stubbfel, 15.10.2013. </remarks>
|
||||
/// <param name="apiBaseAddress"> the url of the HttpRequest base address. </param>
|
||||
public HttpRequest(Uri apiBaseAddress)
|
||||
{
|
||||
this.BaseAddress = apiBaseAddress.AbsoluteUri;
|
||||
@@ -42,11 +38,10 @@ namespace CampusAppWP8.Utility
|
||||
#region Methods
|
||||
#region public
|
||||
|
||||
/// <summary>
|
||||
/// Method realize the http-get-method resource
|
||||
/// </summary>
|
||||
/// <param name="url">Url of the resource</param>
|
||||
/// <param name="action">callback method</param>
|
||||
/// <summary> Method realize the http-get-method resource. </summary>
|
||||
/// <remarks> Stubbfel, 15.10.2013. </remarks>
|
||||
/// <param name="url"> Url of the resource. </param>
|
||||
/// <param name="action"> callback method. </param>
|
||||
public void HttpGet(Uri url, Action<object, DownloadStringCompletedEventArgs> action)
|
||||
{
|
||||
WebClient client = new WebClient();
|
||||
@@ -54,10 +49,10 @@ namespace CampusAppWP8.Utility
|
||||
client.DownloadStringAsync(url);
|
||||
}
|
||||
|
||||
/// <summary>Method realize the http-get-method resource.</summary>
|
||||
/// <remarks>Stubbfel, 03.09.2013.</remarks>
|
||||
/// <param name="url"> Url of the resource.</param>
|
||||
/// <param name="action">The action.</param>
|
||||
/// <summary> Method realize the http-get-method resource. </summary>
|
||||
/// <remarks> Stubbfel, 03.09.2013. </remarks>
|
||||
/// <param name="url"> Url of the resource. </param>
|
||||
/// <param name="action"> The action. </param>
|
||||
public void HttpGet(Uri url, Action<object, OpenReadCompletedEventArgs> action)
|
||||
{
|
||||
WebClient client = new WebClient();
|
||||
@@ -65,99 +60,91 @@ namespace CampusAppWP8.Utility
|
||||
client.OpenReadAsync(url);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Method realize the http-delete-method
|
||||
/// </summary>
|
||||
/// <remarks>
|
||||
/// is not supported by WebClient
|
||||
/// </remarks>
|
||||
/// <param name="url">Url of the resource</param>
|
||||
/// <param name="action">callback method</param>
|
||||
/// <summary> Method realize the http-delete-method. </summary>
|
||||
/// <remarks> is not supported by WebClient. </remarks>
|
||||
/// <exception cref="NotSupportedException">
|
||||
/// Thrown when the requested operation is not supported.
|
||||
/// </exception>
|
||||
/// <param name="url"> Url of the resource. </param>
|
||||
/// <param name="action"> callback method. </param>
|
||||
public void HttpDelete(Uri url, Action<object, DownloadStringCompletedEventArgs> action)
|
||||
{
|
||||
throw new NotSupportedException();
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Method realize the http-head-method
|
||||
/// </summary>
|
||||
/// <remarks>
|
||||
/// is not supported by WebClient
|
||||
/// </remarks>
|
||||
/// <param name="url">Url of the resource</param>
|
||||
/// <param name="action">callback method</param>
|
||||
/// <summary> Method realize the http-head-method. </summary>
|
||||
/// <remarks> is not supported by WebClient. </remarks>
|
||||
/// <exception cref="NotSupportedException">
|
||||
/// Thrown when the requested operation is not supported.
|
||||
/// </exception>
|
||||
/// <param name="url"> Url of the resource. </param>
|
||||
/// <param name="action"> callback method. </param>
|
||||
public void HttpHead(Uri url, Action<object, DownloadStringCompletedEventArgs> action)
|
||||
{
|
||||
throw new NotSupportedException();
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Method realize the http-options-method
|
||||
/// </summary>
|
||||
/// <remarks>
|
||||
/// is not supported by WebClient
|
||||
/// </remarks>
|
||||
/// <param name="url">Url of the resource</param>
|
||||
/// <param name="action">callback method</param>
|
||||
/// <summary> Method realize the http-options-method. </summary>
|
||||
/// <remarks> is not supported by WebClient. </remarks>
|
||||
/// <exception cref="NotSupportedException">
|
||||
/// Thrown when the requested operation is not supported.
|
||||
/// </exception>
|
||||
/// <param name="url"> Url of the resource. </param>
|
||||
/// <param name="action"> callback method. </param>
|
||||
public void HttpOptions(Uri url, Action<object, DownloadStringCompletedEventArgs> action)
|
||||
{
|
||||
throw new NotSupportedException();
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Method realize the http-connect-method
|
||||
/// </summary>
|
||||
/// <remarks>
|
||||
/// is not supported by WebClient
|
||||
/// </remarks>
|
||||
/// <param name="url">Url of the resource</param>
|
||||
/// <param name="action">callback method</param>
|
||||
/// <summary> Method realize the http-connect-method. </summary>
|
||||
/// <remarks> is not supported by WebClient. </remarks>
|
||||
/// <exception cref="NotSupportedException">
|
||||
/// Thrown when the requested operation is not supported.
|
||||
/// </exception>
|
||||
/// <param name="url"> Url of the resource. </param>
|
||||
/// <param name="action"> callback method. </param>
|
||||
public void HttpConnect(Uri url, Action<object, DownloadStringCompletedEventArgs> action)
|
||||
{
|
||||
throw new NotSupportedException();
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Method realize the http-trace-method
|
||||
/// </summary>
|
||||
/// <remarks>
|
||||
/// is not supported by WebClient
|
||||
/// </remarks>
|
||||
/// <param name="url">Url of the resource</param>
|
||||
/// <param name="action">callback method</param>
|
||||
/// <summary> Method realize the http-trace-method. </summary>
|
||||
/// <remarks> is not supported by WebClient. </remarks>
|
||||
/// <exception cref="NotSupportedException">
|
||||
/// Thrown when the requested operation is not supported.
|
||||
/// </exception>
|
||||
/// <param name="url"> Url of the resource. </param>
|
||||
/// <param name="action"> callback method. </param>
|
||||
public void HttpTrace(Uri url, Action<object, DownloadStringCompletedEventArgs> action)
|
||||
{
|
||||
throw new NotSupportedException();
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Method realize the http-post-method
|
||||
/// </summary>
|
||||
/// <param name="url">Url of the resource</param>
|
||||
/// <param name="action">callback method</param>
|
||||
/// <param name="postData">Data which are sending via post to the HttpRequest</param>
|
||||
/// <summary> Method realize the http-post-method. </summary>
|
||||
/// <remarks> Stubbfel, 15.10.2013. </remarks>
|
||||
/// <param name="url"> Url of the resource. </param>
|
||||
/// <param name="action"> callback method. </param>
|
||||
/// <param name="postData"> Data which are sending via post to the HttpRequest. </param>
|
||||
public void HttpPost(Uri url, Action<object, UploadStringCompletedEventArgs> action, string postData)
|
||||
{
|
||||
this.UploadData(url, action, "POST", postData);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Method realize the http-put-method
|
||||
/// </summary>
|
||||
/// <param name="url">Url of the resource</param>
|
||||
/// <param name="action">callback method</param>
|
||||
/// <param name="putData">Data which are sending via put to the HttpRequest</param>
|
||||
/// <summary> Method realize the http-put-method. </summary>
|
||||
/// <remarks> Stubbfel, 15.10.2013. </remarks>
|
||||
/// <param name="url"> Url of the resource. </param>
|
||||
/// <param name="action"> callback method. </param>
|
||||
/// <param name="putData"> Data which are sending via put to the HttpRequest. </param>
|
||||
public void HttpPut(Uri url, Action<object, UploadStringCompletedEventArgs> action, string putData)
|
||||
{
|
||||
this.UploadData(url, action, "PUT", putData);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Method realize the http-patch-method
|
||||
/// </summary>
|
||||
/// <param name="url">Url of the resource</param>
|
||||
/// <param name="action">callback method</param>
|
||||
/// <param name="patchData">Data which are sending via patch to the HttpRequest</param>
|
||||
/// <summary> Method realize the http-patch-method. </summary>
|
||||
/// <remarks> Stubbfel, 15.10.2013. </remarks>
|
||||
/// <param name="url"> Url of the resource. </param>
|
||||
/// <param name="action"> callback method. </param>
|
||||
/// <param name="patchData"> Data which are sending via patch to the HttpRequest. </param>
|
||||
public void HttpPatch(Uri url, Action<object, UploadStringCompletedEventArgs> action, string patchData)
|
||||
{
|
||||
this.UploadData(url, action, "PATCH", patchData);
|
||||
@@ -167,13 +154,12 @@ namespace CampusAppWP8.Utility
|
||||
|
||||
#region private
|
||||
|
||||
/// <summary>
|
||||
/// Method uploaded Data to the HttpRequest
|
||||
/// </summary>
|
||||
/// <param name="url">Url of the resource</param>
|
||||
/// <param name="action">callback method</param>
|
||||
/// <param name="method">name of APIMethod, how the data will be uploaded</param>
|
||||
/// <param name="data">Data which are sending to the HttpRequest</param>
|
||||
/// <summary> Method uploaded Data to the HttpRequest. </summary>
|
||||
/// <remarks> Stubbfel, 15.10.2013. </remarks>
|
||||
/// <param name="url"> Url of the resource. </param>
|
||||
/// <param name="action"> callback method. </param>
|
||||
/// <param name="method"> name of APIMethod, how the data will be uploaded. </param>
|
||||
/// <param name="data"> Data which are sending to the HttpRequest. </param>
|
||||
private void UploadData(Uri url, Action<object, UploadStringCompletedEventArgs> action, string method, string data)
|
||||
{
|
||||
WebClient client = new WebClient();
|
||||
|
||||
@@ -1,11 +1,11 @@
|
||||
//-----------------------------------------------------------------------
|
||||
// <copyright file="AddPersonButton.cs" company="BTU/IIT">
|
||||
// Company copyright tag.
|
||||
// The MIT License (MIT). Copyright (c) 2013 BTU/IIT.
|
||||
// </copyright>
|
||||
// <author>stubbfel</author>
|
||||
// <sience>09.09.2013</sience>
|
||||
//----------------------------------------------------------------------
|
||||
|
||||
// <author>Stubbfel</author>
|
||||
// <date>15.10.2013</date>
|
||||
// <summary>Implements the add person button class</summary>
|
||||
//-----------------------------------------------------------------------
|
||||
namespace CampusAppWP8.Utility.Lui.Button
|
||||
{
|
||||
using System;
|
||||
@@ -14,27 +14,28 @@ namespace CampusAppWP8.Utility.Lui.Button
|
||||
using System.Windows.Media.Imaging;
|
||||
using CampusAppWP8.Resources;
|
||||
|
||||
/// <summary>Add person button.</summary>
|
||||
/// <remarks>Stubbfel, 12.09.2013.</remarks>
|
||||
/// <summary> Add person button. </summary>
|
||||
/// <remarks> Stubbfel, 12.09.2013. </remarks>
|
||||
/// <seealso cref="T:System.Windows.Controls.Button"/>
|
||||
public class AddPersonButton : System.Windows.Controls.Button
|
||||
{
|
||||
#region Member
|
||||
|
||||
/// <summary>The person identifier property.</summary>
|
||||
/// <summary> The person identifier property. </summary>
|
||||
public static readonly DependencyProperty PersonIdProperty = DependencyProperty.Register("PersonID", typeof(object), typeof(AddPersonButton), new PropertyMetadata(false));
|
||||
|
||||
/// <summary>The function index property.</summary>
|
||||
/// <summary> The function index property. </summary>
|
||||
public static readonly DependencyProperty FunctionIndexProperty = DependencyProperty.Register("FunctionIndex", typeof(object), typeof(AddPersonButton), new PropertyMetadata(false));
|
||||
|
||||
/// <summary>The icon.</summary>
|
||||
/// <summary> The icon. </summary>
|
||||
private static BitmapImage icon = new BitmapImage(new Uri(Icons.AddContact, UriKind.Relative));
|
||||
|
||||
#endregion
|
||||
|
||||
#region Constructor
|
||||
|
||||
/// <summary>Initializes a new instance of the AddPersonButton class.</summary>
|
||||
/// <remarks>Stubbfel, 12.09.2013.</remarks>
|
||||
/// <summary> Initializes a new instance of the AddPersonButton class. </summary>
|
||||
/// <remarks> Stubbfel, 12.09.2013. </remarks>
|
||||
public AddPersonButton()
|
||||
: base()
|
||||
{
|
||||
@@ -48,16 +49,16 @@ namespace CampusAppWP8.Utility.Lui.Button
|
||||
|
||||
#region Property
|
||||
|
||||
/// <summary>Gets or sets the identifier of the person.</summary>
|
||||
/// <value>The identifier of the person.</value>
|
||||
/// <summary> Gets or sets the identifier of the person. </summary>
|
||||
/// <value> The identifier of the person. </value>
|
||||
public object PersonId
|
||||
{
|
||||
get { return (object)this.GetValue(PersonIdProperty); }
|
||||
set { this.SetValue(PersonIdProperty, value); }
|
||||
}
|
||||
|
||||
/// <summary>Gets or sets zero-based index of the function.</summary>
|
||||
/// <value>The function index.</value>
|
||||
/// <summary> Gets or sets zero-based index of the function. </summary>
|
||||
/// <value> The function index. </value>
|
||||
public object FunctionIndex
|
||||
{
|
||||
get { return (object)this.GetValue(FunctionIndexProperty); }
|
||||
|
||||
@@ -1,10 +1,11 @@
|
||||
//-----------------------------------------------------------------------
|
||||
// <copyright file="EmailButton.cs" company="BTU/IIT">
|
||||
// Company copyright tag.
|
||||
// The MIT License (MIT). Copyright (c) 2013 BTU/IIT.
|
||||
// </copyright>
|
||||
// <author>stubbfel</author>
|
||||
// <sience>04.07.2013</sience>
|
||||
//----------------------------------------------------------------------
|
||||
// <author>Stubbfel</author>
|
||||
// <date>15.10.2013</date>
|
||||
// <summary>Implements the email button class</summary>
|
||||
//-----------------------------------------------------------------------
|
||||
namespace CampusAppWP8.Utility.Lui.Button
|
||||
{
|
||||
using System;
|
||||
@@ -14,30 +15,25 @@ namespace CampusAppWP8.Utility.Lui.Button
|
||||
using CampusAppWP8.Resources;
|
||||
using Microsoft.Phone.Tasks;
|
||||
|
||||
/// <summary>
|
||||
/// This class create an Button which start the Email-Client
|
||||
/// </summary>
|
||||
/// <summary> This class create an Button which start the Email-Client. </summary>
|
||||
/// <remarks> Stubbfel, 15.10.2013. </remarks>
|
||||
/// <seealso cref="T:System.Windows.Controls.Button"/>
|
||||
public class EmailButton : System.Windows.Controls.Button
|
||||
{
|
||||
#region Members
|
||||
|
||||
/// <summary>
|
||||
/// Register the EmailProperty
|
||||
/// </summary>
|
||||
/// <summary> Register the EmailProperty. </summary>
|
||||
public static readonly DependencyProperty EmailProperty = DependencyProperty.Register("EmailAddress", typeof(object), typeof(EmailButton), new PropertyMetadata(false));
|
||||
|
||||
/// <summary>
|
||||
/// Icon of the Button
|
||||
/// </summary>
|
||||
/// <summary> Icon of the Button. </summary>
|
||||
private static BitmapImage icon = new BitmapImage(new Uri(Icons.WebMail, UriKind.Relative));
|
||||
|
||||
#endregion
|
||||
|
||||
#region Constructors
|
||||
|
||||
/// <summary>
|
||||
/// Initializes a new instance of the <see cref="EmailButton" /> class.
|
||||
/// </summary>
|
||||
/// <summary> Initializes a new instance of the <see cref="EmailButton" /> class. </summary>
|
||||
/// <remarks> Stubbfel, 15.10.2013. </remarks>
|
||||
public EmailButton()
|
||||
: base()
|
||||
{
|
||||
@@ -51,9 +47,8 @@ namespace CampusAppWP8.Utility.Lui.Button
|
||||
|
||||
#region Proberties
|
||||
|
||||
/// <summary>
|
||||
/// Gets or sets the EmailAddress
|
||||
/// </summary>
|
||||
/// <summary> Gets or sets the EmailAddress. </summary>
|
||||
/// <value> The email address. </value>
|
||||
public object EmailAddress
|
||||
{
|
||||
get { return (object)this.GetValue(EmailProperty); }
|
||||
@@ -64,12 +59,9 @@ namespace CampusAppWP8.Utility.Lui.Button
|
||||
|
||||
#region Methods
|
||||
|
||||
/// <summary>
|
||||
/// Overrides the OnClick-Method from button
|
||||
/// </summary>
|
||||
/// <remarks>
|
||||
/// now method start the EmailComposeTask
|
||||
/// </remarks>
|
||||
/// <summary> Overrides the OnClick-Method from button. </summary>
|
||||
/// <remarks> now method start the EmailComposeTask. </remarks>
|
||||
/// <seealso cref="M:System.Windows.Controls.Button.OnClick()"/>
|
||||
protected override void OnClick()
|
||||
{
|
||||
EmailComposeTask emailTask = new EmailComposeTask();
|
||||
|
||||
@@ -1,10 +1,11 @@
|
||||
//-----------------------------------------------------------------------
|
||||
// <copyright file="GoToMapButton.cs" company="BTU/IIT">
|
||||
// Company copyright tag.
|
||||
// The MIT License (MIT). Copyright (c) 2013 BTU/IIT.
|
||||
// </copyright>
|
||||
// <author>stubbfel</author>
|
||||
// <sience>08.07.2013</sience>
|
||||
//----------------------------------------------------------------------
|
||||
// <author>Stubbfel</author>
|
||||
// <date>15.10.2013</date>
|
||||
// <summary>Implements the go to map button class</summary>
|
||||
//-----------------------------------------------------------------------
|
||||
namespace CampusAppWP8.Utility.Lui.Button
|
||||
{
|
||||
using System;
|
||||
@@ -15,30 +16,25 @@ namespace CampusAppWP8.Utility.Lui.Button
|
||||
using CampusAppWP8.Resources;
|
||||
using Microsoft.Phone.Tasks;
|
||||
|
||||
/// <summary>
|
||||
/// This class create an Button which open a Map
|
||||
/// </summary>
|
||||
/// <summary> This class create an Button which open a Map. </summary>
|
||||
/// <remarks> Stubbfel, 15.10.2013. </remarks>
|
||||
/// <seealso cref="T:System.Windows.Controls.Button"/>
|
||||
public class GoToMapButton : System.Windows.Controls.Button
|
||||
{
|
||||
#region Members
|
||||
|
||||
/// <summary>
|
||||
/// Register the SearchTermProperty
|
||||
/// </summary>
|
||||
/// <summary> Register the SearchTermProperty. </summary>
|
||||
public static readonly DependencyProperty SearchTermProperty = DependencyProperty.Register("SearchTerm", typeof(object), typeof(GoToMapButton), new PropertyMetadata(false));
|
||||
|
||||
/// <summary>
|
||||
/// Icon of the Button
|
||||
/// </summary>
|
||||
/// <summary> Icon of the Button. </summary>
|
||||
private static BitmapImage icon = new BitmapImage(new Uri(Icons.Campus, UriKind.Relative));
|
||||
|
||||
#endregion
|
||||
|
||||
#region Constructors
|
||||
|
||||
/// <summary>
|
||||
/// Initializes a new instance of the <see cref="GoToMapButton" /> class.
|
||||
/// </summary>
|
||||
/// <summary> Initializes a new instance of the <see cref="GoToMapButton" /> class. </summary>
|
||||
/// <remarks> Stubbfel, 15.10.2013. </remarks>
|
||||
public GoToMapButton()
|
||||
: base()
|
||||
{
|
||||
@@ -52,9 +48,8 @@ namespace CampusAppWP8.Utility.Lui.Button
|
||||
|
||||
#region Proberties
|
||||
|
||||
/// <summary>
|
||||
/// Gets or sets the Url
|
||||
/// </summary>
|
||||
/// <summary> Gets or sets the Url. </summary>
|
||||
/// <value> The search term. </value>
|
||||
public object SearchTerm
|
||||
{
|
||||
get { return (object)this.GetValue(SearchTermProperty); }
|
||||
@@ -65,12 +60,9 @@ namespace CampusAppWP8.Utility.Lui.Button
|
||||
|
||||
#region Methods
|
||||
|
||||
/// <summary>
|
||||
/// Overrides the OnClick-Method from button
|
||||
/// </summary>
|
||||
/// <remarks>
|
||||
/// now method start the MapTask
|
||||
/// </remarks>
|
||||
/// <summary> Overrides the OnClick-Method from button. </summary>
|
||||
/// <remarks> now method start the MapTask. </remarks>
|
||||
/// <seealso cref="M:System.Windows.Controls.Button.OnClick()"/>
|
||||
protected override void OnClick()
|
||||
{
|
||||
string urlString = Constants.PathCampusmap_Campusmap;
|
||||
|
||||
@@ -1,10 +1,11 @@
|
||||
//-----------------------------------------------------------------------
|
||||
// <copyright file="LinkButton.cs" company="BTU/IIT">
|
||||
// Company copyright tag.
|
||||
// The MIT License (MIT). Copyright (c) 2013 BTU/IIT.
|
||||
// </copyright>
|
||||
// <author>stubbfel</author>
|
||||
// <sience>08.07.2013</sience>
|
||||
//----------------------------------------------------------------------
|
||||
// <author>Stubbfel</author>
|
||||
// <date>15.10.2013</date>
|
||||
// <summary>Implements the link button class</summary>
|
||||
//-----------------------------------------------------------------------
|
||||
namespace CampusAppWP8.Utility.Lui.Button
|
||||
{
|
||||
using System;
|
||||
@@ -15,29 +16,26 @@ namespace CampusAppWP8.Utility.Lui.Button
|
||||
using Microsoft.Phone.Tasks;
|
||||
|
||||
/// <summary>
|
||||
/// This class create an Button which start the WebBrowser, which an certain url
|
||||
/// This class create an Button which start the WebBrowser, which an certain url.
|
||||
/// </summary>
|
||||
/// <remarks> Stubbfel, 15.10.2013. </remarks>
|
||||
/// <seealso cref="T:System.Windows.Controls.Button"/>
|
||||
public class LinkButton : System.Windows.Controls.Button
|
||||
{
|
||||
#region Members
|
||||
|
||||
/// <summary>
|
||||
/// Register the EmailProperty
|
||||
/// </summary>
|
||||
/// <summary> Register the EmailProperty. </summary>
|
||||
public static readonly DependencyProperty LinkProperty = DependencyProperty.Register("Url", typeof(object), typeof(LinkButton), new PropertyMetadata(false));
|
||||
|
||||
/// <summary>
|
||||
/// Icon of the Button
|
||||
/// </summary>
|
||||
/// <summary> Icon of the Button. </summary>
|
||||
private static BitmapImage icon = new BitmapImage(new Uri(Icons.Link, UriKind.Relative));
|
||||
|
||||
#endregion
|
||||
|
||||
#region Constructors
|
||||
|
||||
/// <summary>
|
||||
/// Initializes a new instance of the <see cref="LinkButton" /> class.
|
||||
/// </summary>
|
||||
/// <summary> Initializes a new instance of the <see cref="LinkButton" /> class. </summary>
|
||||
/// <remarks> Stubbfel, 15.10.2013. </remarks>
|
||||
public LinkButton()
|
||||
: base()
|
||||
{
|
||||
@@ -51,9 +49,8 @@ namespace CampusAppWP8.Utility.Lui.Button
|
||||
|
||||
#region Proberties
|
||||
|
||||
/// <summary>
|
||||
/// Gets or sets the Url
|
||||
/// </summary>
|
||||
/// <summary> Gets or sets the Url. </summary>
|
||||
/// <value> The URL. </value>
|
||||
public object Url
|
||||
{
|
||||
get { return (object)this.GetValue(LinkProperty); }
|
||||
@@ -64,12 +61,9 @@ namespace CampusAppWP8.Utility.Lui.Button
|
||||
|
||||
#region Methods
|
||||
|
||||
/// <summary>
|
||||
/// Overrides the OnClick-Method from button
|
||||
/// </summary>
|
||||
/// <remarks>
|
||||
/// now method start the WebBrowserTask
|
||||
/// </remarks>
|
||||
/// <summary> Overrides the OnClick-Method from button. </summary>
|
||||
/// <remarks> now method start the WebBrowserTask. </remarks>
|
||||
/// <seealso cref="M:System.Windows.Controls.Button.OnClick()"/>
|
||||
protected override void OnClick()
|
||||
{
|
||||
Uri linkUrl = new Uri(this.Url as string, UriKind.Absolute);
|
||||
|
||||
@@ -1,45 +1,39 @@
|
||||
//-----------------------------------------------------------------------
|
||||
// <copyright file="NavigateButton.cs" company="BTU/IIT">
|
||||
// Company copyright tag.
|
||||
// The MIT License (MIT). Copyright (c) 2013 BTU/IIT.
|
||||
// </copyright>
|
||||
// <author>stubbfel</author>
|
||||
// <sience>08.07.2013</sience>
|
||||
//----------------------------------------------------------------------
|
||||
// <author>Stubbfel</author>
|
||||
// <date>15.10.2013</date>
|
||||
// <summary>Implements the navigate button class</summary>
|
||||
//-----------------------------------------------------------------------
|
||||
namespace CampusAppWP8.Utility.Lui.Button
|
||||
{
|
||||
using System;
|
||||
using System.Windows;
|
||||
using System.Windows.Controls;
|
||||
|
||||
/// <summary>
|
||||
/// This class create an Button which navigate to a certain page
|
||||
/// </summary>
|
||||
/// <summary> This class create an Button which navigate to a certain page. </summary>
|
||||
/// <remarks> Stubbfel, 15.10.2013. </remarks>
|
||||
/// <seealso cref="T:System.Windows.Controls.Button"/>
|
||||
public class NavigateButton : System.Windows.Controls.Button
|
||||
{
|
||||
#region Members
|
||||
|
||||
/// <summary>
|
||||
/// Register the UrlProperty
|
||||
/// </summary>
|
||||
/// <summary> Register the UrlProperty. </summary>
|
||||
public static readonly DependencyProperty NavigateProperty = DependencyProperty.Register("Url", typeof(object), typeof(NavigateButton), new PropertyMetadata(false));
|
||||
|
||||
/// <summary>
|
||||
/// Register the QueryValueProperty
|
||||
/// </summary>
|
||||
/// <summary> Register the QueryValueProperty. </summary>
|
||||
public static readonly DependencyProperty QueryValueProperty = DependencyProperty.Register("QuerryStringValue", typeof(object), typeof(NavigateButton), new PropertyMetadata(false));
|
||||
|
||||
/// <summary>
|
||||
/// Register the QueryNameProperty
|
||||
/// </summary>
|
||||
/// <summary> Register the QueryNameProperty. </summary>
|
||||
public static readonly DependencyProperty QueryNameProperty = DependencyProperty.Register("QuerryStringName", typeof(object), typeof(NavigateButton), new PropertyMetadata(false));
|
||||
|
||||
#endregion
|
||||
|
||||
#region Constructors
|
||||
|
||||
/// <summary>
|
||||
/// Initializes a new instance of the <see cref="NavigateButton" /> class.
|
||||
/// </summary>
|
||||
/// <summary> Initializes a new instance of the <see cref="NavigateButton" /> class. </summary>
|
||||
/// <remarks> Stubbfel, 15.10.2013. </remarks>
|
||||
public NavigateButton()
|
||||
: base()
|
||||
{
|
||||
@@ -49,27 +43,24 @@ namespace CampusAppWP8.Utility.Lui.Button
|
||||
|
||||
#region Proberties
|
||||
|
||||
/// <summary>
|
||||
/// Gets or sets the Url
|
||||
/// </summary>
|
||||
/// <summary> Gets or sets the Url. </summary>
|
||||
/// <value> The URL. </value>
|
||||
public object Url
|
||||
{
|
||||
get { return (object)this.GetValue(NavigateProperty); }
|
||||
set { this.SetValue(NavigateProperty, value); }
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Gets or sets the QueryStringName
|
||||
/// </summary>
|
||||
/// <summary> Gets or sets the QueryStringName. </summary>
|
||||
/// <value> The name of the query string. </value>
|
||||
public object QuerryStringName
|
||||
{
|
||||
get { return (object)this.GetValue(QueryNameProperty); }
|
||||
set { this.SetValue(QueryNameProperty, value); }
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Gets or sets the QueryStringValue
|
||||
/// </summary>
|
||||
/// <summary> Gets or sets the QueryStringValue. </summary>
|
||||
/// <value> The query string value. </value>
|
||||
public object QuerryStringValue
|
||||
{
|
||||
get { return (object)this.GetValue(QueryValueProperty); }
|
||||
@@ -80,12 +71,9 @@ namespace CampusAppWP8.Utility.Lui.Button
|
||||
|
||||
#region Methods
|
||||
|
||||
/// <summary>
|
||||
/// Overrides the OnClick-Method from button
|
||||
/// </summary>
|
||||
/// <remarks>
|
||||
/// now method navigate to a certain page
|
||||
/// </remarks>
|
||||
/// <summary> Overrides the OnClick-Method from button. </summary>
|
||||
/// <remarks> now method navigate to a certain page. </remarks>
|
||||
/// <seealso cref="M:System.Windows.Controls.Button.OnClick()"/>
|
||||
protected override void OnClick()
|
||||
{
|
||||
string urlString = this.Url as string;
|
||||
|
||||
@@ -1,10 +1,11 @@
|
||||
//-----------------------------------------------------------------------
|
||||
// <copyright file="PhoneButton.cs" company="BTU/IIT">
|
||||
// Company copyright tag.
|
||||
// The MIT License (MIT). Copyright (c) 2013 BTU/IIT.
|
||||
// </copyright>
|
||||
// <author>stubbfel</author>
|
||||
// <sience>08.07.2013</sience>
|
||||
//----------------------------------------------------------------------
|
||||
// <author>Stubbfel</author>
|
||||
// <date>15.10.2013</date>
|
||||
// <summary>Implements the phone button class</summary>
|
||||
//-----------------------------------------------------------------------
|
||||
namespace CampusAppWP8.Utility.Lui.Button
|
||||
{
|
||||
using System;
|
||||
@@ -14,35 +15,28 @@ namespace CampusAppWP8.Utility.Lui.Button
|
||||
using CampusAppWP8.Resources;
|
||||
using Microsoft.Phone.Tasks;
|
||||
|
||||
/// <summary>
|
||||
/// This class create an Button which start a PhoneCall
|
||||
/// </summary>
|
||||
/// <summary> This class create an Button which start a PhoneCall. </summary>
|
||||
/// <remarks> Stubbfel, 15.10.2013. </remarks>
|
||||
/// <seealso cref="T:System.Windows.Controls.Button"/>
|
||||
public class PhoneButton : System.Windows.Controls.Button
|
||||
{
|
||||
#region Members
|
||||
|
||||
/// <summary>
|
||||
/// Register the PhoneProperty
|
||||
/// </summary>
|
||||
/// <summary> Register the PhoneProperty. </summary>
|
||||
public static readonly DependencyProperty PhoneProperty = DependencyProperty.Register("Number", typeof(object), typeof(PhoneButton), new PropertyMetadata(false));
|
||||
|
||||
/// <summary>
|
||||
/// Register the DisplayNameProperty
|
||||
/// </summary>
|
||||
/// <summary> Register the DisplayNameProperty. </summary>
|
||||
public static readonly DependencyProperty DisplayNameProperty = DependencyProperty.Register("DisplayName", typeof(object), typeof(PhoneButton), new PropertyMetadata(false));
|
||||
|
||||
/// <summary>
|
||||
/// Icon of the Button
|
||||
/// </summary>
|
||||
/// <summary> Icon of the Button. </summary>
|
||||
private static BitmapImage icon = new BitmapImage(new Uri(Icons.Phone, UriKind.Relative));
|
||||
|
||||
#endregion
|
||||
|
||||
#region Constructors
|
||||
|
||||
/// <summary>
|
||||
/// Initializes a new instance of the <see cref="PhoneButton" /> class.
|
||||
/// </summary>
|
||||
/// <summary> Initializes a new instance of the <see cref="PhoneButton" /> class. </summary>
|
||||
/// <remarks> Stubbfel, 15.10.2013. </remarks>
|
||||
public PhoneButton()
|
||||
: base()
|
||||
{
|
||||
@@ -56,18 +50,16 @@ namespace CampusAppWP8.Utility.Lui.Button
|
||||
|
||||
#region Proberties
|
||||
|
||||
/// <summary>
|
||||
/// Gets or sets the PhoneNumber
|
||||
/// </summary>
|
||||
/// <summary> Gets or sets the PhoneNumber. </summary>
|
||||
/// <value> The new PhoneNumber. </value>
|
||||
public object Number
|
||||
{
|
||||
get { return (object)this.GetValue(PhoneProperty); }
|
||||
set { this.SetValue(PhoneProperty, value); }
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Gets or sets the DisplayName
|
||||
/// </summary>
|
||||
/// <summary> Gets or sets the DisplayName. </summary>
|
||||
/// <value> The name which is showing on the display </value>
|
||||
public object DisplayName
|
||||
{
|
||||
get { return (object)this.GetValue(DisplayNameProperty); }
|
||||
@@ -78,12 +70,9 @@ namespace CampusAppWP8.Utility.Lui.Button
|
||||
|
||||
#region Methods
|
||||
|
||||
/// <summary>
|
||||
/// Overrides the OnClick-Method from button
|
||||
/// </summary>
|
||||
/// <remarks>
|
||||
/// now method start the PhoneTask
|
||||
/// </remarks>
|
||||
/// <summary> Overrides the OnClick-Method from button. </summary>
|
||||
/// <remarks> now method start the PhoneTask. </remarks>
|
||||
/// <seealso cref="M:System.Windows.Controls.Button.OnClick()"/>
|
||||
protected override void OnClick()
|
||||
{
|
||||
PhoneCallTask phoneCallTask = new PhoneCallTask();
|
||||
|
||||
@@ -1,10 +1,11 @@
|
||||
//-----------------------------------------------------------------------
|
||||
// <copyright file="ToggleButton.cs" company="BTU/IIT">
|
||||
// Company copyright tag.
|
||||
// The MIT License (MIT). Copyright (c) 2013 BTU/IIT.
|
||||
// </copyright>
|
||||
// <author>stubbfel</author>
|
||||
// <sience>08.07.2013</sience>
|
||||
//----------------------------------------------------------------------
|
||||
// <author>Stubbfel</author>
|
||||
// <date>15.10.2013</date>
|
||||
// <summary>Implements the toggle button class</summary>
|
||||
//-----------------------------------------------------------------------
|
||||
namespace CampusAppWP8.Utility.Lui.Button
|
||||
{
|
||||
using System.Collections.Generic;
|
||||
@@ -12,29 +13,25 @@ namespace CampusAppWP8.Utility.Lui.Button
|
||||
using System.Windows.Controls;
|
||||
|
||||
/// <summary>
|
||||
/// This class create an Button which can toggle the Visibility of certain FrameworkElements
|
||||
/// This class create an Button which can toggle the Visibility of certain FrameworkElements.
|
||||
/// </summary>
|
||||
/// <remarks> Stubbfel, 15.10.2013. </remarks>
|
||||
/// <seealso cref="T:System.Windows.Controls.Button"/>
|
||||
public class ToggleButton : System.Windows.Controls.Button
|
||||
{
|
||||
#region Members
|
||||
|
||||
#region public
|
||||
/// <summary>
|
||||
/// Register the ToggleContentTag
|
||||
/// </summary>
|
||||
/// <summary> Register the ToggleContentTag. </summary>
|
||||
public static readonly DependencyProperty ToggleContentTagProperty = DependencyProperty.Register("ToggleContentTag", typeof(object), typeof(ToggleButton), new PropertyMetadata(false));
|
||||
|
||||
#endregion
|
||||
#region private
|
||||
|
||||
/// <summary>
|
||||
/// List of FrameworkElement which can change their Visibility by this button
|
||||
/// </summary>
|
||||
/// <summary> List of FrameworkElement which can change their Visibility by this button. </summary>
|
||||
private List<FrameworkElement> toggleElements = null;
|
||||
|
||||
/// <summary>
|
||||
/// EventHandler of the ToggleButton
|
||||
/// </summary>
|
||||
/// <summary> EventHandler of the ToggleButton. </summary>
|
||||
private ToggleButtonHandler eventHandler;
|
||||
|
||||
#endregion
|
||||
@@ -43,9 +40,8 @@ namespace CampusAppWP8.Utility.Lui.Button
|
||||
|
||||
#region Constructors
|
||||
|
||||
/// <summary>
|
||||
/// Initializes a new instance of the <see cref="ToggleButton" /> class.
|
||||
/// </summary>
|
||||
/// <summary> Initializes a new instance of the <see cref="ToggleButton" /> class. </summary>
|
||||
/// <remarks> Stubbfel, 15.10.2013. </remarks>
|
||||
public ToggleButton()
|
||||
: base()
|
||||
{
|
||||
@@ -55,22 +51,18 @@ namespace CampusAppWP8.Utility.Lui.Button
|
||||
|
||||
#region Events
|
||||
|
||||
/// <summary>
|
||||
/// Delegate for the ToggleButton events
|
||||
/// </summary>
|
||||
/// <summary> Delegate for the ToggleButton events. </summary>
|
||||
/// <remarks> Stubbfel, 15.10.2013. </remarks>
|
||||
private delegate void ToggleButtonHandler();
|
||||
|
||||
/// <summary>
|
||||
/// The closeButtonEvent
|
||||
/// </summary>
|
||||
/// <summary> The closeButtonEvent. </summary>
|
||||
private static event ToggleButtonHandler CloseButtonEvent;
|
||||
#endregion
|
||||
|
||||
#region Proberties
|
||||
|
||||
/// <summary>
|
||||
/// Gets or sets the ToggleContentTag
|
||||
/// </summary>
|
||||
/// <summary> Gets or sets the ToggleContentTag. </summary>
|
||||
/// <value> The toggle content tag. </value>
|
||||
public object ToggleContentTag
|
||||
{
|
||||
get { return (object)this.GetValue(ToggleContentTagProperty); }
|
||||
@@ -84,8 +76,9 @@ namespace CampusAppWP8.Utility.Lui.Button
|
||||
#region public
|
||||
|
||||
/// <summary>
|
||||
/// Method close the ToggleContent of the old ToggleContent and then show the new one
|
||||
/// Method close the ToggleContent of the old ToggleContent and then show the new one.
|
||||
/// </summary>
|
||||
/// <remarks> Stubbfel, 15.10.2013. </remarks>
|
||||
public void ToggleToggleContent()
|
||||
{
|
||||
if (this.toggleElements != null)
|
||||
@@ -103,9 +96,8 @@ namespace CampusAppWP8.Utility.Lui.Button
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Method show all Element of the ToggleContent
|
||||
/// </summary>
|
||||
/// <summary> Method show all Element of the ToggleContent. </summary>
|
||||
/// <remarks> Stubbfel, 15.10.2013. </remarks>
|
||||
public void ShowToggleContent()
|
||||
{
|
||||
if (this.toggleElements != null)
|
||||
@@ -117,9 +109,8 @@ namespace CampusAppWP8.Utility.Lui.Button
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Method show all Element of the ToggleContent
|
||||
/// </summary>
|
||||
/// <summary> Method show all Element of the ToggleContent. </summary>
|
||||
/// <remarks> Stubbfel, 15.10.2013. </remarks>
|
||||
public void HideToggleContent()
|
||||
{
|
||||
if (this.toggleElements != null)
|
||||
@@ -134,12 +125,9 @@ namespace CampusAppWP8.Utility.Lui.Button
|
||||
|
||||
#region protected
|
||||
|
||||
/// <summary>
|
||||
/// Overrides the OnClick-Method from button
|
||||
/// </summary>
|
||||
/// <remarks>
|
||||
/// now method toggle the visibility of some FrameWorkElements
|
||||
/// </remarks>
|
||||
/// <summary> Overrides the OnClick-Method from button. </summary>
|
||||
/// <remarks> now method toggle the visibility of some FrameWorkElements. </remarks>
|
||||
/// <seealso cref="M:System.Windows.Controls.Button.OnClick()"/>
|
||||
protected override void OnClick()
|
||||
{
|
||||
if (this.toggleElements == null)
|
||||
@@ -154,9 +142,8 @@ namespace CampusAppWP8.Utility.Lui.Button
|
||||
|
||||
#region private
|
||||
|
||||
/// <summary>
|
||||
/// Method look for some ToggleContent
|
||||
/// </summary>
|
||||
/// <summary> Method look for some ToggleContent. </summary>
|
||||
/// <remarks> Stubbfel, 15.10.2013. </remarks>
|
||||
private void SetupToggleElements()
|
||||
{
|
||||
this.toggleElements = new List<FrameworkElement>();
|
||||
@@ -177,10 +164,9 @@ namespace CampusAppWP8.Utility.Lui.Button
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Gets the first panel, which is a parent of this button
|
||||
/// </summary>
|
||||
/// <returns> first panel of the parents</returns>
|
||||
/// <summary> Gets the first panel, which is a parent of this button. </summary>
|
||||
/// <remarks> Stubbfel, 15.10.2013. </remarks>
|
||||
/// <returns> first panel of the parents. </returns>
|
||||
private Panel GetFirstParentPanel()
|
||||
{
|
||||
FrameworkElement parentElement = this.Parent as FrameworkElement;
|
||||
@@ -199,10 +185,9 @@ namespace CampusAppWP8.Utility.Lui.Button
|
||||
return parentPanel;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Method toggle the visibility of a certain element
|
||||
/// </summary>
|
||||
/// <param name="element">element of the ToggleContent</param>
|
||||
/// <summary> Method toggle the visibility of a certain element. </summary>
|
||||
/// <remarks> Stubbfel, 15.10.2013. </remarks>
|
||||
/// <param name="element"> element of the ToggleContent. </param>
|
||||
private void ToggleToggleContentElement(UIElement element)
|
||||
{
|
||||
if (element != null)
|
||||
@@ -218,10 +203,9 @@ namespace CampusAppWP8.Utility.Lui.Button
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Method show the visibility of a certain element
|
||||
/// </summary>
|
||||
/// <param name="element">element of the ToggleContent</param>
|
||||
/// <summary> Method show the visibility of a certain element. </summary>
|
||||
/// <remarks> Stubbfel, 15.10.2013. </remarks>
|
||||
/// <param name="element"> element of the ToggleContent. </param>
|
||||
private void ShowToggleContentElement(UIElement element)
|
||||
{
|
||||
if (element != null)
|
||||
@@ -235,10 +219,9 @@ namespace CampusAppWP8.Utility.Lui.Button
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Method hide the visibility of a certain element
|
||||
/// </summary>
|
||||
/// <param name="element">element of the ToggleContent</param>
|
||||
/// <summary> Method hide the visibility of a certain element. </summary>
|
||||
/// <remarks> Stubbfel, 15.10.2013. </remarks>
|
||||
/// <param name="element"> element of the ToggleContent. </param>
|
||||
private void HideToggleContentElement(UIElement element)
|
||||
{
|
||||
if (element != null)
|
||||
|
||||
@@ -1,40 +1,36 @@
|
||||
//-----------------------------------------------------------------------
|
||||
// <copyright file="UpdateButtonAppBar.cs" company="BTU/IIT">
|
||||
// Company copyright tag.
|
||||
// The MIT License (MIT). Copyright (c) 2013 BTU/IIT.
|
||||
// </copyright>
|
||||
// <author>stubbfel</author>
|
||||
// <sience>22.07.2013</sience>
|
||||
//----------------------------------------------------------------------
|
||||
// <author>Stubbfel</author>
|
||||
// <date>15.10.2013</date>
|
||||
// <summary>Implements the update button application bar class</summary>
|
||||
//-----------------------------------------------------------------------
|
||||
namespace CampusAppWP8.Utility.Lui.Button
|
||||
{
|
||||
using System;
|
||||
using CampusAppWP8.Resources;
|
||||
using Microsoft.Phone.Shell;
|
||||
|
||||
/// <summary>
|
||||
/// This class create an Button which start the Email-Client
|
||||
/// </summary>
|
||||
/// <summary> This class create an Button which start the Email-Client. </summary>
|
||||
/// <remarks> Stubbfel, 15.10.2013. </remarks>
|
||||
/// <seealso cref="T:Microsoft.Phone.Shell.ApplicationBarIconButton"/>
|
||||
public class UpdateButtonAppBar : ApplicationBarIconButton
|
||||
{
|
||||
#region Members
|
||||
|
||||
/// <summary>
|
||||
/// IconUri of the Button
|
||||
/// </summary>
|
||||
/// <summary> IconUri of the Button. </summary>
|
||||
private static Uri iconUri = new Uri(Icons.Update, UriKind.Relative);
|
||||
|
||||
/// <summary>
|
||||
/// Text of the Button
|
||||
/// </summary>
|
||||
/// <summary> Text of the Button. </summary>
|
||||
private static string text = AppResources.UpdateBtn;
|
||||
|
||||
#endregion
|
||||
|
||||
#region Constructors
|
||||
|
||||
/// <summary>
|
||||
/// Initializes a new instance of the <see cref="UpdateButtonAppBar" /> class.
|
||||
/// </summary>
|
||||
/// <summary> Initializes a new instance of the <see cref="UpdateButtonAppBar" /> class. </summary>
|
||||
/// <remarks> Stubbfel, 15.10.2013. </remarks>
|
||||
public UpdateButtonAppBar()
|
||||
: base()
|
||||
{
|
||||
|
||||
@@ -1,33 +1,33 @@
|
||||
//-----------------------------------------------------------------------------
|
||||
//-----------------------------------------------------------------------
|
||||
// <copyright file="DefaultHeader.xaml.cs" company="BTU/IIT">
|
||||
// Company copyright tag.
|
||||
// The MIT License (MIT). Copyright (c) 2013 BTU/IIT.
|
||||
// </copyright>
|
||||
// <author>fiedlchr</author>
|
||||
// <sience>07.10.2013</sience>
|
||||
//-----------------------------------------------------------------------------
|
||||
// <date>15.10.2013</date>
|
||||
// <summary>Implements the default header.xaml class</summary>
|
||||
//-----------------------------------------------------------------------
|
||||
namespace CampusAppWP8.Utility.Lui.Header
|
||||
{
|
||||
using System.Windows;
|
||||
using System.Windows.Controls;
|
||||
using CampusAppWP8.Resources;
|
||||
|
||||
/// <summary>
|
||||
/// Default Header Template.
|
||||
/// </summary>
|
||||
/// <summary> Default Header Template. </summary>
|
||||
/// <remarks> fiedlchr, 15.10.2013. </remarks>
|
||||
/// <seealso cref="T:System.Windows.Controls.UserControl"/>
|
||||
public partial class DefaultHeader : UserControl
|
||||
{
|
||||
/// <summary>AppTitle property object.</summary>
|
||||
/// <summary> AppTitle property object. </summary>
|
||||
public static readonly DependencyProperty AppTitleProperty = DependencyProperty.Register("AppTitle", typeof(string), typeof(DefaultHeader), new PropertyMetadata(null));
|
||||
|
||||
/// <summary>HeaderName property object.</summary>
|
||||
/// <summary> HeaderName property object. </summary>
|
||||
public static readonly DependencyProperty HeaderNameProperty = DependencyProperty.Register("HeaderName", typeof(string), typeof(DefaultHeader), new PropertyMetadata(null));
|
||||
|
||||
/// <summary>ProgressVisibility property object.</summary>
|
||||
/// <summary> ProgressVisibility property object. </summary>
|
||||
public static readonly DependencyProperty ProgressVisibilityProperty = DependencyProperty.Register("ProgressVisibility", typeof(Visibility), typeof(DefaultHeader), new PropertyMetadata(null));
|
||||
|
||||
/// <summary>
|
||||
/// Initializes a new instance of the <see cref="DefaultHeader" /> class.
|
||||
/// </summary>
|
||||
/// <summary> Initializes a new instance of the <see cref="DefaultHeader" /> class. </summary>
|
||||
/// <remarks> fiedlchr, 15.10.2013. </remarks>
|
||||
public DefaultHeader()
|
||||
{
|
||||
this.InitializeComponent();
|
||||
@@ -35,9 +35,8 @@ namespace CampusAppWP8.Utility.Lui.Header
|
||||
this.ProgressVisibility = Visibility.Collapsed;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Gets or sets the AppTitle property.
|
||||
/// </summary>
|
||||
/// <summary> Gets or sets the AppTitle property. </summary>
|
||||
/// <value> The application title. </value>
|
||||
public string AppTitle
|
||||
{
|
||||
get
|
||||
@@ -51,9 +50,8 @@ namespace CampusAppWP8.Utility.Lui.Header
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Gets or sets the HeaderName property.
|
||||
/// </summary>
|
||||
/// <summary> Gets or sets the HeaderName property. </summary>
|
||||
/// <value> The name of the header. </value>
|
||||
public string HeaderName
|
||||
{
|
||||
get
|
||||
@@ -67,6 +65,8 @@ namespace CampusAppWP8.Utility.Lui.Header
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary> Gets or sets the progress visibility. </summary>
|
||||
/// <value> The progress visibility. </value>
|
||||
public Visibility ProgressVisibility
|
||||
{
|
||||
get
|
||||
|
||||
@@ -1,80 +1,82 @@
|
||||
//-----------------------------------------------------------------------
|
||||
// <copyright file="MessageBoxes.cs" company="BTU/IIT">
|
||||
// Company copyright tag.
|
||||
// The MIT License (MIT). Copyright (c) 2013 BTU/IIT.
|
||||
// </copyright>
|
||||
// <author>stubbfel</author>
|
||||
// <sience>15.08.2013</sience>
|
||||
//----------------------------------------------------------------------
|
||||
// <author>Stubbfel</author>
|
||||
// <date>15.10.2013</date>
|
||||
// <summary>Implements the message boxes class</summary>
|
||||
//-----------------------------------------------------------------------
|
||||
namespace CampusAppWP8.Utility.Lui.MessageBoxes
|
||||
{
|
||||
using System.Windows;
|
||||
using CampusAppWP8.Resources;
|
||||
|
||||
/// <summary>
|
||||
/// Class creates some MessageBoxes
|
||||
/// </summary>
|
||||
/// <summary> Class creates some MessageBoxes. </summary>
|
||||
/// <remarks> Stubbfel, 15.10.2013. </remarks>
|
||||
public class MessageBoxes
|
||||
{
|
||||
#region Method
|
||||
|
||||
/// <summary>
|
||||
/// Method show the MessageBox for the GeoWatch-OptIn
|
||||
/// </summary>
|
||||
/// <returns>result of the UserInteraction</returns>
|
||||
/// <summary> Method show the MessageBox for the GeoWatch-OptIn. </summary>
|
||||
/// <remarks> Stubbfel, 15.10.2013. </remarks>
|
||||
/// <returns> result of the UserInteraction. </returns>
|
||||
public static MessageBoxResult ShowGoeWatchOptInBox()
|
||||
{
|
||||
return MessageBox.Show(AppResources.MsgBox_GeoWatchOptInText, AppResources.MsgBox_GeoWatchOptInHeader, MessageBoxButton.OKCancel);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Method show the MessageBox for the ErrorMessageBox
|
||||
/// </summary>
|
||||
/// <param name="text">custom text for the box</param>
|
||||
/// <returns>result of the UserInteraction</returns>
|
||||
/// <summary> Method show the MessageBox for the ErrorMessageBox. </summary>
|
||||
/// <remarks> Stubbfel, 15.10.2013. </remarks>
|
||||
/// <param name="text"> custom text for the box. </param>
|
||||
/// <returns> result of the UserInteraction. </returns>
|
||||
public static MessageBoxResult ShowMainModelErrorMessageBox(string text)
|
||||
{
|
||||
return MessageBox.Show(text, AppResources.MsgBox_ErrorHeader, MessageBoxButton.OK);
|
||||
}
|
||||
|
||||
/// <summary>Shows the main model information message box.</summary>
|
||||
/// <remarks>Stubbfel, 10.09.2013.</remarks>
|
||||
/// <param name="text">custom text for the box.</param>
|
||||
/// <returns>result of the UserInteraction</returns>
|
||||
/// <summary> Shows the main model information message box. </summary>
|
||||
/// <remarks> Stubbfel, 10.09.2013. </remarks>
|
||||
/// <param name="text"> custom text for the box. </param>
|
||||
/// <returns> result of the UserInteraction. </returns>
|
||||
public static MessageBoxResult ShowMainModelInfoMessageBox(string text)
|
||||
{
|
||||
return MessageBox.Show(text, AppResources.MsgBox_InfoHeader, MessageBoxButton.OK);
|
||||
}
|
||||
|
||||
/// <summary>Shows the place information message box.</summary>
|
||||
/// <remarks>Stubbfel, 10.09.2013.</remarks>
|
||||
/// <param name="text">custom text for the box.</param>
|
||||
/// <returns>result of the UserInteraction</returns>
|
||||
/// <summary> Shows the place information message box. </summary>
|
||||
/// <remarks> Stubbfel, 10.09.2013. </remarks>
|
||||
/// <param name="text"> custom text for the box. </param>
|
||||
/// <returns> result of the UserInteraction. </returns>
|
||||
public static MessageBoxResult ShowPlaceInfoMessageBox(string text)
|
||||
{
|
||||
return MessageBox.Show(text, AppResources.MsgBox_PlaceInfoHeader, MessageBoxButton.OK);
|
||||
}
|
||||
|
||||
/// <summary>Shows the place information message box (OKCancel-Box).</summary>
|
||||
/// <remarks>Stubbfel, 10.09.2013.</remarks>
|
||||
/// <param name="text">custom text for the box.</param>
|
||||
/// <returns>result of the UserInteraction</returns>
|
||||
/// <summary> Shows the place information message box (OKCancel-Box). </summary>
|
||||
/// <remarks> Stubbfel, 10.09.2013. </remarks>
|
||||
/// <param name="text"> custom text for the box. </param>
|
||||
/// <returns> result of the UserInteraction. </returns>
|
||||
public static MessageBoxResult ShowPlaceInfoOkCancelMessageBox(string text)
|
||||
{
|
||||
return MessageBox.Show(text, AppResources.MsgBox_PlaceInfoHeader, MessageBoxButton.OKCancel);
|
||||
}
|
||||
|
||||
/// <summary> Shows the btu tag information ok cancel message box. </summary>
|
||||
/// <remarks> Stubbfel, 15.10.2013. </remarks>
|
||||
/// <param name="text"> (Optional) custom text for the box. </param>
|
||||
/// <returns> A MessageBoxResult. </returns>
|
||||
public static MessageBoxResult ShowBtuTagInfoOkCancelMessageBox(string text = null)
|
||||
{
|
||||
|
||||
string tagString;
|
||||
if (text != null)
|
||||
{
|
||||
tagString = ":\n" + Wp8StringManager.ToShortString(text, 160, "...");
|
||||
tagString = ":\n" + Wp8StringManager.ToShortString(text, 160, "...");
|
||||
}
|
||||
else
|
||||
{
|
||||
tagString = "!";
|
||||
}
|
||||
|
||||
string btuString = AppResources.BTUTag_Prefix + tagString + "\n" + AppResources.BTUTag_Suffix;
|
||||
return MessageBox.Show(btuString, AppResources.MsgBox_BtuInfoHeader, MessageBoxButton.OKCancel);
|
||||
}
|
||||
|
||||
@@ -1,11 +1,11 @@
|
||||
//-----------------------------------------------------------------------
|
||||
// <copyright file="TileCreator.cs" company="BTU/IIT">
|
||||
// Company copyright tag.
|
||||
// The MIT License (MIT). Copyright (c) 2013 BTU/IIT.
|
||||
// </copyright>
|
||||
// <author>stubbfel</author>
|
||||
// <sience>18.09.2013</sience>
|
||||
//----------------------------------------------------------------------
|
||||
|
||||
// <author>Stubbfel</author>
|
||||
// <date>15.10.2013</date>
|
||||
// <summary>Implements the tile creator class</summary>
|
||||
//-----------------------------------------------------------------------
|
||||
namespace CampusAppWP8.Utility.Lui.Tiles
|
||||
{
|
||||
using System;
|
||||
@@ -13,21 +13,19 @@ namespace CampusAppWP8.Utility.Lui.Tiles
|
||||
using CampusAppWP8.Resources;
|
||||
using Microsoft.Phone.Shell;
|
||||
|
||||
/// <summary>
|
||||
/// Class creates different live tiles
|
||||
/// </summary>
|
||||
/// <summary> Class creates different live tiles. </summary>
|
||||
/// <remarks> Stubbfel, 15.10.2013. </remarks>
|
||||
public class TileCreator
|
||||
{
|
||||
/// <summary>
|
||||
/// Method creates an IconicTile
|
||||
/// </summary>
|
||||
/// <param name="title">title of the tile</param>
|
||||
/// <param name="path">path the the page</param>
|
||||
/// <param name="iconUrl">icon url of the main icon</param>
|
||||
/// <param name="smallIcon">icon url of the small icon</param>
|
||||
/// <param name="wideContent1">string for the wide content 1</param>
|
||||
/// <param name="wideContent2">string for the wide content 2</param>
|
||||
/// <param name="wideContent3">string for the wide content 3</param>
|
||||
/// <summary> Method creates an IconicTile. </summary>
|
||||
/// <remarks> Stubbfel, 15.10.2013. </remarks>
|
||||
/// <param name="title"> title of the tile. </param>
|
||||
/// <param name="path"> path the the page. </param>
|
||||
/// <param name="iconUrl"> icon url of the main icon. </param>
|
||||
/// <param name="smallIcon"> icon url of the small icon. </param>
|
||||
/// <param name="wideContent1"> (Optional) string for the wide content 1. </param>
|
||||
/// <param name="wideContent2"> (Optional) string for the wide content 2. </param>
|
||||
/// <param name="wideContent3"> (Optional) string for the wide content 3. </param>
|
||||
public static void CreateIconicTile(string title, string path, string iconUrl, string smallIcon, string wideContent1 = null, string wideContent2 = null, string wideContent3 = null)
|
||||
{
|
||||
IconicTileData iconTile = new IconicTileData();
|
||||
@@ -50,9 +48,8 @@ namespace CampusAppWP8.Utility.Lui.Tiles
|
||||
ShellTile.Create(new Uri(path, UriKind.Relative), iconTile, true);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Method creates the MensaTile
|
||||
/// </summary>
|
||||
/// <summary> Method creates the MensaTile. </summary>
|
||||
/// <remarks> Stubbfel, 15.10.2013. </remarks>
|
||||
public static void CreateMensaTile()
|
||||
{
|
||||
TileCreator.CreateIconicTile(AppResources.MensaApp_Title, Constants.PathMensa_MensaPage, Icons.Mensa, Icons.Mensa);
|
||||
@@ -61,17 +58,15 @@ namespace CampusAppWP8.Utility.Lui.Tiles
|
||||
BackgroundTasks.StartBTUCampusAppTask();
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Method creates the MailTile
|
||||
/// </summary>
|
||||
/// <summary> Method creates the MailTile. </summary>
|
||||
/// <remarks> Stubbfel, 15.10.2013. </remarks>
|
||||
public static void CreateWebMailTile()
|
||||
{
|
||||
TileCreator.CreateIconicTile(AppResources.MailApp_Title, Constants.PathMail_WebMailPage, Icons.WebMail, Icons.WebMail);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Method creates the NewsTile
|
||||
/// </summary>
|
||||
/// <summary> Method creates the NewsTile. </summary>
|
||||
/// <remarks> Stubbfel, 15.10.2013. </remarks>
|
||||
public static void CreateNewsTile()
|
||||
{
|
||||
TileCreator.CreateIconicTile(AppResources.NewsApp_Title, Constants.PathNews_NewsIndexPage, Icons.News, Icons.News);
|
||||
@@ -80,17 +75,15 @@ namespace CampusAppWP8.Utility.Lui.Tiles
|
||||
BackgroundTasks.StartBTUCampusAppTask();
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Method creates the LectureTile
|
||||
/// </summary>
|
||||
/// <summary> Method creates the LectureTile. </summary>
|
||||
/// <remarks> Stubbfel, 15.10.2013. </remarks>
|
||||
public static void CreateLectureTile()
|
||||
{
|
||||
TileCreator.CreateIconicTile(AppResources.LectureApp_Title, Constants.PathLecture_LecturePage, Icons.Lectures, Icons.Lectures);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Method creates the EventTile
|
||||
/// </summary>
|
||||
/// <summary> Method creates the EventTile. </summary>
|
||||
/// <remarks> Stubbfel, 15.10.2013. </remarks>
|
||||
public static void CreateEventTile()
|
||||
{
|
||||
TileCreator.CreateIconicTile(AppResources.EventApp_Title, Constants.PathEvents_EventsIndexPage, Icons.Events, Icons.Events);
|
||||
@@ -99,65 +92,57 @@ namespace CampusAppWP8.Utility.Lui.Tiles
|
||||
BackgroundTasks.StartBTUCampusAppTask();
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Method creates the DepartmentTile
|
||||
/// </summary>
|
||||
/// <summary> Method creates the DepartmentTile. </summary>
|
||||
/// <remarks> Stubbfel, 15.10.2013. </remarks>
|
||||
public static void CreateDepartmentTile()
|
||||
{
|
||||
TileCreator.CreateIconicTile(AppResources.DepartmentApp_Title, Constants.PathDepartment_DepartmentIndexPage, Icons.Departments, Icons.Departments);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Method creates the OpeningHoursTile
|
||||
/// </summary>
|
||||
/// <summary> Method creates the OpeningHoursTile. </summary>
|
||||
/// <remarks> Stubbfel, 15.10.2013. </remarks>
|
||||
public static void CreateOpeningHoursTile()
|
||||
{
|
||||
TileCreator.CreateIconicTile(AppResources.OpenHoursApp_Title, Constants.PathOpeninghours_OpeninghoursPage, Icons.Openhours, Icons.Openhours);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Method creates the linkTile
|
||||
/// </summary>
|
||||
/// <summary> Method creates the linkTile. </summary>
|
||||
/// <remarks> Stubbfel, 15.10.2013. </remarks>
|
||||
public static void CreateLinkTile()
|
||||
{
|
||||
TileCreator.CreateIconicTile(AppResources.LinkApp_Title, Constants.PathLinks_LinkPage, Icons.Link, Icons.Link);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Method creates the StudentCouncilTile
|
||||
/// </summary>
|
||||
/// <summary> Method creates the StudentCouncilTile. </summary>
|
||||
/// <remarks> Stubbfel, 15.10.2013. </remarks>
|
||||
public static void CreateStudentCouncilTile()
|
||||
{
|
||||
TileCreator.CreateIconicTile(AppResources.OSAApp_Title, Constants.PathStudentCouncil_StudentCouncilPage, Icons.StudentCouncil, Icons.StudentCouncil);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Method creates the ExamsTile
|
||||
/// </summary>
|
||||
/// <summary> Method creates the ExamsTile. </summary>
|
||||
/// <remarks> Stubbfel, 15.10.2013. </remarks>
|
||||
public static void CreateExamsTile()
|
||||
{
|
||||
TileCreator.CreateIconicTile(AppResources.ExaminationApp_Header, Constants.PathExams_ExamsPage, Icons.Exams, Icons.Exams);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Method creates the PersonTile
|
||||
/// </summary>
|
||||
/// <summary> Method creates the PersonTile. </summary>
|
||||
/// <remarks> Stubbfel, 15.10.2013. </remarks>
|
||||
public static void CreatePersonTile()
|
||||
{
|
||||
TileCreator.CreateIconicTile(AppResources.PersonApp_Title, Constants.PathPerson_Person, Icons.Person, Icons.Person);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Method creates the PlaceNewsTile
|
||||
/// </summary>
|
||||
/// <summary> Method creates the PlaceNewsTile. </summary>
|
||||
/// <remarks> Stubbfel, 15.10.2013. </remarks>
|
||||
public static void CreatePlaceNewsTile()
|
||||
{
|
||||
TileCreator.CreateIconicTile(AppResources.PlaceNewsApp_Title, Constants.PathPlaceNews_PlaceNewsPage, Icons.News, Icons.News);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Method creates the CampusMapTile
|
||||
/// </summary>
|
||||
/// <summary> Method creates the CampusMapTile. </summary>
|
||||
/// <remarks> Stubbfel, 15.10.2013. </remarks>
|
||||
public static void CreateCampusMapTile()
|
||||
{
|
||||
TileCreator.CreateIconicTile(AppResources.CampusMapApp_Title, Constants.PathCampusmap_Campusmap, Icons.Campus, Icons.Campus);
|
||||
|
||||
@@ -10,24 +10,24 @@ namespace CampusAppWP8.Utility.NDEF
|
||||
using System.Collections.Generic;
|
||||
using System.IO;
|
||||
|
||||
/// <summary>Ndef message.</summary>
|
||||
/// <remarks>Stubbfel, 21.08.2013.</remarks>
|
||||
/// <summary> Ndef message. </summary>
|
||||
/// <remarks> Stubbfel, 21.08.2013. </remarks>
|
||||
public class NDEFMessage
|
||||
{
|
||||
#region Members
|
||||
|
||||
/// <summary>The records.</summary>
|
||||
/// <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>
|
||||
/// <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>();
|
||||
@@ -60,9 +60,9 @@ namespace CampusAppWP8.Utility.NDEF
|
||||
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>
|
||||
/// <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>();
|
||||
@@ -80,8 +80,8 @@ namespace CampusAppWP8.Utility.NDEF
|
||||
|
||||
#region enum
|
||||
|
||||
/// <summary>Values that represent TYPEVAL.</summary>
|
||||
/// <remarks>Stubbfel, 21.08.2013.</remarks>
|
||||
/// <summary> Values that represent TYPEVAL. </summary>
|
||||
/// <remarks> Stubbfel, 21.08.2013. </remarks>
|
||||
public enum TYPEVAL
|
||||
{
|
||||
/// <summary>An enum constant representing the empty option.</summary>
|
||||
@@ -97,10 +97,11 @@ namespace CampusAppWP8.Utility.NDEF
|
||||
#endregion
|
||||
|
||||
#region Methods
|
||||
/// <summary>Gets a praefix.</summary>
|
||||
/// <remarks>Stubbfel, 21.08.2013.</remarks>
|
||||
/// <param name="type">The type.</param>
|
||||
/// <returns>The praefix.</returns>
|
||||
|
||||
/// <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;
|
||||
@@ -120,9 +121,9 @@ namespace CampusAppWP8.Utility.NDEF
|
||||
return praefix;
|
||||
}
|
||||
|
||||
/// <summary>Gets the content.</summary>
|
||||
/// <remarks>Stubbfel, 21.08.2013.</remarks>
|
||||
/// <returns>The content.</returns>
|
||||
/// <summary> Gets the content. </summary>
|
||||
/// <remarks> Stubbfel, 21.08.2013. </remarks>
|
||||
/// <returns> The content. </returns>
|
||||
public string GetContent()
|
||||
{
|
||||
string result = string.Empty;
|
||||
@@ -135,9 +136,9 @@ namespace CampusAppWP8.Utility.NDEF
|
||||
return result;
|
||||
}
|
||||
|
||||
/// <summary>Converts this object to a byte array.</summary>
|
||||
/// <remarks>Stubbfel, 21.08.2013.</remarks>
|
||||
/// <returns>This object as a byte[].</returns>
|
||||
/// <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();
|
||||
|
||||
@@ -1,40 +1,42 @@
|
||||
//-----------------------------------------------------------------------
|
||||
// <copyright file="NDEFRecord.cs" company="BTU/IIT">
|
||||
// Company copyright tag.
|
||||
// The MIT License (MIT). Copyright (c) 2013 BTU/IIT.
|
||||
// </copyright>
|
||||
// <author>stubbfel</author>
|
||||
// <sience>21.08.2013</sience>
|
||||
//----------------------------------------------------------------------
|
||||
// <author>Stubbfel</author>
|
||||
// <date>15.10.2013</date>
|
||||
// <summary>Implements the ndef record class</summary>
|
||||
//-----------------------------------------------------------------------
|
||||
namespace CampusAppWP8.Utility.NDEF
|
||||
{
|
||||
using System.IO;
|
||||
using System.Text;
|
||||
|
||||
/// <summary>Ndef record of a NDEFMessage.</summary>
|
||||
/// <remarks>Stubbfel, 21.08.2013.</remarks>
|
||||
/// <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>
|
||||
/// <summary> The maximum record pay load. </summary>
|
||||
public const int MaxRecordPayLoad = 255;
|
||||
|
||||
/// <summary>Size of the type.</summary>
|
||||
/// <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>
|
||||
|
||||
/// <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>
|
||||
/// <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];
|
||||
@@ -44,8 +46,8 @@ namespace CampusAppWP8.Utility.NDEF
|
||||
|
||||
#region enum
|
||||
|
||||
/// <summary>Values that represent NDEFFlags.</summary>
|
||||
/// <remarks>Stubbfel, 21.08.2013.</remarks>
|
||||
/// <summary> Values that represent NDEFFlags. </summary>
|
||||
/// <remarks> Stubbfel, 21.08.2013. </remarks>
|
||||
public enum NDEFFlags
|
||||
{
|
||||
/// <summary>An Enum constant representing the UNSET option.</summary>
|
||||
@@ -70,8 +72,8 @@ namespace CampusAppWP8.Utility.NDEF
|
||||
TNFSET = 0x03
|
||||
}
|
||||
|
||||
/// <summary>Values that represent TNFVAL.</summary>
|
||||
/// <remarks>Stubbfel, 21.08.2013.</remarks>
|
||||
/// <summary> Values that represent TNFVAL. </summary>
|
||||
/// <remarks> Stubbfel, 21.08.2013. </remarks>
|
||||
public enum TNFVAL
|
||||
{
|
||||
/// <summary>An enum constant representing the empty option.</summary>
|
||||
@@ -102,36 +104,37 @@ namespace CampusAppWP8.Utility.NDEF
|
||||
#endregion
|
||||
|
||||
#region Properties
|
||||
/// <summary>Gets or sets the MBFlag.</summary>
|
||||
/// <value>The MBFlag.</value>
|
||||
|
||||
/// <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>
|
||||
/// <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>
|
||||
/// <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>
|
||||
/// <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>
|
||||
/// <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>
|
||||
/// <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>
|
||||
/// <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>
|
||||
/// <summary> Gets the format flags. </summary>
|
||||
/// <value> The format flags. </value>
|
||||
public byte FormatFlags
|
||||
{
|
||||
get
|
||||
@@ -150,12 +153,12 @@ namespace CampusAppWP8.Utility.NDEF
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>Gets or sets the payload.</summary>
|
||||
/// <value>The payload.</value>
|
||||
/// <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>
|
||||
/// <summary> Gets the size of the record. </summary>
|
||||
/// <value> The size of the record. </value>
|
||||
public int RecordSize
|
||||
{
|
||||
get
|
||||
@@ -164,21 +167,21 @@ namespace CampusAppWP8.Utility.NDEF
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>Gets or sets the payload praefix.</summary>
|
||||
/// <value>The payload praefix.</value>
|
||||
/// <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>
|
||||
/// <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>
|
||||
/// <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
|
||||
|
||||
@@ -1,22 +1,24 @@
|
||||
//-----------------------------------------------------------------------
|
||||
// <copyright file="NDEFShortRecord.cs" company="BTU/IIT">
|
||||
// Company copyright tag.
|
||||
// The MIT License (MIT). Copyright (c) 2013 BTU/IIT.
|
||||
// </copyright>
|
||||
// <author>stubbfel</author>
|
||||
// <sience>21.08.2013</sience>
|
||||
//----------------------------------------------------------------------
|
||||
// <author>Stubbfel</author>
|
||||
// <date>15.10.2013</date>
|
||||
// <summary>Implements the ndef short record class</summary>
|
||||
//-----------------------------------------------------------------------
|
||||
namespace CampusAppWP8.Utility.NDEF
|
||||
{
|
||||
using System.Text;
|
||||
|
||||
/// <summary>Ndef short record.</summary>
|
||||
/// <remarks>Stubbfel, 21.08.2013.</remarks>
|
||||
/// <summary> Ndef short record. </summary>
|
||||
/// <remarks> Stubbfel, 21.08.2013. </remarks>
|
||||
/// <seealso cref="T:CampusAppWP8.Utility.NDEF.NDEFRecord"/>
|
||||
public class NDEFShortRecord : NDEFRecord
|
||||
{
|
||||
#region Constructor
|
||||
|
||||
/// <summary>Initializes a new instance of the NDEFShortRecord class.</summary>
|
||||
/// <remarks>Stubbfel, 21.08.2013.</remarks>
|
||||
/// <summary> Initializes a new instance of the NDEFShortRecord class. </summary>
|
||||
/// <remarks> Stubbfel, 21.08.2013. </remarks>
|
||||
public NDEFShortRecord()
|
||||
{
|
||||
this.HeaderSize = 4;
|
||||
@@ -25,10 +27,10 @@ namespace CampusAppWP8.Utility.NDEF
|
||||
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>
|
||||
/// <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)
|
||||
{
|
||||
@@ -43,9 +45,9 @@ namespace CampusAppWP8.Utility.NDEF
|
||||
|
||||
#region Method
|
||||
|
||||
/// <summary>Converts this NDEFShortRecord to a byte array.</summary>
|
||||
/// <remarks>Stubbfel, 21.08.2013.</remarks>
|
||||
/// <returns>This object as a byte[].</returns>
|
||||
/// <summary> Converts this NDEFShortRecord to a byte array. </summary>
|
||||
/// <remarks> Stubbfel, 21.08.2013. </remarks>
|
||||
/// <seealso cref="M:CampusAppWP8.Utility.NDEF.NDEFRecord.ToByteArray()"/>
|
||||
public override byte[] ToByteArray()
|
||||
{
|
||||
byte[] payloadAr = Encoding.UTF8.GetBytes(this.PayloadPraefix + this.Payload);
|
||||
|
||||
@@ -1,26 +1,26 @@
|
||||
//-----------------------------------------------------------------------
|
||||
// <copyright file="Wp8StringManager.cs" company="BTU/IIT">
|
||||
// Company copyright tag.
|
||||
// The MIT License (MIT). Copyright (c) 2013 BTU/IIT.
|
||||
// </copyright>
|
||||
// <author>stubbfel</author>
|
||||
// <sience>06.06.2013</sience>
|
||||
//----------------------------------------------------------------------
|
||||
// <author>Stubbfel</author>
|
||||
// <date>15.10.2013</date>
|
||||
// <summary>Implements the wp 8 string manager class</summary>
|
||||
//-----------------------------------------------------------------------
|
||||
namespace CampusAppWP8.Utility
|
||||
{
|
||||
using System;
|
||||
using System.Text.RegularExpressions;
|
||||
using CampusAppWP8.Resources;
|
||||
|
||||
/// <summary>
|
||||
/// Class provides some special StringMethods
|
||||
/// </summary>
|
||||
/// <summary> Class provides some special StringMethods. </summary>
|
||||
/// <remarks> Stubbfel, 15.10.2013. </remarks>
|
||||
/// <seealso cref="T:CampusAppWPortalLib8.Utility.DefaultStringManager"/>
|
||||
public class Wp8StringManager : CampusAppWPortalLib8.Utility.DefaultStringManager
|
||||
{
|
||||
/// <summary>
|
||||
/// Method removes Html-Tag of a String
|
||||
/// </summary>
|
||||
/// <param name="inputString">String with Html-Tags</param>
|
||||
/// <returns>String without Html-Tags</returns>
|
||||
/// <summary> Method removes Html-Tag of a String. </summary>
|
||||
/// <remarks> Stubbfel, 15.10.2013. </remarks>
|
||||
/// <param name="inputString"> String with Html-Tags. </param>
|
||||
/// <returns> String without Html-Tags. </returns>
|
||||
public static string StripAndDecodeHTML(string inputString)
|
||||
{
|
||||
return System.Net.HttpUtility.HtmlDecode(Wp8StringManager.StripHTML(inputString));
|
||||
|
||||
Reference in New Issue
Block a user