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