diff --git a/CampusAppWP8/CampusAppWP8/App.xaml.cs b/CampusAppWP8/CampusAppWP8/App.xaml.cs index 65acbc71..3b4121ce 100644 --- a/CampusAppWP8/CampusAppWP8/App.xaml.cs +++ b/CampusAppWP8/CampusAppWP8/App.xaml.cs @@ -212,7 +212,7 @@ namespace CampusAppWP8 // Dieser Code wird beim Deaktivieren der Anwendung nicht ausgeführt private void Application_Closing(object sender, ClosingEventArgs e) { - // Sicherstellen, dass der erforderliche Anwendungszustand hier beibehalten wird + App.SaveToIsolatedStorage("StartPageIndex", null); } // Code, der bei einem Navigationsfehler ausgeführt wird diff --git a/CampusAppWP8/CampusAppWP8/Assets/BTULogoKompaktversiondeutschPNGSW.png b/CampusAppWP8/CampusAppWP8/Assets/BTULogoKompaktversiondeutschPNGSW.png index 89c8372c..af24ab70 100644 Binary files a/CampusAppWP8/CampusAppWP8/Assets/BTULogoKompaktversiondeutschPNGSW.png and b/CampusAppWP8/CampusAppWP8/Assets/BTULogoKompaktversiondeutschPNGSW.png differ diff --git a/CampusAppWP8/CampusAppWP8/Assets/Background.jpg b/CampusAppWP8/CampusAppWP8/Assets/Background.jpg new file mode 100644 index 00000000..7cb86e76 Binary files /dev/null and b/CampusAppWP8/CampusAppWP8/Assets/Background.jpg differ diff --git a/CampusAppWP8/CampusAppWP8/Assets/Icons/DarkTheme/stundenplan_add_159.png b/CampusAppWP8/CampusAppWP8/Assets/Icons/DarkTheme/stundenplan_add_159.png new file mode 100644 index 00000000..c25e0c25 Binary files /dev/null and b/CampusAppWP8/CampusAppWP8/Assets/Icons/DarkTheme/stundenplan_add_159.png differ diff --git a/CampusAppWP8/CampusAppWP8/Assets/Icons/LightTheme/stundenplan_add_159.png b/CampusAppWP8/CampusAppWP8/Assets/Icons/LightTheme/stundenplan_add_159.png new file mode 100644 index 00000000..7fb0d562 Binary files /dev/null and b/CampusAppWP8/CampusAppWP8/Assets/Icons/LightTheme/stundenplan_add_159.png differ diff --git a/CampusAppWP8/CampusAppWP8/Assets/Slides/Slide1.jpg b/CampusAppWP8/CampusAppWP8/Assets/Slides/Slide1.jpg new file mode 100644 index 00000000..b46797a8 Binary files /dev/null and b/CampusAppWP8/CampusAppWP8/Assets/Slides/Slide1.jpg differ diff --git a/CampusAppWP8/CampusAppWP8/Assets/Slides/Slide2.jpg b/CampusAppWP8/CampusAppWP8/Assets/Slides/Slide2.jpg new file mode 100644 index 00000000..7cb86e76 Binary files /dev/null and b/CampusAppWP8/CampusAppWP8/Assets/Slides/Slide2.jpg differ diff --git a/CampusAppWP8/CampusAppWP8/Assets/Slides/Slide3.jpg b/CampusAppWP8/CampusAppWP8/Assets/Slides/Slide3.jpg new file mode 100644 index 00000000..e7ca2df9 Binary files /dev/null and b/CampusAppWP8/CampusAppWP8/Assets/Slides/Slide3.jpg differ diff --git a/CampusAppWP8/CampusAppWP8/Assets/Slides/Slide4.jpg b/CampusAppWP8/CampusAppWP8/Assets/Slides/Slide4.jpg new file mode 100644 index 00000000..6e052543 Binary files /dev/null and b/CampusAppWP8/CampusAppWP8/Assets/Slides/Slide4.jpg differ diff --git a/CampusAppWP8/CampusAppWP8/Assets/Slides/Slide5.jpg b/CampusAppWP8/CampusAppWP8/Assets/Slides/Slide5.jpg new file mode 100644 index 00000000..dd786bb2 Binary files /dev/null and b/CampusAppWP8/CampusAppWP8/Assets/Slides/Slide5.jpg differ diff --git a/CampusAppWP8/CampusAppWP8/CampusAppWP8.csproj b/CampusAppWP8/CampusAppWP8/CampusAppWP8.csproj index 00e17b16..14b52676 100644 --- a/CampusAppWP8/CampusAppWP8/CampusAppWP8.csproj +++ b/CampusAppWP8/CampusAppWP8/CampusAppWP8.csproj @@ -255,7 +255,7 @@ AppointmentCanvas.xaml - + MultiValueTextBlock.xaml @@ -542,7 +542,7 @@ Designer MSBuild:Compile - + Designer MSBuild:Compile @@ -571,18 +571,21 @@ PreserveNewest + + + @@ -665,6 +668,11 @@ + + + + + Designer diff --git a/CampusAppWP8/CampusAppWP8/Model/Setting/AppSettings.cs b/CampusAppWP8/CampusAppWP8/Model/Setting/AppSettings.cs index b1a1b976..4b062399 100644 --- a/CampusAppWP8/CampusAppWP8/Model/Setting/AppSettings.cs +++ b/CampusAppWP8/CampusAppWP8/Model/Setting/AppSettings.cs @@ -14,20 +14,6 @@ namespace CampusAppWP8.Model.Setting /// Stubbfel, 15.10.2013. public class AppSettings { - #region Enum - - /// Values that represent BTUTagDefaultHandler. - /// Stubbfel, 15.10.2013. - public enum BTUTagDefaultHandler - { - /// An enum constant representing the information page option. - InfoPage = 0, - - /// An enum constant representing the campus map option. - CampusMap = 1 - } - - #endregion #region Property /// Gets or sets a value indicating whether the GeoWatch-Flag. diff --git a/CampusAppWP8/CampusAppWP8/Model/Setting/BTUTagHandlerTypes.cs b/CampusAppWP8/CampusAppWP8/Model/Setting/BTUTagHandlerTypes.cs index 1967f073..b5586f72 100644 --- a/CampusAppWP8/CampusAppWP8/Model/Setting/BTUTagHandlerTypes.cs +++ b/CampusAppWP8/CampusAppWP8/Model/Setting/BTUTagHandlerTypes.cs @@ -16,6 +16,9 @@ namespace CampusAppWP8.Model.Setting InfoPage = 0, /// An enum constant representing the campus map option. - CampusMap = 1 + CampusMap = 1, + + /// An enum constant representing the date creation option. + DateCreation = 2 } } diff --git a/CampusAppWP8/CampusAppWP8/Model/Setting/TagHandlerListPickerItemListModel.cs b/CampusAppWP8/CampusAppWP8/Model/Setting/TagHandlerListPickerItemListModel.cs index 95383c6b..4eced32c 100644 --- a/CampusAppWP8/CampusAppWP8/Model/Setting/TagHandlerListPickerItemListModel.cs +++ b/CampusAppWP8/CampusAppWP8/Model/Setting/TagHandlerListPickerItemListModel.cs @@ -37,8 +37,9 @@ namespace CampusAppWP8.Model.Setting /// protected override void LoadList() { - this.AddItem(new ListPickerItemModel(AppSettings.BTUTagDefaultHandler.InfoPage.ToString(), AppResources.Setting_TagHandlerInfo)); - this.AddItem(new ListPickerItemModel(AppSettings.BTUTagDefaultHandler.CampusMap.ToString(), AppResources.Setting_TagHandlerMap)); + this.AddItem(new ListPickerItemModel(BTUTagDefaultHandler.InfoPage.ToString(), AppResources.Setting_TagHandlerInfo)); + this.AddItem(new ListPickerItemModel(BTUTagDefaultHandler.CampusMap.ToString(), AppResources.Setting_TagHandlerMap)); + this.AddItem(new ListPickerItemModel(BTUTagDefaultHandler.DateCreation.ToString(), AppResources.Setting_TagHandlerDate)); } #endregion diff --git a/CampusAppWP8/CampusAppWP8/Model/TimeTable/AppointmentListModel.cs b/CampusAppWP8/CampusAppWP8/Model/TimeTable/AppointmentListModel.cs index 34db3d0d..a0a43771 100644 --- a/CampusAppWP8/CampusAppWP8/Model/TimeTable/AppointmentListModel.cs +++ b/CampusAppWP8/CampusAppWP8/Model/TimeTable/AppointmentListModel.cs @@ -8,18 +8,8 @@ namespace CampusAppWP8.Model.TimeTable { - using System; - using System.Collections.Generic; using System.Collections.ObjectModel; using System.Collections.Specialized; - using System.Text.RegularExpressions; - using System.Windows.Shapes; - using System.Xml.Serialization; - using System.Windows.Controls; - using System.Windows.Media; - using System.Windows; - using CampusAppWP8.Utility; - using CampusAppWP8.Utility.ICSProperties; /// /// Model for appointments. diff --git a/CampusAppWP8/CampusAppWP8/Pages/BTUTag/BTUTagInfo.xaml.cs b/CampusAppWP8/CampusAppWP8/Pages/BTUTag/BTUTagInfo.xaml.cs index 9c9ffa4a..5efc6e82 100644 --- a/CampusAppWP8/CampusAppWP8/Pages/BTUTag/BTUTagInfo.xaml.cs +++ b/CampusAppWP8/CampusAppWP8/Pages/BTUTag/BTUTagInfo.xaml.cs @@ -48,7 +48,7 @@ namespace CampusAppWP8.Pages.BTTTag { if (NavigationMode.Back == e.NavigationMode) { - Settings.AppSetting.TagDefaultHandler = (CampusAppWP8.Model.Setting.AppSettings.BTUTagDefaultHandler)Enum.Parse(typeof(CampusAppWP8.Model.Setting.AppSettings.BTUTagDefaultHandler), ((CampusAppWPortalLib8.Model.Utility.ListPickerItemModel)this.TagHandler.SelectedItem).Value); + Settings.AppSetting.TagDefaultHandler = (CampusAppWP8.Model.Setting.BTUTagDefaultHandler)Enum.Parse(typeof(CampusAppWP8.Model.Setting.BTUTagDefaultHandler), ((CampusAppWPortalLib8.Model.Utility.ListPickerItemModel)this.TagHandler.SelectedItem).Value); } } diff --git a/CampusAppWP8/CampusAppWP8/Pages/Dev/QRScanner.xaml.cs b/CampusAppWP8/CampusAppWP8/Pages/Dev/QRScanner.xaml.cs index 9add78fa..1261966f 100644 --- a/CampusAppWP8/CampusAppWP8/Pages/Dev/QRScanner.xaml.cs +++ b/CampusAppWP8/CampusAppWP8/Pages/Dev/QRScanner.xaml.cs @@ -226,7 +226,7 @@ namespace CampusAppWP8.Pages.Dev var result = this.barcodeReader.Decode(this.bit); - if (result != null ) + if (result != null) { Dispatcher.BeginInvoke(delegate { @@ -250,19 +250,24 @@ namespace CampusAppWP8.Pages.Dev } else { - if (AppSettings.BTUTagDefaultHandler.CampusMap == Settings.AppSetting.TagDefaultHandler) + string qrContent = result.Text; + switch (Settings.AppSetting.TagDefaultHandler) { - this.GoToCampusMappage(result.Text); - } - else - { - MessageBoxResult msgResult = MessageBoxes.ShowBtuTagInfoOkCancelMessageBox(result.Text); - if (msgResult.Equals(MessageBoxResult.OK)) - { - string urlString = Constants.PathBTUTag_Info; - Uri url = new Uri(urlString as string, UriKind.Relative); - this.NavigationService.Navigate(url); - } + case BTUTagDefaultHandler.CampusMap: + this.GoToCampusMappage(qrContent); + break; + case BTUTagDefaultHandler.DateCreation: + this.GoToAppointment(qrContent); + break; + default: + MessageBoxResult msgResult = MessageBoxes.ShowBtuTagInfoOkCancelMessageBox(result.Text); + if (msgResult.Equals(MessageBoxResult.OK)) + { + string urlString = Constants.PathBTUTag_Info; + Uri url = new Uri(urlString as string, UriKind.Relative); + this.NavigationService.Navigate(url); + } + break; } } }); @@ -285,6 +290,25 @@ namespace CampusAppWP8.Pages.Dev NavigationService.Navigate(url); } + /// Go to appointment. + /// Fiedler, 15.11.2013. + /// The tag content. + private void GoToAppointment(string tagContent) + { + string pid = Wp8StringManager.FilterPlaceIdinQRResultString(tagContent); + string urlStr = Constants.PathTimeTable_AppointmentEdit + "?" + Constants.ParamPID + "=" + pid; + Uri url = new Uri(urlStr, UriKind.Relative); + + if (this.Dispatcher != null) + { + this.Dispatcher.BeginInvoke(new Action(() => NavigationService.Navigate(url))); + } + else + { + NavigationService.Navigate(url); + } + } + /// Capture thread function. /// fiedlchr, 15.10.2013. private void CaptureThreadFunc() diff --git a/CampusAppWP8/CampusAppWP8/Pages/Events/EventPage.xaml.cs b/CampusAppWP8/CampusAppWP8/Pages/Events/EventPage.xaml.cs index 8f9829bb..846b31d8 100644 --- a/CampusAppWP8/CampusAppWP8/Pages/Events/EventPage.xaml.cs +++ b/CampusAppWP8/CampusAppWP8/Pages/Events/EventPage.xaml.cs @@ -10,15 +10,19 @@ namespace CampusAppWP8.Pages.Events { using System; using System.Collections.Generic; + using System.Globalization; using System.Linq; using System.Windows; using System.Windows.Controls; using System.Windows.Navigation; - using Windows.Phone.Speech.Synthesis; + using CampusAppWP8.Model.TimeTable; using CampusAppWP8.Resources; + using CampusAppWP8.Utility; + using CampusAppWP8.Utility.ICSProperties; using CampusAppWP8.Utility.Lui.Page; using CampusAppWPortalLib8.Model.RSS; using Microsoft.Phone.Shell; + using Windows.Phone.Speech.Synthesis; /// EventPage, where every event feed has his own PivotItem. /// Stubbfel, 22.10.2013. @@ -39,6 +43,9 @@ namespace CampusAppWP8.Pages.Events /// The is in speech. private volatile bool isInSpeech = false; + /// The event model. + private RSSModel eventModel; + #endregion #region Constructor @@ -57,10 +64,16 @@ namespace CampusAppWP8.Pages.Events ApplicationBarIconButton ttsBtn = new ApplicationBarIconButton(); ttsBtn.IconUri = new Uri(Icons.TextToSpeech, UriKind.Relative); - ttsBtn.Text = AppResources.TextToSpeech_Btn; + ttsBtn.Text = AppResources.Add; ttsBtn.Click += new EventHandler(this.EventTextToSpeech_Click); ApplicationBar.Buttons.Add(ttsBtn); + ApplicationBarIconButton addCalBtn = new ApplicationBarIconButton(); + addCalBtn.IconUri = new Uri(Icons.Calendar_Add, UriKind.Relative); + addCalBtn.Text = AppResources.TextToSpeech_Btn; + addCalBtn.Click += new EventHandler(this.AddCalender_Click); + ApplicationBar.Buttons.Add(addCalBtn); + this.isNewInstance = true; this.synth = new SpeechSynthesizer(); @@ -229,6 +242,78 @@ namespace CampusAppWP8.Pages.Events } } + /// Event handler. Called by AddCalendar for click events. + /// Stubbfel, 19.11.2013. + /// parent pivot object. + /// Routed event information. + private void AddCalender_Click(object sender, EventArgs e) + { + this.eventModel = EventIndexPage.GetEventFeed().Model.Channel[0].Item[this.EventPivot.SelectedIndex]; + AppointmentModel appoinment = this.CreateAppointment(this.eventModel); + string urlString = Constants.PathTimeTable_AppointmentEdit; + + if (appoinment != null) + { + App.SaveToIsolatedStorage(Constants.IsolatedStorage_EventAppointment, ICSManager.ExportToICS(appoinment.CalendarObj)); + urlString += "?" + Constants.ParamIsoKey + "=" + Constants.IsolatedStorage_EventAppointment; + } + + Uri url = new Uri(urlString as string, UriKind.Relative); + NavigationService.Navigate(url); + } + + /// Creates an appointment. + /// Stubbfel, 19.11.2013. + /// The event model. + /// The new appointment. + private AppointmentModel CreateAppointment(RSSModel eventModel) + { + if (eventModel == null) + { + return null; + } + + CultureInfo german = Wp8StringManager.GermanCulture; + AppointmentModel appoinment = new AppointmentModel(); + DateTime time = eventModel.DTTimestamp; + DTStart start = new DTStart(); + start.Value = time; + + string dateValue = eventModel.Title; + + if (dateValue != null) + { + Summary summary = new Summary(); + summary.Value = dateValue; + appoinment.SetValue(summary); + } + + // set cat + Categories category = new Categories(); + category.AddCategory("Veranstaltung"); + appoinment.SetValue(category); + + // set description + dateValue = this.eventModel.Text; + if (dateValue != null) + { + Description desc = new Description(); + desc.Value = dateValue; + appoinment.SetValue(desc); + } + + // set url + dateValue = this.eventModel.Link; + if (dateValue != null) + { + Url url = new Url(); + url.Value = dateValue; + appoinment.SetValue(url); + } + + return appoinment; + } + #endregion #endregion diff --git a/CampusAppWP8/CampusAppWP8/Pages/Lecture/ResultDetailPage.xaml b/CampusAppWP8/CampusAppWP8/Pages/Lecture/ResultDetailPage.xaml index c6a55cfc..cd59b504 100644 --- a/CampusAppWP8/CampusAppWP8/Pages/Lecture/ResultDetailPage.xaml +++ b/CampusAppWP8/CampusAppWP8/Pages/Lecture/ResultDetailPage.xaml @@ -70,6 +70,44 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/CampusAppWP8/CampusAppWP8/Pages/Lecture/ResultDetailPage.xaml.cs b/CampusAppWP8/CampusAppWP8/Pages/Lecture/ResultDetailPage.xaml.cs index dd005180..6372a99a 100644 --- a/CampusAppWP8/CampusAppWP8/Pages/Lecture/ResultDetailPage.xaml.cs +++ b/CampusAppWP8/CampusAppWP8/Pages/Lecture/ResultDetailPage.xaml.cs @@ -8,16 +8,31 @@ //----------------------------------------------------------------------- namespace CampusAppWP8.Pages.Lecture { + using System; + using System.Collections.Generic; + using System.Globalization; + using System.Windows; using System.Windows.Navigation; using CampusAppWP8.Model.Lecture; + using CampusAppWP8.Model.TimeTable; using CampusAppWP8.Resources; - using Microsoft.Phone.Controls; + using CampusAppWP8.Utility; + using CampusAppWP8.Utility.ICSProperties; + using CampusAppWPortalLib8.Model.Lecture; + using Microsoft.Phone.Controls; /// Class for the page which shows details of an activity. /// Stubbfel, 15.10.2013. /// public partial class ResultDetailPage : PhoneApplicationPage { + #region Member + + /// The activity. + private LectureWp8Activity activity; + + #endregion + #region Constructor /// Initializes a new instance of the class. @@ -54,18 +69,220 @@ namespace CampusAppWP8.Pages.Lecture /// Method load a certain Activity from the model. /// Stubbfel, 15.10.2013. /// id of the activity. - private void LoadActivity(int activityId) + private void LoadActivity(int activityId) { LectureWp8List list = App.LoadFromIsolatedStorage(Constants.IsolatedStorage_LectureModel); if (list != null) { - LectureWp8Activity activity = list.GetActivity(activityId); - activity.CreateLectureString(); - activity.CreateCourseString(); - this.ContentPanel.DataContext = activity; + this.activity = list.GetActivity(activityId); + this.activity.CreateLectureString(); + this.activity.CreateCourseString(); + this.ContentPanel.DataContext = this.activity; } } + /// Event handler. Called by AddCalendar for click events. + /// Stubbfel, 18.11.2013. + /// Source of the event. + /// Routed event information. + private void AddCalender_Click(object sender, System.Windows.RoutedEventArgs e) + { + FrameworkElement btn = sender as FrameworkElement; + if (btn == null) + { + return; + } + + string dateId = btn.Tag.ToString(); + LectureDate date = this.activity.GetDate(dateId); + AppointmentModel appoinment = this.CreateAppointment(date); + string urlString = Constants.PathTimeTable_AppointmentEdit; + + if (appoinment != null) + { + App.SaveToIsolatedStorage(Constants.IsolatedStorage_LectureAppointment, ICSManager.ExportToICS(appoinment.CalendarObj)); + urlString += "?" + Constants.ParamIsoKey + "=" + Constants.IsolatedStorage_LectureAppointment; + } + + Uri url = new Uri(urlString as string, UriKind.Relative); + NavigationService.Navigate(url); + } + + /// Creates an appointment. + /// Stubbfel, 19.11.2013. + /// The date. + /// The new appointment. + private AppointmentModel CreateAppointment(LectureDate date) + { + if (date == null) + { + return null; + } + + CultureInfo german = Wp8StringManager.GermanCulture; + AppointmentModel appoinment = new AppointmentModel(); + DTStart start; + DateTime dtStart; + TimeSpan fromTime; + DTEnd end; + DateTime dtEnd; + TimeSpan toTime; + TimeSpan duration = TimeSpan.FromTicks(0); + RecurrenceRule rRule; + + // set the room + string dateValue = date.Room; + if (dateValue != null) + { + Location location = new Location(); + location.Value = dateValue; + appoinment.SetValue(location); + } + + if (this.activity != null) + { + // set Tilte + dateValue = this.activity.Title; + + if (dateValue != null) + { + Summary summary = new Summary(); + summary.Value = dateValue; + appoinment.SetValue(summary); + } + + // set cat + dateValue = this.activity.Type; + if (dateValue != null) + { + Categories category = new Categories(); + category.AddCategory(dateValue); + appoinment.SetValue(category); + } + + // set description + dateValue = this.activity.Topic; + if (dateValue != null) + { + Description desc = new Description(); + desc.Value = dateValue; + appoinment.SetValue(desc); + } + + // set orignazier + dateValue = this.activity.LecturerString; + if (dateValue != null) + { + Organizer org = new Organizer(); + org.Value = dateValue; + appoinment.SetValue(org); + } + } + + // set the startdate + dateValue = date.StartDate; + start = new DTStart(); + if (dateValue != null) + { + try + { + dtStart = DateTime.Parse(dateValue, german); + } + catch + { + dtStart = DateTime.Today; + } + } + else + { + dtStart = DateTime.Today; + } + + dateValue = date.From; + if (dateValue != null) + { + try + { + fromTime = TimeSpan.Parse(dateValue, german); + dtStart = dtStart.Add(fromTime); + duration = fromTime; + } + catch + { + } + } + + start.Value = dtStart; + appoinment.SetValue(start); + + // set the end date + dateValue = date.EndDate; + end = new DTEnd(); + if (dateValue != null) + { + try + { + dtEnd = DateTime.Parse(dateValue, german); + } + catch + { + dtEnd = DateTime.Today; + } + } + else + { + dtEnd = DateTime.Today; + } + + dateValue = date.To; + if (dateValue != null) + { + try + { + toTime = TimeSpan.Parse(dateValue, german); + dtEnd = dtEnd.Add(toTime); + duration = toTime - duration; + } + catch + { + } + } + + end.Value = dtEnd; + appoinment.SetValue(end); + + // set the duration + CampusAppWP8.Utility.ICSProperties.Duration icsDuration = new Utility.ICSProperties.Duration(); + icsDuration.Value = duration; + appoinment.SetValue(icsDuration); + + // set the RRule + rRule = new RecurrenceRule(); + rRule.Value.Add(new Tuple>(ICSValue.FREQ, new List() { ICSValueValue.WEEKLY })); + + // set by the week + dateValue = date.WeekDay; + if (dateValue != null) + { + DayOfWeek weekDay = Wp8StringManager.ToDayofWeek(dateValue, german); + rRule.Value.Add(new Tuple>(ICSValue.BY_DAY, new List() { ICSValueValue.ToICSWeekDay(weekDay) })); + } + + // set interval + dateValue = date.Interval; + if (dateValue != null) + { + string lowVal = dateValue.ToLower(); + if (lowVal.Contains("a") ^ lowVal.Contains("b")) + { + rRule.Value.Add(new Tuple>(ICSValue.INTERVAL, new List() { "2" })); + } + } + + appoinment.SetValue(rRule); + + return appoinment; + } #endregion #endregion diff --git a/CampusAppWP8/CampusAppWP8/Pages/Setting/AppSettingPage.xaml.cs b/CampusAppWP8/CampusAppWP8/Pages/Setting/AppSettingPage.xaml.cs index 6d6c6f86..3527c4a9 100644 --- a/CampusAppWP8/CampusAppWP8/Pages/Setting/AppSettingPage.xaml.cs +++ b/CampusAppWP8/CampusAppWP8/Pages/Setting/AppSettingPage.xaml.cs @@ -50,7 +50,7 @@ namespace CampusAppWP8.Pages.Setting { Settings.AppSetting.GeoWatchEnable = GeoWatchToggle.IsChecked.Value; Settings.AppSetting.OnlyWifi = OnlyWiFiToggle.IsChecked.Value; - Settings.AppSetting.TagDefaultHandler = (CampusAppWP8.Model.Setting.AppSettings.BTUTagDefaultHandler)Enum.Parse(typeof(CampusAppWP8.Model.Setting.AppSettings.BTUTagDefaultHandler), ((CampusAppWPortalLib8.Model.Utility.ListPickerItemModel)this.TagHandler.SelectedItem).Value); + Settings.AppSetting.TagDefaultHandler = (CampusAppWP8.Model.Setting.BTUTagDefaultHandler)Enum.Parse(typeof(CampusAppWP8.Model.Setting.BTUTagDefaultHandler), ((CampusAppWPortalLib8.Model.Utility.ListPickerItemModel)this.TagHandler.SelectedItem).Value); } } diff --git a/CampusAppWP8/CampusAppWP8/Pages/StartPage.xaml b/CampusAppWP8/CampusAppWP8/Pages/StartPage.xaml index 99b2348a..2e3e784e 100644 --- a/CampusAppWP8/CampusAppWP8/Pages/StartPage.xaml +++ b/CampusAppWP8/CampusAppWP8/Pages/StartPage.xaml @@ -18,231 +18,267 @@ - - - - + + + + - - - - - - - + + + + + + + + + + + + + + + + + + - - - - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + - - - - - - - - - - - - + + + + + + + + + + + + + + - - - - - - - - - - - - - + + + + + + + + + + + + + + - + + + + + + + + + + + + + + - - - - - - - + + + + + + + + + + + + + + + + + - + + + + + + + + + + - - - - - - - - - - - - - - - + + + + + + + + + + + + - - - - - - - - - - - - + + + + + + + + + + + + - - - - - - - - - - - - - + + + + + + + + + + + + - + + + + + + + - - - - - - - + + + + + + + + + + + + + + + - - - - - - - - - - - - + + + + + + + + + + + + - - - - - - - - - - - - + + - - - - - - - - - - - - - + + + + + + + - + + + + + + + + + + + + - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + - + + + + + + + + + + + + + + - - + + + --> + + + + + + + + + + + + + + + + + + - - - - - - - - - - - - - + + \ No newline at end of file diff --git a/CampusAppWP8/CampusAppWP8/Pages/StartPage.xaml.cs b/CampusAppWP8/CampusAppWP8/Pages/StartPage.xaml.cs index 972a122b..2b55eb1e 100644 --- a/CampusAppWP8/CampusAppWP8/Pages/StartPage.xaml.cs +++ b/CampusAppWP8/CampusAppWP8/Pages/StartPage.xaml.cs @@ -54,52 +54,6 @@ namespace CampusAppWP8.Pages { this.InitializeComponent(); - ApplicationBarMenuItem menuItem1 = ApplicationBar.MenuItems[0] as ApplicationBarMenuItem; - ApplicationBarMenuItem menuItem2 = ApplicationBar.MenuItems[1] as ApplicationBarMenuItem; - ApplicationBarMenuItem menuItem3 = ApplicationBar.MenuItems[2] as ApplicationBarMenuItem; - ApplicationBarMenuItem menuItem4 = ApplicationBar.MenuItems[3] as ApplicationBarMenuItem; - ApplicationBarMenuItem menuItem5 = ApplicationBar.MenuItems[4] as ApplicationBarMenuItem; - ApplicationBarMenuItem menuItem6 = ApplicationBar.MenuItems[5] as ApplicationBarMenuItem; - - if (menuItem1 != null) - { - menuItem1.Text = AppResources.Setting_UserProfilAppBarTitle; - } - - if (menuItem2 != null) - { - menuItem2.Text = AppResources.Setting_ApplAppBarTitle; - } - - if (menuItem3 != null) - { - menuItem3.Text = AppResources.App_ScanQR; - } - - if (menuItem4 != null) - { - menuItem4.Text = AppResources.App_ScanNfc; - } - - if (menuItem5 != null) - { - menuItem5.Text = AppResources.Setting_ImpressumTitle; - } - else - { - /* - ApplicationBar.MenuItems.RemoveAt(ApplicationBar.MenuItems.Count - 1); - ApplicationBar.MenuItems.RemoveAt(ApplicationBar.MenuItems.Count - 1); - */ - ApplicationBar.MenuItems.Remove(menuItem3); - ApplicationBar.MenuItems.Remove(menuItem4); - } - - if (menuItem6 != null) - { - menuItem6.Text = AppResources.TimeTableApp_Title; - } - TimeTable.TimeTable.InitFeed(); @@ -127,7 +81,7 @@ namespace CampusAppWP8.Pages #region protected - /// Methods overrides the OnNavigatedTo-Method. + /// Methods overrides the OnNavigatedTo-Method. /// Stubbfel, 15.10.2013. /// protected override void OnNavigatedTo(NavigationEventArgs e) @@ -136,7 +90,7 @@ namespace CampusAppWP8.Pages if (device != null) { this.ndefId = this.device.SubscribeForMessage(Constants.NCFMessageType_NDEF, this.NDEFHandler); - } + } } /// Methods overrides the OnNavigatedFrom-Method. @@ -171,138 +125,13 @@ namespace CampusAppWP8.Pages this.initCourseList.SaveData(); } - /// Raises the orientation changed event. - /// Fiedler, 22.10.2013. - /// - /// ### Event information to send to registered event handlers. - protected override void OnSwitchedToPortrait(OrientationChangedEventArgs e) - { - base.OnSwitchedToPortrait(e); - - this.ApplicationBar.Opacity = 0.5; - - //this.ContentPanel.Margin = new Thickness(12, 0, 12, 12); - //this.AppTitle.Margin = new Thickness(12, 17, 0, 28); - - if (!this.Row0.Children.Contains(this.MailAppButton) - && !this.Row1.Children.Contains(this.OpenHoursAppButton) - && !this.Row2.Children.Contains(this.LinkAppButton)) - { - return; - } - - this.Row0.Children.Remove(this.MailAppButton); - this.Row3.Children.Add(this.MailAppButton); - this.MailAppButton.SetValue(Grid.ColumnProperty, 0); - - this.Row1.Children.Remove(this.OpenHoursAppButton); - this.Row3.Children.Add(this.OpenHoursAppButton); - this.OpenHoursAppButton.SetValue(Grid.ColumnProperty, 1); - - this.Row2.Children.Remove(this.LinkAppButton); - this.Row3.Children.Add(this.LinkAppButton); - this.LinkAppButton.SetValue(Grid.ColumnProperty, 2); - } - - /// Raises the orientation changed event. - /// Fiedler, 22.10.2013. - /// - /// ### Event information to send to registered event handlers. - protected override void OnSwitchedToLandscape(OrientationChangedEventArgs e) - { - base.OnSwitchedToLandscape(e); - - this.ApplicationBar.Opacity = 1.0; - - //this.ContentPanel.Margin = new Thickness(76, -24, 24, 0); // LandscapeRight - //this.ContentPanel.Margin = new Thickness(24, -24, 76, 0); // LandscapeLeft - //this.AppTitle.Margin = new Thickness(12, 17, 0, 28); - - if (!this.Row3.Children.Contains(this.MailAppButton) - && !this.Row3.Children.Contains(this.OpenHoursAppButton) - && !this.Row3.Children.Contains(this.LinkAppButton)) - { - return; - } - - this.Row3.Children.Remove(this.MailAppButton); - this.Row0.Children.Add(this.MailAppButton); - this.MailAppButton.SetValue(Grid.ColumnProperty, 3); - - this.Row3.Children.Remove(this.OpenHoursAppButton); - this.Row1.Children.Add(this.OpenHoursAppButton); - this.OpenHoursAppButton.SetValue(Grid.ColumnProperty, 3); - - this.Row3.Children.Remove(this.LinkAppButton); - this.Row2.Children.Add(this.LinkAppButton); - this.LinkAppButton.SetValue(Grid.ColumnProperty, 3); - } - /// Method Navigate to /// Stubbfel, 15.10.2013. /// Caller of the function. /// some EventArgs. - private void ApplicationBarMenuItem_Click(object sender, EventArgs e) - { - Uri url = new Uri(Constants.PathSetting_User, UriKind.Relative); - NavigationService.Navigate(url); - } - - /// Method Navigate to - /// Stubbfel, 15.10.2013. - /// Caller of the function. - /// some EventArgs. - private void ApplicationBarMenuItem2_Click(object sender, EventArgs e) - { - Uri url = new Uri(Constants.PathSetting_App, UriKind.Relative); - NavigationService.Navigate(url); - } - - /// Method Navigate to - /// Stubbfel, 15.10.2013. - /// Caller of the function. - /// some EventArgs. - private void ApplicationBarMenuItem4_Click(object sender, EventArgs e) + private void NFCButton_Click(object sender,RoutedEventArgs e) { MessageBoxes.ShowMainModelInfoMessageBox(AppResources.ScarNfc_Search); - // this.device.StopSubscribingForMessage(this.ndefId); - // this.ndefId = this.device.SubscribeForMessage(Constants.NCFMessageType_NDEF, this.NDEFHandler); - } - - /// Event handler. Called by ApplicationBarMenuItem5 for click events. - /// Stubbfel, 14.10.2013. - /// Caller of the function. - /// Event information. - private void ApplicationBarMenuItem5_Click(object sender, EventArgs e) - { - Uri url = new Uri("/Pages/Setting/Impressum.xaml", UriKind.Relative); - NavigationService.Navigate(url); - } - - /// Event handler. Called by ApplicationBarMenuItem4 for click events. - /// Stubbfel, 15.10.2013. - /// Caller of the function. - /// Event information. - private void ApplicationBarMenuItem3_Click(object sender, EventArgs e) - { - Uri url = new Uri("/Pages/Dev/QRScanner.xaml", UriKind.Relative); - NavigationService.Navigate(url); - } - - /// Method change the Opacity of the ApplicationBar. - /// Stubbfel, 15.10.2013. - /// Caller of the function. - /// some EventArgs. - private void ApplicationBar_StateChanged(object sender, ApplicationBarStateChangedEventArgs e) - { - if (e.IsMenuVisible) - { - ApplicationBar.Opacity = 0.99; - } - else - { - ApplicationBar.Opacity = 0.5; - } } /// Method show all OptIns. @@ -396,6 +225,15 @@ namespace CampusAppWP8.Pages case "placeNewsAppButton": TileCreator.CreatePlaceNewsTile(); break; + case "QRButton": + TileCreator.CreateQRTile(); + break; + case "NFCButton": + TileCreator.CreateNFCTile(); + break; + case "TimeTableAppButton": + TileCreator.CreateTimeTableTile(); + break; } } @@ -437,25 +275,25 @@ namespace CampusAppWP8.Pages } else { - this.GoToAppointment(nfcContent); - /* removed for testing - if (AppSettings.BTUTagDefaultHandler.CampusMap == Settings.AppSetting.TagDefaultHandler) + switch (Settings.AppSetting.TagDefaultHandler) { - // search for placeId - this.GoToCampusMappage(nfcContent); + case BTUTagDefaultHandler.CampusMap: + this.GoToCampusMappage(nfcContent); + break; + case BTUTagDefaultHandler.DateCreation: + this.GoToAppointment(nfcContent); + break; + default: + if (this.Dispatcher != null) + { + this.Dispatcher.BeginInvoke(new Action(() => this.ShowBtuTagMessageBox())); + } + else + { + this.ShowBtuTagMessageBox(); + } + break; } - else - { - if (this.Dispatcher != null) - { - this.Dispatcher.BeginInvoke(new Action(() => this.ShowBtuTagMessageBox())); - } - else - { - this.ShowBtuTagMessageBox(); - } - } - */ } this.ndefId = this.device.SubscribeForMessage(Constants.NCFMessageType_NDEF, this.NDEFHandler); @@ -515,18 +353,6 @@ namespace CampusAppWP8.Pages #endregion - private void ApplicationBarMenuItem_Click_1(object sender, EventArgs e) - { - Uri url = new Uri(Constants.PathTimeTable_Day, UriKind.Relative); - NavigationService.Navigate(url); - } - #endregion - - private void ApplicationBarMenuItem_Click_2(object sender, EventArgs e) - { - Uri url = new Uri("/Pages/Dev/NFC.xaml", UriKind.Relative); - NavigationService.Navigate(url); - } } } \ No newline at end of file diff --git a/CampusAppWP8/CampusAppWP8/Pages/TimeTable/AppointmentEdit.xaml.cs b/CampusAppWP8/CampusAppWP8/Pages/TimeTable/AppointmentEdit.xaml.cs index 952a1922..b6c72ced 100644 --- a/CampusAppWP8/CampusAppWP8/Pages/TimeTable/AppointmentEdit.xaml.cs +++ b/CampusAppWP8/CampusAppWP8/Pages/TimeTable/AppointmentEdit.xaml.cs @@ -70,6 +70,7 @@ namespace CampusAppWP8.Pages.TimeTable string appointmentIndexStr = string.Empty; string pid = string.Empty; + string isoStr = string.Empty; // Navigate to the selected pivotitem @@ -130,6 +131,16 @@ namespace CampusAppWP8.Pages.TimeTable } } } + else if (NavigationContext.QueryString.TryGetValue(Constants.ParamIsoKey, out isoStr)) + { + string appointmentStr = App.LoadFromIsolatedStorage(isoStr); + + AppointmentModel newModel = new AppointmentModel(appointmentStr); + + this.InTitle.Text = newModel.Title; + this.InLocation.Text = newModel.Location; + //TODO + } else { this.HeadLine.Text = AppResources.Creating; diff --git a/CampusAppWP8/CampusAppWP8/Properties/WMAppManifest.xml b/CampusAppWP8/CampusAppWP8/Properties/WMAppManifest.xml index 288b01c9..dc2c9908 100644 --- a/CampusAppWP8/CampusAppWP8/Properties/WMAppManifest.xml +++ b/CampusAppWP8/CampusAppWP8/Properties/WMAppManifest.xml @@ -17,25 +17,27 @@ - + Assets\ApplicationIcon.png - 0 - Assets\ApplicationIcon.png BTU CampusApp - - - - + Assets\Slides\Slide1.jpg + Assets\Slides\Slide2.jpg + Assets\Slides\Slide3.jpg + Assets\Slides\Slide4.jpg + Assets\Slides\Slide5.jpg + + + + + + + + + 0 True - - - - - - - + diff --git a/CampusAppWP8/CampusAppWP8/Resources/AppResources.Designer.cs b/CampusAppWP8/CampusAppWP8/Resources/AppResources.Designer.cs index 1defd00d..24cf4571 100644 --- a/CampusAppWP8/CampusAppWP8/Resources/AppResources.Designer.cs +++ b/CampusAppWP8/CampusAppWP8/Resources/AppResources.Designer.cs @@ -555,6 +555,15 @@ namespace CampusAppWP8.Resources { } } + /// + /// Sucht eine lokalisierte Zeichenfolge, die Veranstaltungstermine ähnelt. + /// + public static string LectureApp_LectureDates { + get { + return ResourceManager.GetString("LectureApp_LectureDates", resourceCulture); + } + } + /// /// Sucht eine lokalisierte Zeichenfolge, die Veranstaltungsname ähnelt. /// @@ -1230,6 +1239,15 @@ namespace CampusAppWP8.Resources { } } + /// + /// Sucht eine lokalisierte Zeichenfolge, die Termin erstellen ähnelt. + /// + public static string Setting_TagHandlerDate { + get { + return ResourceManager.GetString("Setting_TagHandlerDate", resourceCulture); + } + } + /// /// Sucht eine lokalisierte Zeichenfolge, die BTU-Tag-Informationsseite anzeigen ähnelt. /// diff --git a/CampusAppWP8/CampusAppWP8/Resources/AppResources.resx b/CampusAppWP8/CampusAppWP8/Resources/AppResources.resx index 4d494990..ca8f1dbc 100644 --- a/CampusAppWP8/CampusAppWP8/Resources/AppResources.resx +++ b/CampusAppWP8/CampusAppWP8/Resources/AppResources.resx @@ -617,4 +617,10 @@ Wochenplan + + Termin erstellen + + + Veranstaltungstermine + \ No newline at end of file diff --git a/CampusAppWP8/CampusAppWP8/Resources/Constants.resx b/CampusAppWP8/CampusAppWP8/Resources/Constants.resx index a7a62d34..34d6095c 100644 --- a/CampusAppWP8/CampusAppWP8/Resources/Constants.resx +++ b/CampusAppWP8/CampusAppWP8/Resources/Constants.resx @@ -609,4 +609,16 @@ http://www.tu-cottbus.de/campusapp-data/canteens.php?v=1 + + isolated + + + LectureAppointment + + + EventAppointment + + + /Pages/Setting/Impressum.xaml + \ No newline at end of file diff --git a/CampusAppWP8/CampusAppWP8/Resources/Constants1.Designer.cs b/CampusAppWP8/CampusAppWP8/Resources/Constants1.Designer.cs index ea41e3aa..58946cba 100644 --- a/CampusAppWP8/CampusAppWP8/Resources/Constants1.Designer.cs +++ b/CampusAppWP8/CampusAppWP8/Resources/Constants1.Designer.cs @@ -474,6 +474,15 @@ namespace CampusAppWP8.Resources { } } + /// + /// Sucht eine lokalisierte Zeichenfolge, die EventAppointment ähnelt. + /// + public static string IsolatedStorage_EventAppointment { + get { + return ResourceManager.GetString("IsolatedStorage_EventAppointment", resourceCulture); + } + } + /// /// Sucht eine lokalisierte Zeichenfolge, die IsolatedStorage_EventRSSModel ähnelt. /// @@ -483,6 +492,15 @@ namespace CampusAppWP8.Resources { } } + /// + /// Sucht eine lokalisierte Zeichenfolge, die LectureAppointment ähnelt. + /// + public static string IsolatedStorage_LectureAppointment { + get { + return ResourceManager.GetString("IsolatedStorage_LectureAppointment", resourceCulture); + } + } + /// /// Sucht eine lokalisierte Zeichenfolge, die LectureModel ähnelt. /// @@ -681,6 +699,15 @@ namespace CampusAppWP8.Resources { } } + /// + /// Sucht eine lokalisierte Zeichenfolge, die isolated ähnelt. + /// + public static string ParamIsoKey { + get { + return ResourceManager.GetString("ParamIsoKey", resourceCulture); + } + } + /// /// Sucht eine lokalisierte Zeichenfolge, die ActivityId ähnelt. /// @@ -1023,6 +1050,15 @@ namespace CampusAppWP8.Resources { } } + /// + /// Sucht eine lokalisierte Zeichenfolge, die /Pages/Setting/Impressum.xaml ähnelt. + /// + public static string PathSetting_Impressum { + get { + return ResourceManager.GetString("PathSetting_Impressum", resourceCulture); + } + } + /// /// Sucht eine lokalisierte Zeichenfolge, die /Pages/Setting/UserProfil.xaml ähnelt. /// diff --git a/CampusAppWP8/CampusAppWP8/Resources/Icons.cs b/CampusAppWP8/CampusAppWP8/Resources/Icons.cs index 3ee4d28a..d59a36d1 100644 --- a/CampusAppWP8/CampusAppWP8/Resources/Icons.cs +++ b/CampusAppWP8/CampusAppWP8/Resources/Icons.cs @@ -44,6 +44,17 @@ namespace CampusAppWP8.Resources } } + /// + /// Gets the uri string of the Calendar_Add icon. + /// + public static string Calendar_Add + { + get + { + return Themerize("stundenplan_add_159.png"); + } + } + /// /// Gets the uri string of the Campus icon. /// diff --git a/CampusAppWP8/CampusAppWP8/Resources/Icons.resx b/CampusAppWP8/CampusAppWP8/Resources/Icons.resx index c218a974..37370a4d 100644 --- a/CampusAppWP8/CampusAppWP8/Resources/Icons.resx +++ b/CampusAppWP8/CampusAppWP8/Resources/Icons.resx @@ -123,6 +123,9 @@ add_contact_159.png + + stundenplan_add_159.png + campus_159.png diff --git a/CampusAppWP8/CampusAppWP8/Styles/StartPageStyles.xaml b/CampusAppWP8/CampusAppWP8/Styles/StartPageStyles.xaml index 1aec455a..c6db84ac 100644 --- a/CampusAppWP8/CampusAppWP8/Styles/StartPageStyles.xaml +++ b/CampusAppWP8/CampusAppWP8/Styles/StartPageStyles.xaml @@ -6,25 +6,52 @@ mc:Ignorable="d"> + + + + + + + \ No newline at end of file diff --git a/CampusAppWP8/CampusAppWP8/Utility/ICSObjectConst.cs b/CampusAppWP8/CampusAppWP8/Utility/ICSObjectConst.cs index 7652bf37..e63d51d0 100644 --- a/CampusAppWP8/CampusAppWP8/Utility/ICSObjectConst.cs +++ b/CampusAppWP8/CampusAppWP8/Utility/ICSObjectConst.cs @@ -15,7 +15,7 @@ namespace CampusAppWP8.Utility public class ICSDesc { private string name = string.Empty; - + public ICSDesc() { } @@ -32,7 +32,7 @@ namespace CampusAppWP8.Utility } } - public bool Is(string tag) + public bool Is(string tag) { return this.name.Equals(tag); } @@ -41,14 +41,15 @@ namespace CampusAppWP8.Utility public class ICSParamDesc : ICSDesc { private List types = null; - - public ICSParamDesc(string name, string[] typeList) : base() + + public ICSParamDesc(string name, string[] typeList) + : base() { this.Name = name; - if((typeList != null) && (typeList.Length > 0)) + if ((typeList != null) && (typeList.Length > 0)) { - this.types = new List(); + this.types = new List(); this.types.AddRange(types); } } @@ -75,11 +76,12 @@ namespace CampusAppWP8.Utility { private List subs = null; - public ICSValueDesc(string name, ICSElemDesc[] elemList) : base() + public ICSValueDesc(string name, ICSElemDesc[] elemList) + : base() { this.Name = name; - if((elemList != null) && (elemList.Length > 0)) + if ((elemList != null) && (elemList.Length > 0)) { this.subs = new List(); this.subs.AddRange(elemList); @@ -146,11 +148,12 @@ namespace CampusAppWP8.Utility private List value = null; private Type objType; - public ICSElemDesc(Type t, ICSValueDesc[] valueList) : base() + public ICSElemDesc(Type t, ICSValueDesc[] valueList) + : base() { this.objType = t; this.Name = (this.CreateObj() as ICSClasses.Interface).GetName(); - + if ((valueList != null) && (valueList.Length > 0)) { this.value = new List(); @@ -221,7 +224,7 @@ namespace CampusAppWP8.Utility object retValue = this.CreateObj(); (retValue as ICSClasses.Interface).Set(valueString, paramString); - + return retValue; } @@ -450,7 +453,7 @@ namespace CampusAppWP8.Utility { public const string BEGIN = "BEGIN"; - public const string END = "END"; + public const string END = "END"; // Calendar Components public const string VCALENDAR = "VCALENDAR"; @@ -462,7 +465,7 @@ namespace CampusAppWP8.Utility public const string METHOD = "METHOD"; // 0-* public const string X_WR_CALNAME = "X-WR-CALNAME"; - + // Event Component public const string VEVENT = "VEVENT"; // 1-1 @@ -523,7 +526,7 @@ namespace CampusAppWP8.Utility // DT_MODIFIED public const string TIME_ZONE_URL = "TZURL"; // one of both MUST occure: 1-* - + // Time Zone: Standardc/Daylightc public const string STANDARD = "STANDARD"; public const string DAYLIGHT = "DAYLIGHT"; @@ -570,14 +573,14 @@ namespace CampusAppWP8.Utility // REPEAT // 0-* // ATTACH - - - - - - + + + + + + // ??? - + // public const string RELATED_TO = "RELATED-TO"; public const string SEQUENCE = "SEQUENCE"; } @@ -585,7 +588,7 @@ namespace CampusAppWP8.Utility public class ICSParam { // see http://tools.ietf.org/html/rfc5545 3.2. - + public const string ALT_REPRESENTATION = "ALTREP"; public const string COMMON_NAME = "CN"; public const string CALENDAR_USER_TYPE = "CUTYPE"; @@ -730,12 +733,39 @@ namespace CampusAppWP8.Utility public const string DATE = "DATE"; public const string DATE_TIME = "DATE-TIME"; // ... - public const string DAY_SU = "SU"; + public const string DAY_SU = "SU"; public const string DAY_MO = "MO"; public const string DAY_TU = "TU"; public const string DAY_WE = "WE"; public const string DAY_TH = "TH"; public const string DAY_FR = "FR"; public const string DAY_SA = "SA"; + + /// Converts a day to the ics week day. + /// Stubbfel, 19.11.2013. + /// The day. + /// day as a string. + public static string ToICSWeekDay(DayOfWeek day) + { + switch (day) + { + case DayOfWeek.Sunday: + return ICSValueValue.DAY_SU; + case DayOfWeek.Monday: + return ICSValueValue.DAY_MO; + case DayOfWeek.Tuesday: + return ICSValueValue.DAY_TU; + case DayOfWeek.Wednesday: + return ICSValueValue.DAY_WE; + case DayOfWeek.Thursday: + return ICSValueValue.DAY_TH; + case DayOfWeek.Friday: + return ICSValueValue.DAY_FR; + case DayOfWeek.Saturday: + return ICSValueValue.DAY_SA; + default: + return null; + } + } } } diff --git a/CampusAppWP8/CampusAppWP8/Utility/Lui/Tiles/TileCreator.cs b/CampusAppWP8/CampusAppWP8/Utility/Lui/Tiles/TileCreator.cs index ba0fe5aa..d2ccdae3 100644 --- a/CampusAppWP8/CampusAppWP8/Utility/Lui/Tiles/TileCreator.cs +++ b/CampusAppWP8/CampusAppWP8/Utility/Lui/Tiles/TileCreator.cs @@ -12,6 +12,7 @@ namespace CampusAppWP8.Utility.Lui.Tiles using System.Linq; using CampusAppWP8.Resources; using Microsoft.Phone.Shell; + using CampusAppWP8.Model.Setting; /// Class creates different live tiles. /// Stubbfel, 15.10.2013. @@ -147,5 +148,43 @@ namespace CampusAppWP8.Utility.Lui.Tiles { TileCreator.CreateIconicTile(AppResources.CampusMapApp_Title, Constants.PathCampusmap_Campusmap, Icons.Campus, Icons.Campus); } + + /// Creates time table tile. + /// Stubbfel, 21.11.2013. + public static void CreateTimeTableTile() + { + TileCreator.CreateIconicTile(AppResources.TimeTableApp_Title, Constants.PathTimeTable_Week, Icons.Schedule, Icons.Schedule); + } + + /// Creates qr tile. + /// Stubbfel, 21.11.2013. + public static void CreateQRTile() + { + TileCreator.CreateIconicTile(AppResources.App_ScanQR, Constants.PathQR_QRPage, Icons.Favorite, Icons.Favorite); + } + + /// Creates nfc tile. + /// Stubbfel, 21.11.2013. + public static void CreateNFCTile() + { + string path; + string name = "NFC -> "; + switch (Settings.AppSetting.TagDefaultHandler) + { + case BTUTagDefaultHandler.CampusMap: + path = Constants.PathCampusmap_Campusmap; + name += AppResources.CampusMapApp_Title; + break; + case BTUTagDefaultHandler.DateCreation: + path = Constants.PathTimeTable_Week; + name += AppResources.TimeTableApp_Title; + break; + default: + path = Constants.PathBTUTag_Info; + name += AppResources.BTUTag_Title; + break; + } + TileCreator.CreateIconicTile(name, path, Icons.Favorite, Icons.Favorite); + } } } diff --git a/CampusAppWP8/CampusAppWP8/Utility/Wp8StringManager.cs b/CampusAppWP8/CampusAppWP8/Utility/Wp8StringManager.cs index 27c5b2a5..9eb1fbfb 100644 --- a/CampusAppWP8/CampusAppWP8/Utility/Wp8StringManager.cs +++ b/CampusAppWP8/CampusAppWP8/Utility/Wp8StringManager.cs @@ -8,8 +8,6 @@ //----------------------------------------------------------------------- namespace CampusAppWP8.Utility { - using System; - using System.Text.RegularExpressions; using CampusAppWP8.Resources; /// Class provides some special StringMethods. diff --git a/CampusAppWP8/CampusAppWPortalLib8/Model/Lecture/LectureActivity.cs b/CampusAppWP8/CampusAppWPortalLib8/Model/Lecture/LectureActivity.cs index f822f57a..98a14af8 100644 --- a/CampusAppWP8/CampusAppWPortalLib8/Model/Lecture/LectureActivity.cs +++ b/CampusAppWP8/CampusAppWPortalLib8/Model/Lecture/LectureActivity.cs @@ -210,6 +210,28 @@ namespace CampusAppWPortalLib8.Model.Lecture this.CourseString = DefaultStringManager.RemoveNewLine(result); } + /// Gets a date. + /// Stubbfel, 19.11.2013. + /// The identifier. + /// The date. + public LectureDate GetDate(string id) + { + if (this.Dates == null || id == null) + { + return null; + } + + foreach (LectureDate date in this.Dates) + { + if (id.Equals(date.Id)) + { + return date; + } + } + + return null; + } + #endregion #endregion diff --git a/CampusAppWP8/CampusAppWPortalLib8/Model/Lecture/LectureDate.cs b/CampusAppWP8/CampusAppWPortalLib8/Model/Lecture/LectureDate.cs index d44efabd..885c27da 100644 --- a/CampusAppWP8/CampusAppWPortalLib8/Model/Lecture/LectureDate.cs +++ b/CampusAppWP8/CampusAppWPortalLib8/Model/Lecture/LectureDate.cs @@ -26,6 +26,11 @@ namespace CampusAppWPortalLib8.Model.Lecture #region Property + /// Gets or sets the identifier. + /// The identifier. + [XmlAttribute("id")] + public string Id { get; set; } + /// Gets or sets WeekDay. /// The week day. [XmlElement("wochentag")] @@ -61,6 +66,24 @@ namespace CampusAppWPortalLib8.Model.Lecture [XmlElement("enddatum")] public string EndDate { get; set; } + /// Gets from to date. + /// from to date. + public string FromToDate + { + get + { + string startDate = this.StartDate; + string endDate = this.EndDate; + + if (startDate == null || string.Empty.Equals(startDate.Trim()) || endDate == null || string.Empty.Equals(endDate.Trim())) + { + return string.Empty; + } + + return startDate + " - " + endDate; + } + } + #endregion } } diff --git a/CampusAppWP8/CampusAppWPortalLib8/Utility/DefaultStringManager.cs b/CampusAppWP8/CampusAppWPortalLib8/Utility/DefaultStringManager.cs index b8c3bd38..07cee518 100644 --- a/CampusAppWP8/CampusAppWPortalLib8/Utility/DefaultStringManager.cs +++ b/CampusAppWP8/CampusAppWPortalLib8/Utility/DefaultStringManager.cs @@ -9,6 +9,7 @@ namespace CampusAppWPortalLib8.Utility { using System; + using System.Globalization; using System.Text.RegularExpressions; using CampusAppWPortalLib8.Resources; @@ -18,6 +19,9 @@ namespace CampusAppWPortalLib8.Utility { #region Members + /// The german culture. + public static readonly CultureInfo GermanCulture = new CultureInfo("de-DE"); + /// Patter for Html-Tags. private static readonly string HtmlTagPattern = "<.*?>"; @@ -127,7 +131,7 @@ namespace CampusAppWPortalLib8.Utility /// the id if it was found it in the string otherwise null. public static string FilterPlaceIdinQRResultString(string qrcodeResult) { - if (qrcodeResult == null) + if (qrcodeResult == null) { return null; } @@ -197,18 +201,18 @@ namespace CampusAppWPortalLib8.Utility return null; } - /// Count character. - /// Fiedler, 27.08.2013. - /// input string. - /// The character. - /// The total number of the specified character in the string. + /// Count a certain character. + /// Fiedler, 27.08.2013. + /// input string. + /// The character. + /// The total number of the specified character in the string. public static int CountChar(string str, char c) { int retValue = 0; - foreach(char tc in str) + foreach (char tc in str) { - if(tc.Equals(c) == true) + if (tc.Equals(c) == true) { retValue++; } @@ -216,6 +220,48 @@ namespace CampusAppWPortalLib8.Utility return retValue; } + + /// Converts this object to a day of the week. + /// Stubbfel, 19.11.2013. + /// The input day. + /// The culture. + /// The given data converted to a DayOfWeek. + public static DayOfWeek ToDayofWeek(string inputDay, CultureInfo culture) + { + if (inputDay == null || culture == null) + { + return 0; + } + + inputDay = inputDay.Trim().ToLower(); + string[] days = culture.DateTimeFormat.DayNames; + + int i = 0; + foreach (string day in days) + { + if (inputDay.Equals(day.ToLower())) + { + return (DayOfWeek)i; + } + + i++; + } + + // look for AbbreviatedDayNames + days = culture.DateTimeFormat.AbbreviatedDayNames; + i = 0; + foreach (string day in days) + { + if (inputDay.Equals(day.ToLower())) + { + return (DayOfWeek)i; + } + + i++; + } + + return 0; + } #endregion } }