diff --git a/CampusAppWP8/CampusAppWP8/App.xaml b/CampusAppWP8/CampusAppWP8/App.xaml index a4aef1d3..1d6fd99b 100644 --- a/CampusAppWP8/CampusAppWP8/App.xaml +++ b/CampusAppWP8/CampusAppWP8/App.xaml @@ -12,6 +12,7 @@ + diff --git a/CampusAppWP8/CampusAppWP8/App.xaml.cs b/CampusAppWP8/CampusAppWP8/App.xaml.cs index 3b4121ce..5bb47375 100644 --- a/CampusAppWP8/CampusAppWP8/App.xaml.cs +++ b/CampusAppWP8/CampusAppWP8/App.xaml.cs @@ -159,17 +159,17 @@ namespace CampusAppWP8 this.UserSettingsLoaded(); - Settings.AppSetting.UniNetwork = Utilities.IsUniNetworkAvailable(); - if (!Settings.AppSetting.UniNetwork) + Settings.AppSetting.NetworkSetting.UniNetwork = Utilities.IsUniNetworkAvailable(); + if (!Settings.AppSetting.NetworkSetting.UniNetwork) { - Settings.AppSetting.WifiEnable = Utilities.IsWifiAvailable(); + Settings.AppSetting.NetworkSetting.WifiEnable = Utilities.IsWifiAvailable(); } else { - Settings.AppSetting.WifiEnable = true; + Settings.AppSetting.NetworkSetting.WifiEnable = true; } - - if (Settings.AppSetting.GeoWatchEnable) + + if (Settings.AppSetting.LocatingSetting.GeoWatchEnable) { Thread thread = new Thread(new ThreadStart(this.PositionThread)); thread.Start(); diff --git a/CampusAppWP8/CampusAppWP8/CampusAppWP8.csproj b/CampusAppWP8/CampusAppWP8/CampusAppWP8.csproj index 891e313e..0fbc7b96 100644 --- a/CampusAppWP8/CampusAppWP8/CampusAppWP8.csproj +++ b/CampusAppWP8/CampusAppWP8/CampusAppWP8.csproj @@ -133,10 +133,22 @@ + + + + + + + + + FunctionSettingPage.xaml + + + Appointment.xaml @@ -248,6 +260,8 @@ + + DefaultHeader.xaml @@ -484,6 +498,10 @@ Designer MSBuild:Compile + + Designer + MSBuild:Compile + Designer MSBuild:Compile @@ -524,6 +542,10 @@ MSBuild:Compile Designer + + MSBuild:Compile + Designer + MSBuild:Compile Designer diff --git a/CampusAppWP8/CampusAppWP8/Model/Setting/AppSettings.cs b/CampusAppWP8/CampusAppWP8/Model/Setting/AppSettings.cs index 4b062399..e4f482f8 100644 --- a/CampusAppWP8/CampusAppWP8/Model/Setting/AppSettings.cs +++ b/CampusAppWP8/CampusAppWP8/Model/Setting/AppSettings.cs @@ -8,26 +8,79 @@ //----------------------------------------------------------------------- namespace CampusAppWP8.Model.Setting { + using CampusAppWP8.Pages.Setting; using CampusAppWP8.Resources; /// Model for settings of the app. /// Stubbfel, 15.10.2013. - public class AppSettings + public class AppSettings : ISetting { + #region member + + /// The mensa setting. + private static FunctionSettings functionSetting = new FunctionSettings(); + + /// The network setting. + private static NetworkSetting networkSetting = new NetworkSetting(); + + /// The locating setting. + private static LocatingSetting locatingSetting = new LocatingSetting(); + + #endregion + #region Property - /// Gets or sets a value indicating whether the GeoWatch-Flag. - /// true if geo watch enable, false if not. - public bool GeoWatchEnable + /// Gets or sets the locating setting. + /// The locating setting. + public LocatingSetting LocatingSetting { get { - return App.LoadFromAppState(Constants.AppSetting_GeoWatchEnable); + return AppSettings.locatingSetting; } set { - App.SaveToAppState(Constants.AppSetting_GeoWatchEnable, value); + if (AppSettings.locatingSetting != value) + { + AppSettings.locatingSetting = value; + } + } + } + + /// Gets or sets the network setting. + /// The network setting. + public NetworkSetting NetworkSetting + { + get + { + return AppSettings.networkSetting; + } + + set + { + if (AppSettings.networkSetting != value) + { + AppSettings.networkSetting = value; + } + } + } + + /// Gets or sets the function settings. + /// The function settings. + public FunctionSettings FunctionSettings + { + get + { + return AppSettings.functionSetting; + } + + set + { + if (AppSettings.functionSetting != value) + { + AppSettings.functionSetting = value; + } } } @@ -61,51 +114,6 @@ namespace CampusAppWP8.Model.Setting } } - /// Gets or sets a value indicating whether the uni network. - /// true if uni network, false if not. - public bool UniNetwork - { - get - { - return App.LoadFromAppState(Constants.AppSetting_UniNet); - } - - set - { - App.SaveToAppState(Constants.AppSetting_UniNet, value); - } - } - - /// Gets or sets a value indicating whether this object is WiFi enable. - /// true if WiFi enable, false if not. - public bool WifiEnable - { - get - { - return App.LoadFromAppState(Constants.AppSetting_WifiEnable); - } - - set - { - App.SaveToAppState(Constants.AppSetting_WifiEnable, value); - } - } - - /// Gets or sets a value indicating whether the only WiFi. - /// true if only wifi, false if not. - public bool OnlyWifi - { - get - { - return App.LoadFromAppState(Constants.AppSetting_OnlyWifi); - } - - set - { - App.SaveToAppState(Constants.AppSetting_OnlyWifi, value); - } - } - /// Gets or sets the DeploymentNumber of the app. /// The deployment number. public int DeploymentNumber @@ -121,21 +129,28 @@ namespace CampusAppWP8.Model.Setting } } - /// Gets or sets the tag default handler. - /// The tag default handler. - public BTUTagDefaultHandler TagDefaultHandler + #endregion + + #region method + + /// Sets setting to default. + /// Stubbfel, 25.11.2013. + public void SetSettingToDefault() { - get + // set Deploynumber + int appDeploy; + bool parseResult = int.TryParse(Constants.DeploymentNumber, out appDeploy); + if (parseResult) { - return App.LoadFromAppState(Constants.AppSetting_BTUTagDefaultHandler); + this.DeploymentNumber = appDeploy; } - set - { - App.SaveToAppState(Constants.AppSetting_BTUTagDefaultHandler, value); - } + this.DevMode = false; + this.InitApp = false; + this.FunctionSettings.SetSettingToDefault(); + this.NetworkSetting.SetSettingToDefault(); + this.LocatingSetting.SetSettingToDefault(); } - #endregion } } \ No newline at end of file diff --git a/CampusAppWP8/CampusAppWP8/Model/Setting/BTUTagSetting.cs b/CampusAppWP8/CampusAppWP8/Model/Setting/BTUTagSetting.cs new file mode 100644 index 00000000..ee3c3f5f --- /dev/null +++ b/CampusAppWP8/CampusAppWP8/Model/Setting/BTUTagSetting.cs @@ -0,0 +1,48 @@ +//----------------------------------------------------------------------- +// +// The MIT License (MIT). Copyright (c) 2013 BTU/IIT. +// +// Stubbfel +// 25.11.2013 +// Implements the btu tag setting class +//----------------------------------------------------------------------- +namespace CampusAppWP8.Model.Setting +{ + using CampusAppWP8.Resources; + + /// A btu tag setting. + /// Stubbfel, 25.11.2013. + /// + public class BTUTagSetting : ISetting + { + #region property + + /// Gets or sets the tag default handler. + /// The tag default handler. + public BTUTagDefaultHandler TagDefaultHandler + { + get + { + return App.LoadFromAppState(Constants.AppSetting_BTUTagDefaultHandler); + } + + set + { + App.SaveToAppState(Constants.AppSetting_BTUTagDefaultHandler, value); + } + } + + #endregion + + #region method + + /// Sets setting to default. + /// Stubbfel, 25.11.2013. + /// + public void SetSettingToDefault() + { + this.TagDefaultHandler = BTUTagDefaultHandler.InfoPage; + } + #endregion + } +} diff --git a/CampusAppWP8/CampusAppWP8/Model/Setting/FunctionSettings.cs b/CampusAppWP8/CampusAppWP8/Model/Setting/FunctionSettings.cs new file mode 100644 index 00000000..21585799 --- /dev/null +++ b/CampusAppWP8/CampusAppWP8/Model/Setting/FunctionSettings.cs @@ -0,0 +1,97 @@ +//----------------------------------------------------------------------- +// +// The MIT License (MIT). Copyright (c) 2013 BTU/IIT. +// +// Stubbfel +// 25.11.2013 +// Implements the function settings class +//----------------------------------------------------------------------- +namespace CampusAppWP8.Model.Setting +{ + + /// A function settings. + /// Stubbfel, 25.11.2013. + /// + public class FunctionSettings : ISetting + { + #region member + + /// The mensa setting. + private static MensaSetting mensaSetting = new MensaSetting(); + + /// The tag setting. + private static BTUTagSetting tagSetting = new BTUTagSetting(); + + /// The time table setting. + private static TimeTableSetting timeTableSetting = new TimeTableSetting(); + + #endregion + + #region Property + + /// Gets or sets the time table setting. + /// The time table setting. + public TimeTableSetting TimeTableSetting + { + get + { + return FunctionSettings.timeTableSetting; + } + + set + { + FunctionSettings.timeTableSetting = value; + } + } + + /// Gets or sets the tag setting. + /// The tag setting. + public BTUTagSetting TagSetting + { + get + { + return FunctionSettings.tagSetting; + } + + set + { + if (FunctionSettings.tagSetting != value) + { + FunctionSettings.tagSetting = value; + } + } + } + + /// Gets or sets the mensa setting. + /// The mensa setting. + public MensaSetting MensaSetting + { + get + { + return FunctionSettings.mensaSetting; + } + + set + { + if (value != FunctionSettings.mensaSetting) + { + FunctionSettings.mensaSetting = value; + } + } + } + + #endregion + + #region method + + /// Sets setting to default. + /// Stubbfel, 25.11.2013. + /// + public void SetSettingToDefault() + { + this.TagSetting.SetSettingToDefault(); + this.MensaSetting.SetSettingToDefault(); + } + #endregion + } +} diff --git a/CampusAppWP8/CampusAppWP8/Model/Setting/ISetting.cs b/CampusAppWP8/CampusAppWP8/Model/Setting/ISetting.cs new file mode 100644 index 00000000..58c05f03 --- /dev/null +++ b/CampusAppWP8/CampusAppWP8/Model/Setting/ISetting.cs @@ -0,0 +1,18 @@ +//----------------------------------------------------------------------- +// +// The MIT License (MIT). Copyright (c) 2013 BTU/IIT. +// +// Stubbfel +// 25.11.2013 +// Declares the ISetting interface +//----------------------------------------------------------------------- +namespace CampusAppWP8.Model.Setting +{ + /// Interface for setting. + /// Stubbfel, 25.11.2013. + public interface ISetting + { + /// Sets setting to default. + void SetSettingToDefault(); + } +} diff --git a/CampusAppWP8/CampusAppWP8/Model/Setting/LocatingSetting.cs b/CampusAppWP8/CampusAppWP8/Model/Setting/LocatingSetting.cs new file mode 100644 index 00000000..1fd3bb80 --- /dev/null +++ b/CampusAppWP8/CampusAppWP8/Model/Setting/LocatingSetting.cs @@ -0,0 +1,48 @@ +//----------------------------------------------------------------------- +// +// The MIT License (MIT). Copyright (c) 2013 BTU/IIT. +// +// Stubbfel +// 25.11.2013 +// Implements the locating setting class +//----------------------------------------------------------------------- +namespace CampusAppWP8.Model.Setting +{ + using CampusAppWP8.Resources; + + /// A locating setting. + /// Stubbfel, 25.11.2013. + /// + public class LocatingSetting : ISetting + { + #region property + + /// Gets or sets a value indicating whether the GeoWatch-Flag. + /// true if geo watch enable, false if not. + public bool GeoWatchEnable + { + get + { + return App.LoadFromAppState(Constants.AppSetting_GeoWatchEnable); + } + + set + { + App.SaveToAppState(Constants.AppSetting_GeoWatchEnable, value); + } + } + + #endregion + + #region method + + /// Sets setting to default. + /// Stubbfel, 25.11.2013. + /// + public void SetSettingToDefault() + { + this.GeoWatchEnable = false; + } + #endregion + } +} diff --git a/CampusAppWP8/CampusAppWP8/Model/Setting/MensaSetting.cs b/CampusAppWP8/CampusAppWP8/Model/Setting/MensaSetting.cs new file mode 100644 index 00000000..7bd45f60 --- /dev/null +++ b/CampusAppWP8/CampusAppWP8/Model/Setting/MensaSetting.cs @@ -0,0 +1,85 @@ +//----------------------------------------------------------------------- +// +// The MIT License (MIT). Copyright (c) 2013 BTU/IIT. +// +// Stubbfel +// 25.11.2013 +// Implements the mensa setting class +//----------------------------------------------------------------------- +namespace CampusAppWP8.Model.Setting +{ + using CampusAppWP8.Resources; +using CampusAppWPortalLib8.Model.Settings; + + /// A mensa setting. + /// Stubbfel, 25.11.2013. + public class MensaSetting : ISetting + { + #region Property + + /// Gets or sets a value indicating whether the atom mensa selection. + /// true if atom mensa selection, false if not. + public bool AtomMensaSelection + { + get + { + return App.LoadFromAppState(Constants.AppSetting_MensaSetting_AtomMensaSelection); + } + + set + { + App.SaveToAppState(Constants.AppSetting_MensaSetting_AtomMensaSelection, value); + } + } + + /// Gets or sets the default mensa. + /// The default mensa. + public Campus DefaultMensa + { + get + { + return App.LoadFromAppState(Constants.Setting_Mensa_DefaultCampus); + } + + set + { + App.SaveToAppState(Constants.Setting_Mensa_DefaultCampus, value); + } + } + + /// Gets or sets the selected mensa. + /// The selected mensa. + public Campus SelectedMensa + { + get + { + Campus mensa = App.LoadFromAppState(Constants.Setting_Mensa_DefaultCampus); + if (mensa == Campus.UserSettingCampus) + { + mensa = Settings.UserProfil.DefaultCampus; + } + return mensa; + } + + set + { + App.SaveToAppState(Constants.Setting_Mensa_DefaultCampus, value); + } + } + + + #endregion + + #region method + + /// Sets setting to default. + /// Stubbfel, 25.11.2013. + public void SetSettingToDefault() + { + // set Deploynumber + this.AtomMensaSelection = true; + this.DefaultMensa = Campus.UserSettingCampus; + } + #endregion + } +} diff --git a/CampusAppWP8/CampusAppWP8/Model/Setting/NetworkSetting.cs b/CampusAppWP8/CampusAppWP8/Model/Setting/NetworkSetting.cs new file mode 100644 index 00000000..f8e52d56 --- /dev/null +++ b/CampusAppWP8/CampusAppWP8/Model/Setting/NetworkSetting.cs @@ -0,0 +1,89 @@ +//----------------------------------------------------------------------- +// +// The MIT License (MIT). Copyright (c) 2013 BTU/IIT. +// +// Stubbfel +// 25.11.2013 +// Implements the network setting class +//----------------------------------------------------------------------- +namespace CampusAppWP8.Model.Setting +{ + using CampusAppWP8.Resources; + using CampusAppWP8.Utility; + + /// A network setting. + /// Stubbfel, 25.11.2013. + /// + public class NetworkSetting : ISetting + { + #region property + + /// Gets or sets a value indicating whether the uni network. + /// true if uni network, false if not. + public bool UniNetwork + { + get + { + return App.LoadFromAppState(Constants.AppSetting_UniNet); + } + + set + { + App.SaveToAppState(Constants.AppSetting_UniNet, value); + } + } + + /// Gets or sets a value indicating whether this object is WiFi enable. + /// true if WiFi enable, false if not. + public bool WifiEnable + { + get + { + return App.LoadFromAppState(Constants.AppSetting_WifiEnable); + } + + set + { + App.SaveToAppState(Constants.AppSetting_WifiEnable, value); + } + } + + /// Gets or sets a value indicating whether the only WiFi. + /// true if only wifi, false if not. + public bool OnlyWifi + { + get + { + return App.LoadFromAppState(Constants.AppSetting_OnlyWifi); + } + + set + { + App.SaveToAppState(Constants.AppSetting_OnlyWifi, value); + } + } + + #endregion + + #region method + + /// Sets setting to default. + /// Stubbfel, 25.11.2013. + /// + public void SetSettingToDefault() + { + this.OnlyWifi = false; + + this.UniNetwork = Utilities.IsUniNetworkAvailable(); + if (!this.UniNetwork) + { + this.WifiEnable = Utilities.IsWifiAvailable(); + } + else + { + this.WifiEnable = true; + } + } + #endregion + } +} diff --git a/CampusAppWP8/CampusAppWP8/Model/Setting/SettingsTypes.cs b/CampusAppWP8/CampusAppWP8/Model/Setting/SettingsTypes.cs new file mode 100644 index 00000000..4aafc392 --- /dev/null +++ b/CampusAppWP8/CampusAppWP8/Model/Setting/SettingsTypes.cs @@ -0,0 +1,48 @@ +//----------------------------------------------------------------------- +// +// The MIT License (MIT). Copyright (c) 2013 BTU/IIT. +// +// Stubbfel +// 25.11.2013 +// Implements the settings types class +//----------------------------------------------------------------------- +namespace CampusAppWP8.Model.Setting +{ + /// Values that represent SettingType. + /// Stubbfel, 25.11.2013. + public enum SettingType + { + /// An enum constant representing the setting option. + Setting, + + /// An enum constant representing the appsetting option. + Appsetting, + + /// An enum constant representing the user setting option. + UserSetting, + + /// An enum constant representing the appsetting functionsetting option. + Appsetting_Functionsetting, + + /// An enum constant representing the appsetting networksetting option. + Appsetting_Networksetting, + + /// An enum constant representing the appsetting locatingsetting option. + Appsetting_Locatingsetting, + + /// + /// An enum constant representing the appsetting functionsetting mensasetting option. + /// + Appsetting_Functionsetting_Mensasetting, + + /// + /// An enum constant representing the appsetting functionsetting tagsetting option. + /// + Appsetting_Functionsetting_Tagsetting, + + /// + /// An enum constant representing the appsetting functionsetting time tablesetting option. + /// + Appsetting_Functionsetting_TimeTablesetting + } +} diff --git a/CampusAppWP8/CampusAppWP8/Model/Setting/TimeTableSetting.cs b/CampusAppWP8/CampusAppWP8/Model/Setting/TimeTableSetting.cs new file mode 100644 index 00000000..d9a38a38 --- /dev/null +++ b/CampusAppWP8/CampusAppWP8/Model/Setting/TimeTableSetting.cs @@ -0,0 +1,32 @@ +//----------------------------------------------------------------------- +// +// The MIT License (MIT). Copyright (c) 2013 BTU/IIT. +// +// Stubbfel +// 25.11.2013 +// Implements the time table setting class +//----------------------------------------------------------------------- +namespace CampusAppWP8.Model.Setting +{ + /// A time table setting. + /// Stubbfel, 25.11.2013. + /// + public class TimeTableSetting : ISetting + { + + #region Property + + + #endregion + + #region method + + /// Sets setting to default. + /// Stubbfel, 25.11.2013. + /// + public void SetSettingToDefault() + { + } + #endregion + } +} diff --git a/CampusAppWP8/CampusAppWP8/Model/Setting/UserProfilModel.cs b/CampusAppWP8/CampusAppWP8/Model/Setting/UserProfilModel.cs index 2951d780..d0667b9e 100644 --- a/CampusAppWP8/CampusAppWP8/Model/Setting/UserProfilModel.cs +++ b/CampusAppWP8/CampusAppWP8/Model/Setting/UserProfilModel.cs @@ -8,14 +8,14 @@ //----------------------------------------------------------------------- namespace CampusAppWP8.Model.Setting { + using System; using System.Xml.Serialization; using CampusAppWP8.Resources; using CampusAppWPortalLib8.Model.Settings; /// Model for the profile of an user. /// Stubbfel, 15.10.2013. - [XmlRoot("root")] - public class UserProfilModel + public class UserProfilModel : ISetting { #region Members @@ -116,6 +116,24 @@ namespace CampusAppWP8.Model.Setting #region Methods + #region public + + /// Sets setting to default. + /// Stubbfel, 25.11.2013. + public void SetSettingToDefault() + { + // set Deploynumber + this.Course = 0; + this.DefaultCampus = Campus.CB_MAIN; + this.Degree = DegreeType.BACHELOR; + this.Role = RoleType.STUDENT; + this.Semester = this.CalcCurrentSemester(); + } + + #endregion + + #region private + /// Methods check if a value could be a valid semester. /// Stubbfel, 15.10.2013. /// value which has to be checked. @@ -144,6 +162,30 @@ namespace CampusAppWP8.Model.Setting return true; } + /// Calculates the current semester. + /// Stubbfel, 25.11.2013. + /// The calculated current semester. + private int CalcCurrentSemester() + { + DateTime now = DateTime.Now; + int result = 0; + + result = now.Year * 10; + + if (now.Month < 10) + { + result += 1; + } + else + { + result += 2; + } + + return result; + } + + #endregion + #endregion } } diff --git a/CampusAppWP8/CampusAppWP8/Pages/BTUTag/BTUTagInfo.xaml.cs b/CampusAppWP8/CampusAppWP8/Pages/BTUTag/BTUTagInfo.xaml.cs index 5efc6e82..b396ab71 100644 --- a/CampusAppWP8/CampusAppWP8/Pages/BTUTag/BTUTagInfo.xaml.cs +++ b/CampusAppWP8/CampusAppWP8/Pages/BTUTag/BTUTagInfo.xaml.cs @@ -33,7 +33,7 @@ namespace CampusAppWP8.Pages.BTTTag InitializeComponent(); this.taghandlerModel = new TagHandlerListPickerItemListModel(); this.TagHandler.ItemsSource = this.taghandlerModel.List; - int tagselIndex = this.taghandlerModel.GetIndexOrDefault(Settings.AppSetting.TagDefaultHandler.ToString()); + int tagselIndex = this.taghandlerModel.GetIndexOrDefault(Settings.AppSetting.FunctionSettings.TagSetting.TagDefaultHandler.ToString()); this.TagHandler.SelectedIndex = tagselIndex; } @@ -48,7 +48,7 @@ namespace CampusAppWP8.Pages.BTTTag { if (NavigationMode.Back == e.NavigationMode) { - Settings.AppSetting.TagDefaultHandler = (CampusAppWP8.Model.Setting.BTUTagDefaultHandler)Enum.Parse(typeof(CampusAppWP8.Model.Setting.BTUTagDefaultHandler), ((CampusAppWPortalLib8.Model.Utility.ListPickerItemModel)this.TagHandler.SelectedItem).Value); + Settings.AppSetting.FunctionSettings.TagSetting.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/Campusmap/CampusMapPage.xaml.cs b/CampusAppWP8/CampusAppWP8/Pages/Campusmap/CampusMapPage.xaml.cs index 1cab6f8f..84c996c0 100644 --- a/CampusAppWP8/CampusAppWP8/Pages/Campusmap/CampusMapPage.xaml.cs +++ b/CampusAppWP8/CampusAppWP8/Pages/Campusmap/CampusMapPage.xaml.cs @@ -175,7 +175,7 @@ namespace CampusAppWP8.Pages.Campusmap } } - if (device != null) + if (this.device != null) { this.ndefId = this.device.SubscribeForMessage(Constants.NCFMessageType_NDEF, this.NDEFHandler); } @@ -186,7 +186,7 @@ namespace CampusAppWP8.Pages.Campusmap /// protected override void OnNavigatedFrom(NavigationEventArgs e) { - if (device != null) + if (this.device != null) { this.device.StopSubscribingForMessage(this.ndefId); } @@ -495,10 +495,11 @@ namespace CampusAppWP8.Pages.Campusmap /// the message of the device. private void NDEFHandler(ProximityDevice sender, ProximityMessage message) { - if (device == null) + if (this.device == null) { return; } + // create ndefMessage this.device.StopSubscribingForMessage(message.SubscriptionId); var ndefMessage = message.Data; @@ -558,7 +559,7 @@ namespace CampusAppWP8.Pages.Campusmap { this.DefHeader.ProgressVisibility = Visibility.Collapsed; } - + this.ndefId = this.device.SubscribeForMessage(Constants.NCFMessageType_NDEF, this.NDEFHandler); } @@ -603,7 +604,7 @@ namespace CampusAppWP8.Pages.Campusmap /// The places. /// The type. /// (Optional) the scroll. - private void AddPins(List places,PinType type, bool scroll = true) + private void AddPins(List places, PinType type, bool scroll = true) { foreach (PlaceModel place in places) { @@ -687,7 +688,7 @@ namespace CampusAppWP8.Pages.Campusmap /// (Optional) the scroll. private void ShowCurrentPosition(bool scroll = true) { - if (Settings.AppSetting.GeoWatchEnable) + if (Settings.AppSetting.LocatingSetting.GeoWatchEnable) { Utilities.DetermineAndStoreCurrentPositionForce(); if (this.Dispatcher != null) @@ -720,7 +721,7 @@ namespace CampusAppWP8.Pages.Campusmap GeoMapPoint currentPosition = App.LoadFromAppState(Constants.GeoWatch_CurrentPositionPoint); if (currentPosition == null || currentPosition.Latitude == 0 || currentPosition.Longitude == 0) { - if (Settings.AppSetting.GeoWatchEnable) + if (Settings.AppSetting.LocatingSetting.GeoWatchEnable) { MessageBoxes.ShowMainModelInfoMessageBox(AppResources.MsgBox_NoLocation); } @@ -730,7 +731,7 @@ namespace CampusAppWP8.Pages.Campusmap else { this.ClearMap(new List() { MapPinModel.CurrentPositionPlacePinString }); - this.SetPinToPosition(currentPosition.Latitude,currentPosition.Longitude, PinType.CurrentPosition, scroll); + this.SetPinToPosition(currentPosition.Latitude, currentPosition.Longitude, PinType.CurrentPosition, scroll); } } @@ -850,7 +851,7 @@ namespace CampusAppWP8.Pages.Campusmap { this.SearchByText(sender, e); this.MapScroller.Focus(); - } + } } #endregion diff --git a/CampusAppWP8/CampusAppWP8/Pages/Dev/QRScanner.xaml.cs b/CampusAppWP8/CampusAppWP8/Pages/Dev/QRScanner.xaml.cs index 1261966f..be7014cf 100644 --- a/CampusAppWP8/CampusAppWP8/Pages/Dev/QRScanner.xaml.cs +++ b/CampusAppWP8/CampusAppWP8/Pages/Dev/QRScanner.xaml.cs @@ -251,7 +251,7 @@ namespace CampusAppWP8.Pages.Dev else { string qrContent = result.Text; - switch (Settings.AppSetting.TagDefaultHandler) + switch (Settings.AppSetting.FunctionSettings.TagSetting.TagDefaultHandler) { case BTUTagDefaultHandler.CampusMap: this.GoToCampusMappage(qrContent); diff --git a/CampusAppWP8/CampusAppWP8/Pages/Mensa/MensaPage.xaml.cs b/CampusAppWP8/CampusAppWP8/Pages/Mensa/MensaPage.xaml.cs index e837fc79..a6770bd0 100644 --- a/CampusAppWP8/CampusAppWP8/Pages/Mensa/MensaPage.xaml.cs +++ b/CampusAppWP8/CampusAppWP8/Pages/Mensa/MensaPage.xaml.cs @@ -49,7 +49,7 @@ namespace CampusAppWP8.Pages.Mensa private bool forceLoad = false; /// Identifier for the location. - public int locationID = -1; + private int locationID = -1; #endregion @@ -231,7 +231,7 @@ namespace CampusAppWP8.Pages.Mensa /// Stubbfel, 15.10.2013. private void InitializeFeed() { - if (Settings.AppSetting.GeoWatchEnable) + if (Settings.AppSetting.LocatingSetting.GeoWatchEnable) { Thread thread = new Thread(new ThreadStart(this.DeterminCurrentCampusAndLoadFeed)); thread.Start(); @@ -445,7 +445,6 @@ namespace CampusAppWP8.Pages.Mensa copyText = Wp8StringManager.AddNewLine(copyText); } - Clipboard.SetText(copyText); } @@ -455,7 +454,6 @@ namespace CampusAppWP8.Pages.Mensa /// Event information. private void CopyWeek(object sender, EventArgs e) { - if (this.MensaPivot == null || this.feed == null || this.feed.Model == null) { return; @@ -471,6 +469,7 @@ namespace CampusAppWP8.Pages.Mensa { startDate = menu.Date; } + endDate = menu.Date; copyText += menu.Day + " (" + menu.Date + "):"; @@ -481,8 +480,8 @@ namespace CampusAppWP8.Pages.Mensa copyText += meal.MealName + ": " + meal.MealDesc; copyText = Wp8StringManager.AddNewLine(copyText); } - copyText = Wp8StringManager.AddNewLine(copyText); + copyText = Wp8StringManager.AddNewLine(copyText); } string headline = AppResources.MensaApp_Weekplan + " (" + startDate + " - " + endDate + ") - " + AppResources.Setting_UserCampus + " " + this.feed.Title + " :"; diff --git a/CampusAppWP8/CampusAppWP8/Pages/Setting/AppSettingPage.xaml b/CampusAppWP8/CampusAppWP8/Pages/Setting/AppSettingPage.xaml index 67797334..6762f89b 100644 --- a/CampusAppWP8/CampusAppWP8/Pages/Setting/AppSettingPage.xaml +++ b/CampusAppWP8/CampusAppWP8/Pages/Setting/AppSettingPage.xaml @@ -9,6 +9,7 @@ xmlns:toolkit="clr-namespace:Microsoft.Phone.Controls;assembly=Microsoft.Phone.Controls.Toolkit" xmlns:header="clr-namespace:CampusAppWP8.Utility.Lui.Header" xmlns:lui="clr-namespace:CampusAppWP8.Utility.Lui.Button" + xmlns:page="clr-namespace:CampusAppWP8.Utility.Lui.Page" FontFamily="{StaticResource PhoneFontFamilyNormal}" FontSize="{StaticResource PhoneFontSizeNormal}" Foreground="{StaticResource PhoneForegroundBrush}" @@ -25,48 +26,116 @@ - + - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/CampusAppWP8/CampusAppWP8/Pages/Setting/AppSettingPage.xaml.cs b/CampusAppWP8/CampusAppWP8/Pages/Setting/AppSettingPage.xaml.cs index 3527c4a9..cd6422bf 100644 --- a/CampusAppWP8/CampusAppWP8/Pages/Setting/AppSettingPage.xaml.cs +++ b/CampusAppWP8/CampusAppWP8/Pages/Setting/AppSettingPage.xaml.cs @@ -9,19 +9,15 @@ namespace CampusAppWP8.Pages.Setting { using System; - using System.Windows.Navigation; - using CampusAppWP8.Model.Setting; + using System.Windows.Navigation; + using CampusAppWP8.Resources; using Microsoft.Phone.Controls; /// Class for the AppSettingPage. /// Stubbfel, 15.10.2013. /// - public partial class AppSettingPage : PhoneApplicationPage + public partial class AppSettingPage : PhoneApplicationPage, IRefreshingPage { - #region Member - /// The TagHandler model. - private TagHandlerListPickerItemListModel taghandlerModel; - #endregion #region Constructor /// Initializes a new instance of the class. @@ -29,18 +25,40 @@ namespace CampusAppWP8.Pages.Setting public AppSettingPage() { this.InitializeComponent(); - this.GeoWatchToggle.IsChecked = Settings.AppSetting.GeoWatchEnable; - this.OnlyWiFiToggle.IsChecked = Settings.AppSetting.OnlyWifi; - this.taghandlerModel = new TagHandlerListPickerItemListModel(); - this.TagHandler.ItemsSource = this.taghandlerModel.List; - int tagselIndex = this.taghandlerModel.GetIndexOrDefault(Settings.AppSetting.TagDefaultHandler.ToString()); - this.TagHandler.SelectedIndex = tagselIndex; + this.LoadSettings(); } #endregion #region Method + #region public + + /// Refresh page. + /// Stubbfel, 25.11.2013. + /// + public void RefreshPage() + { + this.LoadSettings(); + } + #endregion + + #region protected + /// Override the OnNavigatedTo method. + /// Stubbfel, 15.10.2013. + /// + protected override void OnNavigatedTo(NavigationEventArgs e) + { + base.OnNavigatedTo(e); + + string functionIndex; + if (NavigationMode.New != e.NavigationMode && NavigationContext.QueryString.TryGetValue(Constants.Param_FunctionSetting_Index, out functionIndex)) + { + int oldIndex = App.LoadFromIsolatedStorage(Constants.IsolatedStorage_GeneralSettingPageIndex); + this.GeneralSettingPivot.SelectedIndex = oldIndex; + } + } + /// Override the OnNavigatedFrom method. /// Stubbfel, 15.10.2013. /// @@ -48,12 +66,46 @@ namespace CampusAppWP8.Pages.Setting { if (NavigationMode.Back == e.NavigationMode) { - Settings.AppSetting.GeoWatchEnable = GeoWatchToggle.IsChecked.Value; - Settings.AppSetting.OnlyWifi = OnlyWiFiToggle.IsChecked.Value; - Settings.AppSetting.TagDefaultHandler = (CampusAppWP8.Model.Setting.BTUTagDefaultHandler)Enum.Parse(typeof(CampusAppWP8.Model.Setting.BTUTagDefaultHandler), ((CampusAppWPortalLib8.Model.Utility.ListPickerItemModel)this.TagHandler.SelectedItem).Value); + this.SaveSettings(); + App.SaveToIsolatedStorage(Constants.IsolatedStorage_GeneralSettingPageIndex, 0); + } + else + { + App.SaveToIsolatedStorage(Constants.IsolatedStorage_FunctionSettingPageIndex, this.GeneralSettingPivot.SelectedIndex); } } #endregion + + #region private + /// Loads the settings. + /// Stubbfel, 25.11.2013. + private void LoadSettings() + { + this.GeoWatchToggle.IsChecked = Settings.AppSetting.LocatingSetting.GeoWatchEnable; + this.OnlyWiFiToggle.IsChecked = Settings.AppSetting.NetworkSetting.OnlyWifi; + } + + /// Saves the settings. + /// Stubbfel, 25.11.2013. + private void SaveSettings() + { + Settings.AppSetting.LocatingSetting.GeoWatchEnable = GeoWatchToggle.IsChecked.Value; + Settings.AppSetting.NetworkSetting.OnlyWifi = OnlyWiFiToggle.IsChecked.Value; + } + + /// Event handler. Called by ResetSettingButtonAppBar for click events. + /// Stubbfel, 25.11.2013. + /// Source of the event. + /// Event information. + private void ResetSettingButtonAppBar_Click(object sender, EventArgs e) + { + Settings.AppSetting.SetSettingToDefault(); + this.LoadSettings(); + } + + #endregion + + #endregion } } \ No newline at end of file diff --git a/CampusAppWP8/CampusAppWP8/Pages/Setting/FunctionSettingPage.xaml b/CampusAppWP8/CampusAppWP8/Pages/Setting/FunctionSettingPage.xaml new file mode 100644 index 00000000..964d3ef6 --- /dev/null +++ b/CampusAppWP8/CampusAppWP8/Pages/Setting/FunctionSettingPage.xaml @@ -0,0 +1,174 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/CampusAppWP8/CampusAppWP8/Pages/Setting/FunctionSettingPage.xaml.cs b/CampusAppWP8/CampusAppWP8/Pages/Setting/FunctionSettingPage.xaml.cs new file mode 100644 index 00000000..b1956ad7 --- /dev/null +++ b/CampusAppWP8/CampusAppWP8/Pages/Setting/FunctionSettingPage.xaml.cs @@ -0,0 +1,184 @@ +//----------------------------------------------------------------------- +// +// The MIT License (MIT). Copyright (c) 2013 BTU/IIT. +// +// Stubbfel +// 25.11.2013 +// Implements the function setting page.xaml class +//----------------------------------------------------------------------- +namespace CampusAppWP8.Pages.Setting +{ + using System; + using System.Windows; + using System.Windows.Navigation; + using CampusAppWP8.Model.Setting; + using CampusAppWP8.Resources; + using Microsoft.Phone.Controls; + using CampusAppWPortalLib8.Model.Utility; + + /// A function setting page. + /// Stubbfel, 25.11.2013. + /// + public partial class FunctionSettingPage : PhoneApplicationPage, IRefreshingPage + { + #region Member + /// The TagHandler model. + private TagHandlerListPickerItemListModel taghandlerModel; + + /// List of campus. + private CampusListPickerItemListModel campusList; + #endregion + + #region Constructor + + /// Initializes a new instance of the FunctionSettingPage class. + /// Stubbfel, 25.11.2013. + public FunctionSettingPage() + { + this.InitializeComponent(); + this.LoadSettings(); + } + + #endregion + + #region Methods + + #region public + + /// Refresh page. + /// Stubbfel, 25.11.2013. + /// + public void RefreshPage() + { + this.LoadSettings(); + } + #endregion + + #region protected + + /// Override the OnNavigatedTo method. + /// Stubbfel, 15.10.2013. + /// + protected override void OnNavigatedTo(NavigationEventArgs e) + { + base.OnNavigatedTo(e); + + string functionIndex; + + if (NavigationMode.New == e.NavigationMode && NavigationContext.QueryString.TryGetValue(Constants.Param_FunctionSetting_Index, out functionIndex)) + { + this.SetSelectedPivotItem(functionIndex); + } + else + { + string oldIndex = App.LoadFromIsolatedStorage(Constants.IsolatedStorage_FunctionSettingPageIndex); + this.SetSelectedPivotItem(oldIndex); + } + } + + /// Override the OnNavigatedFrom method. + /// Stubbfel, 15.10.2013. + /// + protected override void OnNavigatedFrom(NavigationEventArgs e) + { + base.OnNavigatedFrom(e); + this.SaveSettings(); + + if (NavigationMode.Back == e.NavigationMode) + { + App.SaveToIsolatedStorage(Constants.IsolatedStorage_FunctionSettingPageIndex, null); + } + else + { + FrameworkElement uiElement = this.SettingFunctionPivot.SelectedItem as FrameworkElement; + if (uiElement != null && uiElement.Tag != null) + { + App.SaveToIsolatedStorage(Constants.IsolatedStorage_FunctionSettingPageIndex, uiElement.Tag.ToString()); + } + } + } + + #endregion + + #region private + + /// Sets selected pivot item. + /// Stubbfel, 25.11.2013. + /// The item tag. + private void SetSelectedPivotItem(string itemTag) + { + if (itemTag != null) + { + foreach (FrameworkElement pivotItem in this.SettingFunctionPivot.Items) + { + if (pivotItem.Tag != null && itemTag.Equals(pivotItem.Tag.ToString())) + { + this.SettingFunctionPivot.SetValue(Pivot.SelectedItemProperty, pivotItem); + + return; + } + } + } + + this.SettingFunctionPivot.SelectedIndex = 0; + } + + /// Loads the settings. + /// Stubbfel, 25.11.2013. + private void LoadSettings() + { + if (this.taghandlerModel == null) + { + this.taghandlerModel = new TagHandlerListPickerItemListModel(); + this.TagHandler.ItemsSource = this.taghandlerModel.List; + } + + int tagselIndex = this.taghandlerModel.GetIndexOrDefault(Settings.AppSetting.FunctionSettings.TagSetting.TagDefaultHandler.ToString()); + this.TagHandler.SelectedIndex = tagselIndex; + + this.AtomMensaToggle.IsChecked = Settings.AppSetting.FunctionSettings.MensaSetting.AtomMensaSelection; + + if (this.campusList == null) + { + this.campusList = new CampusListPickerItemListModel(true); + this.Mensa.ItemsSource = campusList.List; + } + this.Mensa.SelectedIndex = campusList.GetIndexOrDefault(((int)Settings.AppSetting.FunctionSettings.MensaSetting.DefaultMensa).ToString()); + + } + + /// Saves the settings. + /// Stubbfel, 25.11.2013. + private void SaveSettings() + { + Settings.AppSetting.FunctionSettings.TagSetting.TagDefaultHandler = (CampusAppWP8.Model.Setting.BTUTagDefaultHandler)Enum.Parse(typeof(CampusAppWP8.Model.Setting.BTUTagDefaultHandler), ((CampusAppWPortalLib8.Model.Utility.ListPickerItemModel)this.TagHandler.SelectedItem).Value); + Settings.AppSetting.FunctionSettings.MensaSetting.AtomMensaSelection = this.AtomMensaToggle.IsChecked.Value; + Settings.AppSetting.FunctionSettings.MensaSetting.DefaultMensa = (CampusAppWPortalLib8.Model.Settings.Campus)Enum.Parse(typeof(CampusAppWPortalLib8.Model.Settings.Campus), ((ListPickerItemModel)this.Mensa.SelectedItem).Value); + } + + + /// + /// Event handler. Called by SettingFunctionPivot for selection changed events. + /// + /// Stubbfel, 25.11.2013. + /// Source of the event. + /// Selection changed event information. + private void SettingFunctionPivot_SelectionChanged(object sender, System.Windows.Controls.SelectionChangedEventArgs e) + { + this.SaveSettings(); + } + + /// Event handler. Called by ResetSettingButtonAppBar for click events. + /// Stubbfel, 25.11.2013. + /// Source of the event. + /// Event information. + private void ResetSettingButtonAppBar_Click(object sender, EventArgs e) + { + Settings.AppSetting.FunctionSettings.SetSettingToDefault(); + this.LoadSettings(); + } + #endregion + + #endregion + } +} \ No newline at end of file diff --git a/CampusAppWP8/CampusAppWP8/Pages/Setting/IRefreshingPage.cs b/CampusAppWP8/CampusAppWP8/Pages/Setting/IRefreshingPage.cs new file mode 100644 index 00000000..717f4aa2 --- /dev/null +++ b/CampusAppWP8/CampusAppWP8/Pages/Setting/IRefreshingPage.cs @@ -0,0 +1,18 @@ +//----------------------------------------------------------------------- +// +// The MIT License (MIT). Copyright (c) 2013 BTU/IIT. +// +// Stubbfel +// 25.11.2013 +// Declares the IRefreshingPage interface +//----------------------------------------------------------------------- +namespace CampusAppWP8.Pages.Setting +{ + /// Interface for refreshing page. + /// Stubbfel, 25.11.2013. + public interface IRefreshingPage + { + /// Refresh page. + void RefreshPage(); + } +} diff --git a/CampusAppWP8/CampusAppWP8/Pages/Setting/UserProfil.xaml b/CampusAppWP8/CampusAppWP8/Pages/Setting/UserProfil.xaml index f92c9a07..5c6dcc7f 100644 --- a/CampusAppWP8/CampusAppWP8/Pages/Setting/UserProfil.xaml +++ b/CampusAppWP8/CampusAppWP8/Pages/Setting/UserProfil.xaml @@ -8,6 +8,7 @@ xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006" xmlns:toolkit="clr-namespace:Microsoft.Phone.Controls;assembly=Microsoft.Phone.Controls.Toolkit" xmlns:header="clr-namespace:CampusAppWP8.Utility.Lui.Header" + xmlns:lui="clr-namespace:CampusAppWP8.Utility.Lui.Button" FontFamily="{StaticResource PhoneFontFamilyNormal}" FontSize="{StaticResource PhoneFontSizeNormal}" Foreground="{StaticResource PhoneForegroundBrush}" @@ -154,4 +155,9 @@ + + + + + \ No newline at end of file diff --git a/CampusAppWP8/CampusAppWP8/Pages/Setting/UserProfil.xaml.cs b/CampusAppWP8/CampusAppWP8/Pages/Setting/UserProfil.xaml.cs index 95dcd530..ef77dba2 100644 --- a/CampusAppWP8/CampusAppWP8/Pages/Setting/UserProfil.xaml.cs +++ b/CampusAppWP8/CampusAppWP8/Pages/Setting/UserProfil.xaml.cs @@ -115,6 +115,16 @@ namespace CampusAppWP8.Pages.Setting } } + /// Event handler. Called by ResetSettingButtonAppBar for click events. + /// Stubbfel, 25.11.2013. + /// Source of the event. + /// Event information. + private void ResetSettingButtonAppBar_Click(object sender, EventArgs e) + { + Settings.UserProfil.SetSettingToDefault(); + this.LoadListPicker(); + } + #endregion #endregion diff --git a/CampusAppWP8/CampusAppWP8/Pages/StartPage.xaml b/CampusAppWP8/CampusAppWP8/Pages/StartPage.xaml index 2e3e784e..4e3573d2 100644 --- a/CampusAppWP8/CampusAppWP8/Pages/StartPage.xaml +++ b/CampusAppWP8/CampusAppWP8/Pages/StartPage.xaml @@ -308,10 +308,13 @@ - + - + + + + diff --git a/CampusAppWP8/CampusAppWP8/Pages/StartPage.xaml.cs b/CampusAppWP8/CampusAppWP8/Pages/StartPage.xaml.cs index 2b55eb1e..8f103089 100644 --- a/CampusAppWP8/CampusAppWP8/Pages/StartPage.xaml.cs +++ b/CampusAppWP8/CampusAppWP8/Pages/StartPage.xaml.cs @@ -56,22 +56,16 @@ namespace CampusAppWP8.Pages TimeTable.TimeTable.InitFeed(); - if (!Settings.AppSetting.InitApp) { this.InitPlaceFile(); this.initCourseList = new CourseFeed(); this.initCourseList.OnLoaded += new CourseFeed.OnIO(this.StoreCourseFeed); this.initCourseList.LoadData(); + + Settings.SetSettingToDefault(); this.ShowOptIns(); Settings.AppSetting.InitApp = true; - - int appDeploy; - bool parseResult = int.TryParse(Constants.DeploymentNumber, out appDeploy); - if (parseResult) - { - Settings.AppSetting.DeploymentNumber = appDeploy; - } } } @@ -149,13 +143,13 @@ namespace CampusAppWP8.Pages if (result == MessageBoxResult.OK) { - Settings.AppSetting.GeoWatchEnable = true; + Settings.AppSetting.LocatingSetting.GeoWatchEnable = true; Thread thread = new Thread(new ThreadStart(this.PositionThread)); thread.Start(); } else { - Settings.AppSetting.GeoWatchEnable = false; + Settings.AppSetting.LocatingSetting.GeoWatchEnable = false; } } @@ -275,7 +269,7 @@ namespace CampusAppWP8.Pages } else { - switch (Settings.AppSetting.TagDefaultHandler) + switch (Settings.AppSetting.FunctionSettings.TagSetting.TagDefaultHandler) { case BTUTagDefaultHandler.CampusMap: this.GoToCampusMappage(nfcContent); diff --git a/CampusAppWP8/CampusAppWP8/Properties/WMAppManifest.xml b/CampusAppWP8/CampusAppWP8/Properties/WMAppManifest.xml index dc2c9908..d7ebc0b3 100644 --- a/CampusAppWP8/CampusAppWP8/Properties/WMAppManifest.xml +++ b/CampusAppWP8/CampusAppWP8/Properties/WMAppManifest.xml @@ -20,8 +20,8 @@ Assets\ApplicationIcon.png BTU CampusApp - Assets\Slides\Slide1.jpg - Assets\Slides\Slide2.jpg + Assets\Slides\Slide2.jpg + Assets\Slides\Slide1.jpg Assets\Slides\Slide3.jpg Assets\Slides\Slide4.jpg Assets\Slides\Slide5.jpg diff --git a/CampusAppWP8/CampusAppWP8/Resources/AppResources.Designer.cs b/CampusAppWP8/CampusAppWP8/Resources/AppResources.Designer.cs index 47c3c85a..034721f2 100644 --- a/CampusAppWP8/CampusAppWP8/Resources/AppResources.Designer.cs +++ b/CampusAppWP8/CampusAppWP8/Resources/AppResources.Designer.cs @@ -1131,6 +1131,15 @@ namespace CampusAppWP8.Resources { } } + /// + /// Sucht eine lokalisierte Zeichenfolge, die zurück-setzen ähnelt. + /// + public static string ResetBtn { + get { + return ResourceManager.GetString("ResetBtn", resourceCulture); + } + } + /// /// Sucht eine lokalisierte Zeichenfolge, die LeftToRight ähnelt. /// @@ -1212,15 +1221,6 @@ namespace CampusAppWP8.Resources { } } - /// - /// Sucht eine lokalisierte Zeichenfolge, die App-Einstellungen ähnelt. - /// - public static string Setting_ApplAppBarTitle { - get { - return ResourceManager.GetString("Setting_ApplAppBarTitle", resourceCulture); - } - } - /// /// Sucht eine lokalisierte Zeichenfolge, die Nur mit Wlan laden ähnelt. /// @@ -1230,6 +1230,60 @@ namespace CampusAppWP8.Resources { } } + /// + /// Sucht eine lokalisierte Zeichenfolge, die autom. Mensa-Auswahl ähnelt. + /// + public static string Setting_AtomMensaSelection { + get { + return ResourceManager.GetString("Setting_AtomMensaSelection", resourceCulture); + } + } + + /// + /// Sucht eine lokalisierte Zeichenfolge, die Darstellung ähnelt. + /// + public static string Setting_Display_Short { + get { + return ResourceManager.GetString("Setting_Display_Short", resourceCulture); + } + } + + /// + /// Sucht eine lokalisierte Zeichenfolge, die Funktionseinstellungen ähnelt. + /// + public static string Setting_Function { + get { + return ResourceManager.GetString("Setting_Function", resourceCulture); + } + } + + /// + /// Sucht eine lokalisierte Zeichenfolge, die Funktionen ähnelt. + /// + public static string Setting_Function_Short { + get { + return ResourceManager.GetString("Setting_Function_Short", resourceCulture); + } + } + + /// + /// Sucht eine lokalisierte Zeichenfolge, die Allgemeine Einstellungen ähnelt. + /// + public static string Setting_General { + get { + return ResourceManager.GetString("Setting_General", resourceCulture); + } + } + + /// + /// Sucht eine lokalisierte Zeichenfolge, die Ort. & Netz ähnelt. + /// + public static string Setting_GeneralNetwork { + get { + return ResourceManager.GetString("Setting_GeneralNetwork", resourceCulture); + } + } + /// /// Sucht eine lokalisierte Zeichenfolge, die Über BTU Campus-App ähnelt. /// @@ -1239,6 +1293,33 @@ namespace CampusAppWP8.Resources { } } + /// + /// Sucht eine lokalisierte Zeichenfolge, die Mensa ähnelt. + /// + public static string Setting_Mensa { + get { + return ResourceManager.GetString("Setting_Mensa", resourceCulture); + } + } + + /// + /// Sucht eine lokalisierte Zeichenfolge, die Sonstige Einstellungen ähnelt. + /// + public static string Setting_Other { + get { + return ResourceManager.GetString("Setting_Other", resourceCulture); + } + } + + /// + /// Sucht eine lokalisierte Zeichenfolge, die BTU-Tag ähnelt. + /// + public static string Setting_Tag { + get { + return ResourceManager.GetString("Setting_Tag", resourceCulture); + } + } + /// /// Sucht eine lokalisierte Zeichenfolge, die BTU-Tag-Standardfunktion ähnelt. /// @@ -1312,11 +1393,11 @@ namespace CampusAppWP8.Resources { } /// - /// Sucht eine lokalisierte Zeichenfolge, die Profileinstellungen ähnelt. + /// Sucht eine lokalisierte Zeichenfolge, die Persönliche Einstellungen ähnelt. /// - public static string Setting_UserProfilAppBarTitle { + public static string Setting_UserInfo { get { - return ResourceManager.GetString("Setting_UserProfilAppBarTitle", resourceCulture); + return ResourceManager.GetString("Setting_UserInfo", resourceCulture); } } @@ -1338,6 +1419,15 @@ namespace CampusAppWP8.Resources { } } + /// + /// Sucht eine lokalisierte Zeichenfolge, die Einstellung zurücksetzen ähnelt. + /// + public static string SettingToDefault { + get { + return ResourceManager.GetString("SettingToDefault", resourceCulture); + } + } + /// /// Sucht eine lokalisierte Zeichenfolge, die klein ähnelt. /// diff --git a/CampusAppWP8/CampusAppWP8/Resources/AppResources.resx b/CampusAppWP8/CampusAppWP8/Resources/AppResources.resx index b8452a9c..711c1ded 100644 --- a/CampusAppWP8/CampusAppWP8/Resources/AppResources.resx +++ b/CampusAppWP8/CampusAppWP8/Resources/AppResources.resx @@ -293,8 +293,8 @@ Abschluss - - Profileinstellungen + + Persönliche Einstellungen Rolle @@ -332,8 +332,8 @@ Ortung - - App-Einstellungen + + Allgemeine Einstellungen Der aktuelle Campus konnte nicht ermittelt werden. Es wird der im Profil festgelegten Campus verwendet. @@ -632,4 +632,34 @@ Räume + + autom. Mensa-Auswahl + + + Funktionseinstellungen + + + Ort. & Netz + + + Sonstige Einstellungen + + + BTU-Tag + + + zurück-setzen + + + Einstellung zurücksetzen + + + Darstellung + + + Funktionen + + + Mensa + \ No newline at end of file diff --git a/CampusAppWP8/CampusAppWP8/Resources/Constants.resx b/CampusAppWP8/CampusAppWP8/Resources/Constants.resx index bcad4e3a..5f02e256 100644 --- a/CampusAppWP8/CampusAppWP8/Resources/Constants.resx +++ b/CampusAppWP8/CampusAppWP8/Resources/Constants.resx @@ -274,7 +274,7 @@ 767 - 20131 + 20132 20121 @@ -624,4 +624,58 @@ /Pages/Setting/Impressum.xaml + + AtomMensaSelection + + + Mensafunction + + + Tagfunction + + + TimeTablefunction + + + FunctionSettingPageIndex + + + GeneralSettingPageIndex + + + FunctionSettingIndex + + + /Pages/Setting/FunctionSettingPage.xaml + + + UserSetting + + + AppSetting + + + Appsetting_Locatingsetting + + + Appsetting_Networksetting + + + Appsetting_Functionsetting + + + Appsetting_Functionsetting_Mensasetting + + + Appsetting_Functionsetting_Tagsetting + + + Appsetting_Functionsetting_TimeTablesetting + + + Setting + + + MensaDefaultCampus + \ No newline at end of file diff --git a/CampusAppWP8/CampusAppWP8/Resources/Constants1.Designer.cs b/CampusAppWP8/CampusAppWP8/Resources/Constants1.Designer.cs index 17e874ae..4b3fe01c 100644 --- a/CampusAppWP8/CampusAppWP8/Resources/Constants1.Designer.cs +++ b/CampusAppWP8/CampusAppWP8/Resources/Constants1.Designer.cs @@ -150,6 +150,15 @@ namespace CampusAppWP8.Resources { } } + /// + /// Sucht eine lokalisierte Zeichenfolge, die AtomMensaSelection ähnelt. + /// + public static string AppSetting_MensaSetting_AtomMensaSelection { + get { + return ResourceManager.GetString("AppSetting_MensaSetting_AtomMensaSelection", resourceCulture); + } + } + /// /// Sucht eine lokalisierte Zeichenfolge, die OnlyWifi ähnelt. /// @@ -438,6 +447,33 @@ namespace CampusAppWP8.Resources { } } + /// + /// Sucht eine lokalisierte Zeichenfolge, die Mensafunction ähnelt. + /// + public static string FunctionSetting_Mensa { + get { + return ResourceManager.GetString("FunctionSetting_Mensa", resourceCulture); + } + } + + /// + /// Sucht eine lokalisierte Zeichenfolge, die Tagfunction ähnelt. + /// + public static string FunctionSetting_Tag { + get { + return ResourceManager.GetString("FunctionSetting_Tag", resourceCulture); + } + } + + /// + /// Sucht eine lokalisierte Zeichenfolge, die TimeTablefunction ähnelt. + /// + public static string FunctionSetting_TimeTable { + get { + return ResourceManager.GetString("FunctionSetting_TimeTable", resourceCulture); + } + } + /// /// Sucht eine lokalisierte Zeichenfolge, die CurrentPositionPoint ähnelt. /// @@ -492,6 +528,24 @@ namespace CampusAppWP8.Resources { } } + /// + /// Sucht eine lokalisierte Zeichenfolge, die FunctionSettingPageIndex ähnelt. + /// + public static string IsolatedStorage_FunctionSettingPageIndex { + get { + return ResourceManager.GetString("IsolatedStorage_FunctionSettingPageIndex", resourceCulture); + } + } + + /// + /// Sucht eine lokalisierte Zeichenfolge, die GeneralSettingPageIndex ähnelt. + /// + public static string IsolatedStorage_GeneralSettingPageIndex { + get { + return ResourceManager.GetString("IsolatedStorage_GeneralSettingPageIndex", resourceCulture); + } + } + /// /// Sucht eine lokalisierte Zeichenfolge, die LectureAppointment ähnelt. /// @@ -645,6 +699,15 @@ namespace CampusAppWP8.Resources { } } + /// + /// Sucht eine lokalisierte Zeichenfolge, die FunctionSettingIndex ähnelt. + /// + public static string Param_FunctionSetting_Index { + get { + return ResourceManager.GetString("Param_FunctionSetting_Index", resourceCulture); + } + } + /// /// Sucht eine lokalisierte Zeichenfolge, die BuildingId ähnelt. /// @@ -1050,6 +1113,15 @@ namespace CampusAppWP8.Resources { } } + /// + /// Sucht eine lokalisierte Zeichenfolge, die /Pages/Setting/FunctionSettingPage.xaml ähnelt. + /// + public static string PathSetting_Function { + get { + return ResourceManager.GetString("PathSetting_Function", resourceCulture); + } + } + /// /// Sucht eine lokalisierte Zeichenfolge, die /Pages/Setting/Impressum.xaml ähnelt. /// @@ -1311,6 +1383,69 @@ namespace CampusAppWP8.Resources { } } + /// + /// Sucht eine lokalisierte Zeichenfolge, die AppSetting ähnelt. + /// + public static string Setting_AppSetting_Enum { + get { + return ResourceManager.GetString("Setting_AppSetting_Enum", resourceCulture); + } + } + + /// + /// Sucht eine lokalisierte Zeichenfolge, die Appsetting_Functionsetting ähnelt. + /// + public static string Setting_AppSetting_FunctionSetting_Enum { + get { + return ResourceManager.GetString("Setting_AppSetting_FunctionSetting_Enum", resourceCulture); + } + } + + /// + /// Sucht eine lokalisierte Zeichenfolge, die Appsetting_Functionsetting_Mensasetting ähnelt. + /// + public static string Setting_AppSetting_FunctionSetting_MensaSetting_Enum { + get { + return ResourceManager.GetString("Setting_AppSetting_FunctionSetting_MensaSetting_Enum", resourceCulture); + } + } + + /// + /// Sucht eine lokalisierte Zeichenfolge, die Appsetting_Functionsetting_Tagsetting ähnelt. + /// + public static string Setting_AppSetting_FunctionSetting_TagSetting_Enum { + get { + return ResourceManager.GetString("Setting_AppSetting_FunctionSetting_TagSetting_Enum", resourceCulture); + } + } + + /// + /// Sucht eine lokalisierte Zeichenfolge, die Appsetting_Functionsetting_TimeTablesetting ähnelt. + /// + public static string Setting_AppSetting_FunctionSetting_TimeTableSetting_Enum { + get { + return ResourceManager.GetString("Setting_AppSetting_FunctionSetting_TimeTableSetting_Enum", resourceCulture); + } + } + + /// + /// Sucht eine lokalisierte Zeichenfolge, die Appsetting_Locatingsetting ähnelt. + /// + public static string Setting_AppSetting_LocatingSetting_Enum { + get { + return ResourceManager.GetString("Setting_AppSetting_LocatingSetting_Enum", resourceCulture); + } + } + + /// + /// Sucht eine lokalisierte Zeichenfolge, die Appsetting_Networksetting ähnelt. + /// + public static string Setting_AppSetting_NetworkSetting_Enum { + get { + return ResourceManager.GetString("Setting_AppSetting_NetworkSetting_Enum", resourceCulture); + } + } + /// /// Sucht eine lokalisierte Zeichenfolge, die 767 ähnelt. /// @@ -1321,7 +1456,7 @@ namespace CampusAppWP8.Resources { } /// - /// Sucht eine lokalisierte Zeichenfolge, die 20131 ähnelt. + /// Sucht eine lokalisierte Zeichenfolge, die 20132 ähnelt. /// public static string Setting_DefaultSemester { get { @@ -1329,6 +1464,33 @@ namespace CampusAppWP8.Resources { } } + /// + /// Sucht eine lokalisierte Zeichenfolge, die Setting ähnelt. + /// + public static string Setting_Enum { + get { + return ResourceManager.GetString("Setting_Enum", resourceCulture); + } + } + + /// + /// Sucht eine lokalisierte Zeichenfolge, die MensaDefaultCampus ähnelt. + /// + public static string Setting_Mensa_DefaultCampus { + get { + return ResourceManager.GetString("Setting_Mensa_DefaultCampus", resourceCulture); + } + } + + /// + /// Sucht eine lokalisierte Zeichenfolge, die UserSetting ähnelt. + /// + public static string Settingt_UserSetting_Enum { + get { + return ResourceManager.GetString("Settingt_UserSetting_Enum", resourceCulture); + } + } + /// /// Sucht eine lokalisierte Zeichenfolge, die 1 ähnelt. /// diff --git a/CampusAppWP8/CampusAppWP8/Settings.cs b/CampusAppWP8/CampusAppWP8/Settings.cs index a02b99fb..1731e7b2 100644 --- a/CampusAppWP8/CampusAppWP8/Settings.cs +++ b/CampusAppWP8/CampusAppWP8/Settings.cs @@ -1,39 +1,36 @@ //----------------------------------------------------------------------- // -// Company copyright tag. +// The MIT License (MIT). Copyright (c) 2013 BTU/IIT. // -// stubbfel -// 23.07.2013 -//---------------------------------------------------------------------- - +// Stubbfel +// 25.11.2013 +// Implements the settings class +//----------------------------------------------------------------------- namespace CampusAppWP8 { + using System; using CampusAppWP8.Model.Setting; + using CampusAppWP8.Resources; - /// - /// Class handle all setting (files) - /// + /// Class handle all setting (files) + /// Stubbfel, 25.11.2013. + /// public static class Settings { #region Member - /// - /// reference of the user-profile-file - /// + /// reference of the user-profile-file. private static UserProfilModel userProfil = new UserProfilModel(); - /// - /// reference of the appSettings - /// + /// reference of the appSettings. private static AppSettings appSetting = new AppSettings(); #endregion #region Property - /// - /// Gets or sets the user-profile-file - /// + /// Gets or sets the user-profile-file. + /// The user profile. public static UserProfilModel UserProfil { get @@ -50,9 +47,8 @@ namespace CampusAppWP8 } } - /// - /// Gets or sets the AppSetting - /// + /// Gets or sets the AppSetting. + /// The application setting. public static AppSettings AppSetting { get @@ -70,5 +66,65 @@ namespace CampusAppWP8 } #endregion + + #region method + + /// Sets setting to default. + /// Stubbfel, 25.11.2013. + public static void SetSettingToDefault() + { + Settings.AppSetting.SetSettingToDefault(); + Settings.UserProfil.SetSettingToDefault(); + } + + /// Sets setting to default. + /// Stubbfel, 25.11.2013. + /// The setting key. + public static void SetSettingToDefault(string settingKey) + { + SettingType type = (SettingType)Enum.Parse(typeof(SettingType), settingKey); + + switch (type) + { + case SettingType.Appsetting: + AppSetting.SetSettingToDefault(); + break; + case SettingType.UserSetting: + UserProfil.SetSettingToDefault(); + break; + case SettingType.Appsetting_Functionsetting: + AppSetting.FunctionSettings.SetSettingToDefault(); + break; + case SettingType.Appsetting_Locatingsetting: + + // spezial case + AppSetting.LocatingSetting.SetSettingToDefault(); + AppSetting.NetworkSetting.SetSettingToDefault(); + break; + case SettingType.Appsetting_Networksetting: + + // spezial case + AppSetting.LocatingSetting.SetSettingToDefault(); + AppSetting.NetworkSetting.SetSettingToDefault(); + break; + case SettingType.Appsetting_Functionsetting_Mensasetting: + AppSetting.FunctionSettings.MensaSetting.SetSettingToDefault(); + break; + case SettingType.Appsetting_Functionsetting_Tagsetting: + AppSetting.FunctionSettings.TagSetting.SetSettingToDefault(); + break; + case SettingType.Appsetting_Functionsetting_TimeTablesetting: + AppSetting.FunctionSettings.TimeTableSetting.SetSettingToDefault(); + break; + case SettingType.Setting: + Settings.SetSettingToDefault(); + break; + default: + Settings.SetSettingToDefault(); + break; + } + } + + #endregion } } diff --git a/CampusAppWP8/CampusAppWP8/Styles/Labels.xaml b/CampusAppWP8/CampusAppWP8/Styles/Labels.xaml new file mode 100644 index 00000000..99c12003 --- /dev/null +++ b/CampusAppWP8/CampusAppWP8/Styles/Labels.xaml @@ -0,0 +1,13 @@ + + + \ No newline at end of file diff --git a/CampusAppWP8/CampusAppWP8/Utility/Lui/Button/ResetSettingButtonAppBar.cs b/CampusAppWP8/CampusAppWP8/Utility/Lui/Button/ResetSettingButtonAppBar.cs new file mode 100644 index 00000000..1e31b756 --- /dev/null +++ b/CampusAppWP8/CampusAppWP8/Utility/Lui/Button/ResetSettingButtonAppBar.cs @@ -0,0 +1,43 @@ +//----------------------------------------------------------------------- +// +// The MIT License (MIT). Copyright (c) 2013 BTU/IIT. +// +// 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. + /// Stubbfel, 15.10.2013. + /// + public class ResetSettingButtonAppBar : ApplicationBarIconButton + { + #region Members + + /// IconUri of the Button. + private static Uri iconUri = new Uri(Icons.Link, UriKind.Relative); + + /// Text of the Button. + private static string text = AppResources.ResetBtn; + + #endregion + + #region Constructors + + /// Initializes a new instance of the class. + /// Stubbfel, 15.10.2013. + public ResetSettingButtonAppBar() + : base() + { + this.IconUri = ResetSettingButtonAppBar.iconUri; + this.Text = ResetSettingButtonAppBar.text; + } + + #endregion + } +} diff --git a/CampusAppWP8/CampusAppWP8/Utility/Lui/Button/ToDefaultButton.cs b/CampusAppWP8/CampusAppWP8/Utility/Lui/Button/ToDefaultButton.cs new file mode 100644 index 00000000..f75ad7eb --- /dev/null +++ b/CampusAppWP8/CampusAppWP8/Utility/Lui/Button/ToDefaultButton.cs @@ -0,0 +1,80 @@ +//----------------------------------------------------------------------- +// +// The MIT License (MIT). Copyright (c) 2013 BTU/IIT. +// +// Stubbfel +// 25.11.2013 +// Implements to default button class +//----------------------------------------------------------------------- +namespace CampusAppWP8.Utility.Lui.Button +{ + using System; + using System.Windows; + using System.Windows.Controls; + using System.Windows.Media.Imaging; + using CampusAppWP8.Pages.Setting; + using CampusAppWP8.Resources; + + + /// Add person button. + /// Stubbfel, 12.09.2013. + /// + public class ToDefaultButton : System.Windows.Controls.Button + { + #region Member + + /// The person identifier property. + public static readonly DependencyProperty SettingTypeProperty = DependencyProperty.Register("SettingType", typeof(object), typeof(ToDefaultButton), new PropertyMetadata(false)); + + /// The icon. + private static BitmapImage icon = new BitmapImage(new Uri(Icons.Link, UriKind.Relative)); + + #endregion + + #region Constructor + + /// Initializes a new instance of the ToDefaultButton class. + /// Stubbfel, 25.11.2013. + public ToDefaultButton() + : base() + { + this.Content = new Image + { + Source = icon + }; + } + + #endregion + + #region Property + + /// Gets or sets the type of the setting. + /// The type of the setting. + public object SettingType + { + get { return (object)this.GetValue(SettingTypeProperty); } + set { this.SetValue(SettingTypeProperty, value); } + } + + /// + /// Löst das -Ereignis + /// aus. + /// + /// Stubbfel, 25.11.2013. + /// + protected override void OnClick() + { + if (this.SettingType != null) + { + Settings.SetSettingToDefault(this.SettingType.ToString()); + Page page = App.RootFrame.Content as Page; + if (typeof(IRefreshingPage).IsInstanceOfType(page)) + { + ((IRefreshingPage)page).RefreshPage(); + } + } + } + + #endregion + } +} diff --git a/CampusAppWP8/CampusAppWP8/Utility/Lui/Tiles/TileCreator.cs b/CampusAppWP8/CampusAppWP8/Utility/Lui/Tiles/TileCreator.cs index d2ccdae3..5690eceb 100644 --- a/CampusAppWP8/CampusAppWP8/Utility/Lui/Tiles/TileCreator.cs +++ b/CampusAppWP8/CampusAppWP8/Utility/Lui/Tiles/TileCreator.cs @@ -169,7 +169,7 @@ namespace CampusAppWP8.Utility.Lui.Tiles { string path; string name = "NFC -> "; - switch (Settings.AppSetting.TagDefaultHandler) + switch (Settings.AppSetting.FunctionSettings.TagSetting.TagDefaultHandler) { case BTUTagDefaultHandler.CampusMap: path = Constants.PathCampusmap_Campusmap; diff --git a/CampusAppWP8/CampusAppWP8/Utility/Utilities.cs b/CampusAppWP8/CampusAppWP8/Utility/Utilities.cs index f1df31c3..70a4f339 100644 --- a/CampusAppWP8/CampusAppWP8/Utility/Utilities.cs +++ b/CampusAppWP8/CampusAppWP8/Utility/Utilities.cs @@ -230,7 +230,7 @@ namespace CampusAppWP8.Utility /// the position of the phone. public static GeoPosition DetermineCurrentPosition(GeoPositionAccuracy accuracy = GeoPositionAccuracy.High) { - if (!Settings.AppSetting.GeoWatchEnable) + if (!Settings.AppSetting.LocatingSetting.GeoWatchEnable) { return null; } @@ -351,7 +351,7 @@ namespace CampusAppWP8.Utility /// The load modus< t> public static ForceType GetLoadModus() { - if (Settings.AppSetting.OnlyWifi && !Settings.AppSetting.WifiEnable) + if (Settings.AppSetting.NetworkSetting.OnlyWifi && !Settings.AppSetting.NetworkSetting.WifiEnable) { return ForceType.FORCE_FILE; } @@ -381,8 +381,6 @@ namespace CampusAppWP8.Utility public static Campus DetermineCampus(GeoPositionAccuracy accuracy = GeoPositionAccuracy.Default) { Campus result = Campus.UserSettingCampus; - - Utilities.DetermineAndStoreCurrentPosition(accuracy); MapPoint currentPoint = App.LoadFromAppState("CurrentGeoPoint"); @@ -390,7 +388,6 @@ namespace CampusAppWP8.Utility { if (accuracy.Equals(GeoPositionAccuracy.High)) { - return result; } else @@ -448,7 +445,6 @@ namespace CampusAppWP8.Utility obj.SelectedIndex = -1; } } - #endregion } } \ No newline at end of file diff --git a/CampusAppWP8/CampusAppWPortalLib8/Model/Utility/CampusListPickerItemListModel.cs b/CampusAppWP8/CampusAppWPortalLib8/Model/Utility/CampusListPickerItemListModel.cs index 87d175ac..810cd1be 100644 --- a/CampusAppWP8/CampusAppWPortalLib8/Model/Utility/CampusListPickerItemListModel.cs +++ b/CampusAppWP8/CampusAppWPortalLib8/Model/Utility/CampusListPickerItemListModel.cs @@ -21,10 +21,11 @@ namespace CampusAppWPortalLib8.Model.Utility /// Initializes a new instance of the class. /// /// Stubbfel, 15.10.2013. - public CampusListPickerItemListModel() + /// (Optional) the user settings. + public CampusListPickerItemListModel(bool userSettings = false) : base() { - this.LoadList(); + this.LoadList(userSettings); } #endregion @@ -33,9 +34,15 @@ namespace CampusAppWPortalLib8.Model.Utility /// Overrides the LoadList-Method /// Stubbfel, 15.10.2013. + /// (Optional) the user settings. /// - protected override void LoadList() + protected void LoadList(bool userSettings = false) { + if (userSettings) + { + this.AddItem(new ListPickerItemModel(((int)CampusAppWPortalLib8.Model.Settings.Campus.UserSettingCampus).ToString(), AppResources.Campus_UserSetting); + } + this.AddItem(new ListPickerItemModel(((int)CampusAppWPortalLib8.Model.Settings.Campus.CB_MAIN).ToString(), AppResources.Campus_CBMain)); this.AddItem(new ListPickerItemModel(((int)CampusAppWPortalLib8.Model.Settings.Campus.CB_NORTH).ToString(), AppResources.Campus_CBNorth)); this.AddItem(new ListPickerItemModel(((int)CampusAppWPortalLib8.Model.Settings.Campus.CB_SOUTH).ToString(), AppResources.Campus_CBSouth)); diff --git a/CampusAppWP8/CampusAppWPortalLib8/Resources/AppResources.Designer.cs b/CampusAppWP8/CampusAppWPortalLib8/Resources/AppResources.Designer.cs index c607563d..be12509b 100644 --- a/CampusAppWP8/CampusAppWPortalLib8/Resources/AppResources.Designer.cs +++ b/CampusAppWP8/CampusAppWPortalLib8/Resources/AppResources.Designer.cs @@ -97,6 +97,15 @@ namespace CampusAppWPortalLib8.Resources { } } + /// + /// Sucht eine lokalisierte Zeichenfolge, die wie in Profileinstellungen ähnelt. + /// + public static string Campus_UserSetting { + get { + return ResourceManager.GetString("Campus_UserSetting", resourceCulture); + } + } + /// /// Sucht eine lokalisierte Zeichenfolge, die Bachelor ähnelt. /// diff --git a/CampusAppWP8/CampusAppWPortalLib8/Resources/AppResources.resx b/CampusAppWP8/CampusAppWPortalLib8/Resources/AppResources.resx index 475cb1d9..80d424b6 100644 --- a/CampusAppWP8/CampusAppWPortalLib8/Resources/AppResources.resx +++ b/CampusAppWP8/CampusAppWPortalLib8/Resources/AppResources.resx @@ -129,6 +129,9 @@ Senftenberg + + wie in Profileinstellungen + Bachelor