diff --git a/CampusAppWP8/CampusAppWP8/App.xaml b/CampusAppWP8/CampusAppWP8/App.xaml index 282eda77..443e964d 100644 --- a/CampusAppWP8/CampusAppWP8/App.xaml +++ b/CampusAppWP8/CampusAppWP8/App.xaml @@ -12,11 +12,12 @@ + + - diff --git a/CampusAppWP8/CampusAppWP8/App.xaml.cs b/CampusAppWP8/CampusAppWP8/App.xaml.cs index 3b4121ce..b5ddfcdb 100644 --- a/CampusAppWP8/CampusAppWP8/App.xaml.cs +++ b/CampusAppWP8/CampusAppWP8/App.xaml.cs @@ -10,6 +10,7 @@ using System.IO.IsolatedStorage; using System.Threading; using System.Windows; using System.Windows.Markup; +using System.Windows.Media; using System.Windows.Navigation; @@ -157,19 +158,32 @@ namespace CampusAppWP8 Settings.AppSetting.InitApp = false; } + Color appColor = ((SolidColorBrush)App.Current.Resources["PhoneAccentBrush"]).Color; + if (!Settings.AppSetting.DisplaySetting.PhoneAccentColor.Equals(appColor)) + { + if (Settings.AppSetting.DisplaySetting.AppAccentColor.Equals(Settings.AppSetting.DisplaySetting.PhoneAccentColor)) + { + Settings.AppSetting.DisplaySetting.AppAccentColor = appColor; + } + Settings.AppSetting.DisplaySetting.PhoneAccentColor = appColor; + } + + appColor = Settings.AppSetting.DisplaySetting.AppAccentColor; + Utilities.SwitchAccentColor(appColor); + 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/Assets/Icons/DarkTheme/cancel_159.png b/CampusAppWP8/CampusAppWP8/Assets/Icons/DarkTheme/cancel_159.png new file mode 100644 index 00000000..e02a5c12 Binary files /dev/null and b/CampusAppWP8/CampusAppWP8/Assets/Icons/DarkTheme/cancel_159.png differ diff --git a/CampusAppWP8/CampusAppWP8/Assets/Icons/DarkTheme/prefs2_159.png b/CampusAppWP8/CampusAppWP8/Assets/Icons/DarkTheme/prefs2_159.png new file mode 100644 index 00000000..f60ed022 Binary files /dev/null and b/CampusAppWP8/CampusAppWP8/Assets/Icons/DarkTheme/prefs2_159.png differ diff --git a/CampusAppWP8/CampusAppWP8/Assets/Icons/DarkTheme/reset_159.png b/CampusAppWP8/CampusAppWP8/Assets/Icons/DarkTheme/reset_159.png new file mode 100644 index 00000000..5862ae6d Binary files /dev/null and b/CampusAppWP8/CampusAppWP8/Assets/Icons/DarkTheme/reset_159.png differ diff --git a/CampusAppWP8/CampusAppWP8/Assets/Icons/DarkTheme/showDay_159.png b/CampusAppWP8/CampusAppWP8/Assets/Icons/DarkTheme/showDay_159.png new file mode 100644 index 00000000..65d99860 Binary files /dev/null and b/CampusAppWP8/CampusAppWP8/Assets/Icons/DarkTheme/showDay_159.png differ diff --git a/CampusAppWP8/CampusAppWP8/Assets/Icons/DarkTheme/showWeek_159.png b/CampusAppWP8/CampusAppWP8/Assets/Icons/DarkTheme/showWeek_159.png new file mode 100644 index 00000000..9e51e134 Binary files /dev/null and b/CampusAppWP8/CampusAppWP8/Assets/Icons/DarkTheme/showWeek_159.png differ diff --git a/CampusAppWP8/CampusAppWP8/Assets/Icons/DarkTheme/zoomin_159.png b/CampusAppWP8/CampusAppWP8/Assets/Icons/DarkTheme/zoomin_159.png new file mode 100644 index 00000000..0c0e3d85 Binary files /dev/null and b/CampusAppWP8/CampusAppWP8/Assets/Icons/DarkTheme/zoomin_159.png differ diff --git a/CampusAppWP8/CampusAppWP8/Assets/Icons/DarkTheme/zoomout_159.png b/CampusAppWP8/CampusAppWP8/Assets/Icons/DarkTheme/zoomout_159.png new file mode 100644 index 00000000..b43afec6 Binary files /dev/null and b/CampusAppWP8/CampusAppWP8/Assets/Icons/DarkTheme/zoomout_159.png differ diff --git a/CampusAppWP8/CampusAppWP8/Assets/Icons/LightTheme/cancel_159.png b/CampusAppWP8/CampusAppWP8/Assets/Icons/LightTheme/cancel_159.png new file mode 100644 index 00000000..833076f3 Binary files /dev/null and b/CampusAppWP8/CampusAppWP8/Assets/Icons/LightTheme/cancel_159.png differ diff --git a/CampusAppWP8/CampusAppWP8/Assets/Icons/LightTheme/edit_159.png b/CampusAppWP8/CampusAppWP8/Assets/Icons/LightTheme/edit_159.png new file mode 100644 index 00000000..dca05652 Binary files /dev/null and b/CampusAppWP8/CampusAppWP8/Assets/Icons/LightTheme/edit_159.png differ diff --git a/CampusAppWP8/CampusAppWP8/Assets/Icons/LightTheme/prefs2_159.png b/CampusAppWP8/CampusAppWP8/Assets/Icons/LightTheme/prefs2_159.png new file mode 100644 index 00000000..f8d492dd Binary files /dev/null and b/CampusAppWP8/CampusAppWP8/Assets/Icons/LightTheme/prefs2_159.png differ diff --git a/CampusAppWP8/CampusAppWP8/Assets/Icons/LightTheme/reset_159.png b/CampusAppWP8/CampusAppWP8/Assets/Icons/LightTheme/reset_159.png new file mode 100644 index 00000000..7fe51c15 Binary files /dev/null and b/CampusAppWP8/CampusAppWP8/Assets/Icons/LightTheme/reset_159.png differ diff --git a/CampusAppWP8/CampusAppWP8/Assets/Icons/LightTheme/showDay_159.png b/CampusAppWP8/CampusAppWP8/Assets/Icons/LightTheme/showDay_159.png new file mode 100644 index 00000000..80e7a210 Binary files /dev/null and b/CampusAppWP8/CampusAppWP8/Assets/Icons/LightTheme/showDay_159.png differ diff --git a/CampusAppWP8/CampusAppWP8/Assets/Icons/LightTheme/showWeek_159.png b/CampusAppWP8/CampusAppWP8/Assets/Icons/LightTheme/showWeek_159.png new file mode 100644 index 00000000..09c284fc Binary files /dev/null and b/CampusAppWP8/CampusAppWP8/Assets/Icons/LightTheme/showWeek_159.png differ diff --git a/CampusAppWP8/CampusAppWP8/Assets/Icons/LightTheme/zoomin_159.png b/CampusAppWP8/CampusAppWP8/Assets/Icons/LightTheme/zoomin_159.png new file mode 100644 index 00000000..81398c25 Binary files /dev/null and b/CampusAppWP8/CampusAppWP8/Assets/Icons/LightTheme/zoomin_159.png differ diff --git a/CampusAppWP8/CampusAppWP8/Assets/Icons/LightTheme/zoomout_159.png b/CampusAppWP8/CampusAppWP8/Assets/Icons/LightTheme/zoomout_159.png new file mode 100644 index 00000000..4b7f5a8a Binary files /dev/null and b/CampusAppWP8/CampusAppWP8/Assets/Icons/LightTheme/zoomout_159.png differ diff --git a/CampusAppWP8/CampusAppWP8/CampusAppWP8.csproj b/CampusAppWP8/CampusAppWP8/CampusAppWP8.csproj index 14b52676..3ea5d78d 100644 --- a/CampusAppWP8/CampusAppWP8/CampusAppWP8.csproj +++ b/CampusAppWP8/CampusAppWP8/CampusAppWP8.csproj @@ -133,10 +133,25 @@ + + + + + + + + + + + + FunctionSettingPage.xaml + + + Appointment.xaml @@ -155,7 +170,9 @@ TimeTableWeek.xaml - + + + @@ -239,13 +256,15 @@ - + - + + + DefaultHeader.xaml @@ -266,7 +285,7 @@ WeekViewDay.xaml - + NFC.xaml @@ -482,6 +501,10 @@ Designer MSBuild:Compile + + Designer + MSBuild:Compile + Designer MSBuild:Compile @@ -522,6 +545,14 @@ MSBuild:Compile Designer + + MSBuild:Compile + Designer + + + MSBuild:Compile + Designer + MSBuild:Compile Designer @@ -572,20 +603,36 @@ PreserveNewest + + + + + + + + + + + + + + + + diff --git a/CampusAppWP8/CampusAppWP8/Model/Setting/AppSettings.cs b/CampusAppWP8/CampusAppWP8/Model/Setting/AppSettings.cs index 4b062399..1224cdcb 100644 --- a/CampusAppWP8/CampusAppWP8/Model/Setting/AppSettings.cs +++ b/CampusAppWP8/CampusAppWP8/Model/Setting/AppSettings.cs @@ -8,26 +8,99 @@ //----------------------------------------------------------------------- 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(); + + private static DisplaySetting displaySetting = new DisplaySetting(); + + #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 display setting. + /// The display setting. + public DisplaySetting DisplaySetting { get { - return App.LoadFromAppState(Constants.AppSetting_GeoWatchEnable); + return AppSettings.displaySetting; } set { - App.SaveToAppState(Constants.AppSetting_GeoWatchEnable, value); + if (AppSettings.displaySetting != value) + { + AppSettings.displaySetting = value; + } + } + } + + /// Gets or sets the locating setting. + /// The locating setting. + public LocatingSetting LocatingSetting + { + get + { + return AppSettings.locatingSetting; + } + + set + { + 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 +134,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 +149,29 @@ 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(); + this.DisplaySetting.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/DisplaySetting.cs b/CampusAppWP8/CampusAppWP8/Model/Setting/DisplaySetting.cs new file mode 100644 index 00000000..3416267f --- /dev/null +++ b/CampusAppWP8/CampusAppWP8/Model/Setting/DisplaySetting.cs @@ -0,0 +1,64 @@ +using CampusAppWP8.Resources; +//----------------------------------------------------------------------- +// +// The MIT License (MIT). Copyright (c) 2013 BTU/IIT. +// +// Stubbfel +// 26.11.2013 +// Implements the display setting class +//----------------------------------------------------------------------- +using System.Windows.Media; + +namespace CampusAppWP8.Model.Setting +{ + /// A display setting. + /// Stubbfel, 26.11.2013. + /// + public class DisplaySetting : ISetting + { + #region property + + /// Gets or sets the color of the application accent. + /// The color of the application accent. + public Color AppAccentColor + { + get + { + return App.LoadFromAppState(Constants.Setting_AppAccentColor); + } + + set + { + App.SaveToAppState(Constants.Setting_AppAccentColor, value); + } + } + + /// Gets or sets the color of the phone accent. + /// The color of the phone accent. + public Color PhoneAccentColor + { + get + { + return App.LoadFromAppState(Constants.Setting_PhoneAccentColor); + } + + set + { + App.SaveToAppState(Constants.Setting_PhoneAccentColor, value); + } + } + + #endregion + + #region method + + /// Sets setting to default. + /// Stubbfel, 25.11.2013. + /// + public void SetSettingToDefault() + { + this.AppAccentColor = this.PhoneAccentColor; + } + #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..80c9ff1f --- /dev/null +++ b/CampusAppWP8/CampusAppWP8/Model/Setting/MensaSetting.cs @@ -0,0 +1,88 @@ +//----------------------------------------------------------------------- +// +// 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. That means if the Campus is UserSettingCampus then + /// return the Campus from user profil. + /// + /// 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/Model/Utility/AppAccentColorListPickerItemListModel.cs b/CampusAppWP8/CampusAppWP8/Model/Utility/AppAccentColorListPickerItemListModel.cs new file mode 100644 index 00000000..45d8364c --- /dev/null +++ b/CampusAppWP8/CampusAppWP8/Model/Utility/AppAccentColorListPickerItemListModel.cs @@ -0,0 +1,91 @@ +//----------------------------------------------------------------------- +// +// The MIT License (MIT). Copyright (c) 2013 BTU/IIT. +// +// Stubbfel +// 26.11.2013 +// Implements the application accent color list picker item list model class +//----------------------------------------------------------------------- +namespace CampusAppWP8.Model.Utility +{ + using System.Windows.Media; + using CampusAppWP8.Resources; + + /// A data Model for the application accent color list picker item list. + /// Stubbfel, 26.11.2013. + /// + public class AppAccentColorListPickerItemListModel : CampusAppWPortalLib8.Model.Utility.ListPickerItemListTemplateModel + { + #region member + + /// The faculty 1 color. + private static readonly SolidColorBrush Faculty1Color = (SolidColorBrush)App.Current.Resources[Constants.Brush_Faculty1]; + + /// The faculty 2 color. + private static readonly SolidColorBrush Faculty2Color = (SolidColorBrush)App.Current.Resources[Constants.Brush_Faculty2]; + + /// The faculty 3 color. + private static readonly SolidColorBrush Faculty3Color = (SolidColorBrush)App.Current.Resources[Constants.Brush_Faculty3]; + + /// The faculty 4 color. + private static readonly SolidColorBrush Faculty4Color = (SolidColorBrush)App.Current.Resources[Constants.Brush_Faculty4]; + + /// The faculty 5 color. + private static readonly SolidColorBrush Faculty5Color = (SolidColorBrush)App.Current.Resources[Constants.Brush_Faculty5]; + + /// The faculty. + private readonly string faculty = CampusAppWPortalLib8.Resources.AppResources.Faculty; + + #endregion + + #region Constructor + + /// + /// Initializes a new instance of the AppAccentColorListPickerItemListModel class. + /// + /// Stubbfel, 26.11.2013. + public AppAccentColorListPickerItemListModel() + : base() + { + this.LoadList(); + } + + #endregion + + #region Method + + /// Gets index or default. + /// Stubbfel, 27.11.2013. + /// The value. + /// The index or default. + public override int GetIndexOrDefault(SolidColorBrush value) + { + int index = 0; + foreach (ColorListPickerItemModel brush in this.List) + { + if (brush.Value.Color.Equals(value.Color)) + { + break; + } + + index++; + } + + return index; + } + + /// Loads the list. + /// Stubbfel, 26.11.2013. + protected override void LoadList() + { + this.AddItem(new ColorListPickerItemModel(new SolidColorBrush(Settings.AppSetting.DisplaySetting.PhoneAccentColor), CampusAppWP8.Resources.AppResources.AccentColor)); + this.AddItem(new ColorListPickerItemModel(AppAccentColorListPickerItemListModel.Faculty1Color, this.faculty + " 1")); + this.AddItem(new ColorListPickerItemModel(AppAccentColorListPickerItemListModel.Faculty2Color, this.faculty + " 2")); + this.AddItem(new ColorListPickerItemModel(AppAccentColorListPickerItemListModel.Faculty3Color, this.faculty + " 3")); + this.AddItem(new ColorListPickerItemModel(AppAccentColorListPickerItemListModel.Faculty4Color, this.faculty + " 4")); + this.AddItem(new ColorListPickerItemModel(AppAccentColorListPickerItemListModel.Faculty5Color, this.faculty + " 5")); + } + + #endregion + } +} diff --git a/CampusAppWP8/CampusAppWP8/Model/Utility/ColorListPickerItemModel.cs b/CampusAppWP8/CampusAppWP8/Model/Utility/ColorListPickerItemModel.cs new file mode 100644 index 00000000..21e6587b --- /dev/null +++ b/CampusAppWP8/CampusAppWP8/Model/Utility/ColorListPickerItemModel.cs @@ -0,0 +1,34 @@ +//----------------------------------------------------------------------- +// +// The MIT License (MIT). Copyright (c) 2013 BTU/IIT. +// +// Stubbfel +// 26.11.2013 +// Implements the color list picker item model class +//----------------------------------------------------------------------- +namespace CampusAppWP8.Model.Utility +{ + using System.Windows.Media; + + /// A data Model for the color list picker item. + /// Stubbfel, 26.11.2013. + /// + public class ColorListPickerItemModel : CampusAppWPortalLib8.Model.Utility.ListPickerItemTemplateModel + { + /// Initializes a new instance of the ColorListPickerItemModel class. + /// Stubbfel, 26.11.2013. + public ColorListPickerItemModel() + : base() + { + } + + /// Initializes a new instance of the ColorListPickerItemModel class. + /// Stubbfel, 26.11.2013. + /// The value. + /// The text. + public ColorListPickerItemModel(SolidColorBrush value, string text) + : base(value, text) + { + } + } +} 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/Campusmap/RoomListPage.xaml b/CampusAppWP8/CampusAppWP8/Pages/Campusmap/RoomListPage.xaml index ac0bb7cd..052cbad9 100644 --- a/CampusAppWP8/CampusAppWP8/Pages/Campusmap/RoomListPage.xaml +++ b/CampusAppWP8/CampusAppWP8/Pages/Campusmap/RoomListPage.xaml @@ -9,6 +9,8 @@ xmlns:lui="clr-namespace:CampusAppWP8.Utility.Lui.Button" xmlns:toolkit="clr-namespace:Microsoft.Phone.Controls;assembly=Microsoft.Phone.Controls.Toolkit" xmlns:header="clr-namespace:CampusAppWP8.Utility.Lui.Header" + xmlns:lu="clr-namespace:CampusAppWP8.Utility.Lui" + xmlns:conv="clr-namespace:CampusAppWP8.Utility.Converter" FontFamily="{StaticResource PhoneFontFamilyNormal}" FontSize="{StaticResource PhoneFontSizeNormal}" Foreground="{StaticResource PhoneForegroundBrush}" @@ -17,53 +19,102 @@ shell:SystemTray.IsVisible="True" x:Name="root"> + + + + + + + + + - + - + + + - - + + + - - - - - - - - - + + + + + + + + + + + - - - - - - - - - - - - - - + + + + + + + + + - + \ No newline at end of file diff --git a/CampusAppWP8/CampusAppWP8/Pages/Campusmap/RoomListPage.xaml.cs b/CampusAppWP8/CampusAppWP8/Pages/Campusmap/RoomListPage.xaml.cs index 69fb12ef..958db5b2 100644 --- a/CampusAppWP8/CampusAppWP8/Pages/Campusmap/RoomListPage.xaml.cs +++ b/CampusAppWP8/CampusAppWP8/Pages/Campusmap/RoomListPage.xaml.cs @@ -10,6 +10,7 @@ namespace CampusAppWP8.Pages.Campusmap { using System; using System.Collections.Generic; + using System.Collections.ObjectModel; using System.Linq; using System.Windows; using System.Windows.Controls; @@ -51,8 +52,19 @@ namespace CampusAppWP8.Pages.Campusmap /// The offset point. private MapPoint offsetPoint; + /// The selected layer. private string selectedLayer = string.Empty; + /// List of room pickers. + private ObservableCollection roomPickerList = new ObservableCollection(); + /// The view bounds. + private Rect viewBounds = new Rect(); + + /// The marker pin. + private UIElement markerPin = null; + /// The canvas scale. + private double canvasScale = 1.0; + #endregion #region Constructor @@ -62,10 +74,25 @@ namespace CampusAppWP8.Pages.Campusmap public RoomListPage() { this.InitializeComponent(); + + ApplicationBarIconButton btnZoomIn = new ApplicationBarIconButton(); + btnZoomIn.IconUri = new Uri(Icons.ZoomIn, UriKind.Relative); + btnZoomIn.Text = AppResources.ZoomIn; + btnZoomIn.Click += this.BtnZoomIn_Click; + + ApplicationBarIconButton btnZoomOut = new ApplicationBarIconButton(); + btnZoomOut.IconUri = new Uri(Icons.ZoomOut, UriKind.Relative); + btnZoomOut.Text = AppResources.ZoomOut; + btnZoomOut.Click += this.BtnZoomOut_Click; + + this.ApplicationBar.Buttons.Add(btnZoomIn); + this.ApplicationBar.Buttons.Add(btnZoomOut); } #endregion + /// Gets or sets the selected layer. + /// The selected layer. private string SelectedLayer { get @@ -75,8 +102,27 @@ namespace CampusAppWP8.Pages.Campusmap set { - this.selectedLayer = value; - this.LayerTag.Text = value; + if (this.selectedLayer != value) + { + this.selectedLayer = value; + this.LayerTag.Text = value; + this.UpdateRoomList(value); + } + } + } + + /// Gets or sets a list of room pickers. + /// A List of room pickers. + public ObservableCollection RoomPickerList + { + get + { + return this.roomPickerList; + } + + set + { + this.roomPickerList = value; } } @@ -170,7 +216,7 @@ namespace CampusAppWP8.Pages.Campusmap x = room.GeoRefPoint.Longitude; y = room.GeoRefPoint.Latitude; MapPoint roompoint = this.buildingMap.GetScrollPoint(this.buildingMap.ConverToPixelPoint(this.buildingMap.ConverToMapPoint(x, y))); - MapPoint viewPoint = roompoint - this.mappoint + this.offsetPoint; + MapPoint viewPoint = roompoint + this.offsetPoint; //- this.mappoint MapCanvas.Children.Add(this.buildingMap.AddPin(viewPoint, PinType.InfoRedPlace, new List { room })); } @@ -320,7 +366,7 @@ namespace CampusAppWP8.Pages.Campusmap x = room.GeoRefPoint.Longitude; y = room.GeoRefPoint.Latitude; MapPoint roompoint = this.buildingMap.GetScrollPoint(this.buildingMap.ConverToPixelPoint(this.buildingMap.ConverToMapPoint(x, y))); - MapPoint viewPoint = roompoint - this.mappoint + this.offsetPoint; + MapPoint viewPoint = roompoint + this.offsetPoint; // -this.mappoint; PinType type; @@ -375,11 +421,15 @@ namespace CampusAppWP8.Pages.Campusmap this.MapCanvas.DataContext = this.buildingMap; - Canvas.SetLeft(this.imgMap, -1 * this.mappoint.X); - Canvas.SetTop(this.imgMap, -1 * this.mappoint.Y); - Canvas.SetZIndex(this.imgMap, 0); + //Canvas.SetLeft(this.imgMap, -1 * this.mappoint.X); + //Canvas.SetTop(this.imgMap, -1 * this.mappoint.Y); + //Canvas.SetZIndex(this.imgMap, 0); } + /// Raises the system. event. + /// Fiedler, 18.11.2013. + /// Source of the event. + /// Event information to send to registered event handlers. private void OnMenuItemClicked(object sender, System.EventArgs e) { if (this.SelectedLayer.Equals((sender as ApplicationBarMenuItem).Text) == false) @@ -423,25 +473,138 @@ namespace CampusAppWP8.Pages.Campusmap /// Event handler. Called by ZoomIn for tap events. /// Fiedler, 15.11.2013. /// Source of the event. - /// Gesture event information. - private void ZoomIn_Tap(object sender, System.Windows.Input.GestureEventArgs e) + /// Event information. + private void BtnZoomIn_Click(object sender, EventArgs e) { - //throw new NotImplementedException("TODO"); - (this.MapCanvas.RenderTransform as ScaleTransform).ScaleX *= 1.5; - (this.MapCanvas.RenderTransform as ScaleTransform).ScaleY *= 1.5; + if (this.canvasScale >= 3) + { + return; + } + else + { + this.canvasScale *= 1.1; + } + + (this.MapCanvas.RenderTransform as ScaleTransform).ScaleX = this.canvasScale; + (this.MapCanvas.RenderTransform as ScaleTransform).ScaleY = this.canvasScale; + + this.ReCalcBounds(); } /// Event handler. Called by ZoomOut for tap events. /// Fiedler, 15.11.2013. /// Source of the event. - /// Gesture event information. - private void ZoomOut_Tap(object sender, System.Windows.Input.GestureEventArgs e) + /// Event information. + private void BtnZoomOut_Click(object sender, EventArgs e) { - //throw new NotImplementedException("TODO"); - (this.MapCanvas.RenderTransform as ScaleTransform).ScaleX /= 1.5; - (this.MapCanvas.RenderTransform as ScaleTransform).ScaleY /= 1.5; + double tempW = (this.MapCanvas.ActualWidth / this.VPC.ActualWidth); + double tempH = (this.MapCanvas.ActualHeight / this.VPC.ActualHeight); + + if (tempW == 1 || tempH == 1) + { + return; + } + else if ((this.MapCanvas.ActualWidth * this.canvasScale * 0.95) < this.VPC.ActualWidth || (this.MapCanvas.ActualHeight * this.canvasScale * 0.95) < this.VPC.ActualHeight) + { + tempW = (this.VPC.ActualWidth / this.MapCanvas.ActualWidth); + tempH = (this.VPC.ActualHeight / this.MapCanvas.ActualHeight); + + if (tempH < tempW) + { + this.canvasScale = tempW; + } + else + { + this.canvasScale = tempH; + } + } + else + { + this.canvasScale *= 0.95; + } + + (this.MapCanvas.RenderTransform as ScaleTransform).ScaleX = this.canvasScale; + (this.MapCanvas.RenderTransform as ScaleTransform).ScaleY = this.canvasScale; + + this.ReCalcBounds(); + } + + /// Searches for the first room. + /// Fiedler, 18.11.2013. + /// Source of the event. + /// Event information. + private void SearchRoom(object sender, EventArgs e) + { + this.RoomPicker.Open(); + } + + /// Updates the room list described by level. + /// Fiedler, 18.11.2013. + /// The level. + private void UpdateRoomList(string level) + { + CampusBuildingLayerModel layer = this.building.Layers[level]; + this.roomPickerList.Clear(); + + foreach (PlaceModel room in layer.Rooms.Places) + { + if(room.GetInformationsValue(Constants.PisInformationName_Typ).Equals(Constants.PisInformationValue_Entrance) == false) + { + this.roomPickerList.Add(room); + } + } } #endregion + + /// Event handler. Called by RoomPicker for selection changed events. + /// Fiedler, 18.11.2013. + /// Source of the event. + /// Selection changed event information. + private void RoomPicker_SelectionChanged(object sender, SelectionChangedEventArgs e) + { + if (e.AddedItems != null && e.AddedItems.Count > 0 && e.RemovedItems != null && e.RemovedItems.Count > 0) + { + if (this.markerPin != null) + { + this.MapCanvas.Children.Remove(this.markerPin); + } + + PlaceModel room = e.AddedItems[0] as PlaceModel; + MapPoint viewPoint + = this.buildingMap.GetScrollPoint(this.buildingMap.ConverToPixelPoint(this.buildingMap.ConverToMapPoint(room.GeoRefPoint.Longitude, room.GeoRefPoint.Latitude))) + + this.offsetPoint; + + this.markerPin = this.buildingMap.AddPin(viewPoint, PinType.InfoRedPlace); + + this.MapCanvas.Children.Add(this.markerPin); + } + } + + /// Event handler. Called by MapCanvas for size changed events. + /// Fiedler, 22.11.2013. + /// Source of the event. + /// Size changed event information. + private void MapCanvas_SizeChanged(object sender, SizeChangedEventArgs e) + { + this.ReCalcBounds(); + this.VPC.SetViewportOrigin(new Point(this.mappoint.X, this.mappoint.Y)); + } + + /// Re calculate bounds. + /// Fiedler, 22.11.2013. + private void ReCalcBounds() + { + this.viewBounds.Width = this.MapCanvas.RenderSize.Width * (this.MapCanvas.RenderTransform as ScaleTransform).ScaleX; + this.viewBounds.Height = this.MapCanvas.RenderSize.Height * (this.MapCanvas.RenderTransform as ScaleTransform).ScaleY; + + Point newPos = new Point(); + newPos.X = this.VPC.Viewport.X + ((this.viewBounds.Width - this.VPC.Bounds.Width) * 0.5); + newPos.Y = this.VPC.Viewport.Y + ((this.viewBounds.Height - this.VPC.Bounds.Height) * 0.5); + + this.VPC.Bounds = this.viewBounds; + + this.VPC.SetViewportOrigin(newPos); + } } } \ No newline at end of file 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/Events/EventPage.xaml b/CampusAppWP8/CampusAppWP8/Pages/Events/EventPage.xaml index 48d690c0..1d7123bb 100644 --- a/CampusAppWP8/CampusAppWP8/Pages/Events/EventPage.xaml +++ b/CampusAppWP8/CampusAppWP8/Pages/Events/EventPage.xaml @@ -8,12 +8,18 @@ xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006" xmlns:header="clr-namespace:CampusAppWP8.Utility.Lui.Header" xmlns:page="clr-namespace:CampusAppWP8.Utility.Lui.Page" + xmlns:conv="clr-namespace:CampusAppWP8.Utility.Converter" mc:Ignorable="d" FontFamily="{StaticResource PhoneFontFamilyNormal}" FontSize="{StaticResource PhoneFontSizeNormal}" Foreground="{StaticResource PhoneForegroundBrush}" SupportedOrientations="PortraitOrLandscape" Orientation="Portrait" shell:SystemTray.IsVisible="True"> + + + + + @@ -40,7 +46,7 @@ - + @@ -52,7 +58,7 @@ - + diff --git a/CampusAppWP8/CampusAppWP8/Pages/Mensa/MensaPage.xaml.cs b/CampusAppWP8/CampusAppWP8/Pages/Mensa/MensaPage.xaml.cs index e837fc79..9b1fa2e1 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 @@ -190,7 +190,7 @@ namespace CampusAppWP8.Pages.Mensa { if (mensaCampus == Campus.UserSettingCampus) { - this.InitializeFeed(Settings.UserProfil.DefaultCampus); + this.InitializeFeed(Settings.AppSetting.FunctionSettings.MensaSetting.SelectedMensa); } else { @@ -231,14 +231,14 @@ namespace CampusAppWP8.Pages.Mensa /// Stubbfel, 15.10.2013. private void InitializeFeed() { - if (Settings.AppSetting.GeoWatchEnable) + if (Settings.AppSetting.LocatingSetting.GeoWatchEnable && Settings.AppSetting.FunctionSettings.MensaSetting.AtomMensaSelection) { Thread thread = new Thread(new ThreadStart(this.DeterminCurrentCampusAndLoadFeed)); thread.Start(); } else { - this.InitializeFeed(Settings.UserProfil.DefaultCampus); + this.InitializeFeed(Settings.AppSetting.FunctionSettings.MensaSetting.SelectedMensa); } } @@ -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/News/NewsPage.xaml b/CampusAppWP8/CampusAppWP8/Pages/News/NewsPage.xaml index 5e8423ff..627f2710 100644 --- a/CampusAppWP8/CampusAppWP8/Pages/News/NewsPage.xaml +++ b/CampusAppWP8/CampusAppWP8/Pages/News/NewsPage.xaml @@ -8,12 +8,18 @@ xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006" xmlns:header="clr-namespace:CampusAppWP8.Utility.Lui.Header" xmlns:page="clr-namespace:CampusAppWP8.Utility.Lui.Page" + xmlns:conv="clr-namespace:CampusAppWP8.Utility.Converter" mc:Ignorable="d" FontFamily="{StaticResource PhoneFontFamilyNormal}" FontSize="{StaticResource PhoneFontSizeNormal}" Foreground="{StaticResource PhoneForegroundBrush}" SupportedOrientations="PortraitOrLandscape" Orientation="Portrait" shell:SystemTray.IsVisible="True"> + + + + + @@ -39,7 +45,7 @@ - + @@ -51,7 +57,7 @@ - + diff --git a/CampusAppWP8/CampusAppWP8/Pages/Openinghours/OpeninghoursPage.xaml b/CampusAppWP8/CampusAppWP8/Pages/Openinghours/OpeninghoursPage.xaml index f5e7f4bf..30588de8 100644 --- a/CampusAppWP8/CampusAppWP8/Pages/Openinghours/OpeninghoursPage.xaml +++ b/CampusAppWP8/CampusAppWP8/Pages/Openinghours/OpeninghoursPage.xaml @@ -9,7 +9,7 @@ xmlns:lui="clr-namespace:CampusAppWP8.Utility.Lui.Button" xmlns:header="clr-namespace:CampusAppWP8.Utility.Lui.Header" xmlns:page="clr-namespace:CampusAppWP8.Utility.Lui.Page" - xmlns:utility="clr-namespace:CampusAppWP8.Utility" + xmlns:conv="clr-namespace:CampusAppWP8.Utility.Converter" FontFamily="{StaticResource PhoneFontFamilyNormal}" FontSize="{StaticResource PhoneFontSizeNormal}" Foreground="{StaticResource PhoneForegroundBrush}" @@ -18,8 +18,8 @@ shell:SystemTray.IsVisible="True"> - - + + diff --git a/CampusAppWP8/CampusAppWP8/Pages/Setting/AppSettingPage.xaml b/CampusAppWP8/CampusAppWP8/Pages/Setting/AppSettingPage.xaml index 67797334..91ccc82c 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,138 @@ - + - - - - - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + - - + + + - - - + + + + - - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ 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..09efc36f 100644 --- a/CampusAppWP8/CampusAppWP8/Pages/Setting/AppSettingPage.xaml.cs +++ b/CampusAppWP8/CampusAppWP8/Pages/Setting/AppSettingPage.xaml.cs @@ -9,19 +9,26 @@ namespace CampusAppWP8.Pages.Setting { using System; - using System.Windows.Navigation; - using CampusAppWP8.Model.Setting; + using System.Windows.Media; + using System.Windows.Navigation; + using CampusAppWP8.Model.Utility; + using CampusAppWP8.Resources; + using CampusAppWP8.Utility; 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; + #region member + + /// List of colors of the application accents. + private readonly AppAccentColorListPickerItemListModel appAccentColors = new AppAccentColorListPickerItemListModel(); + #endregion + #region Constructor /// Initializes a new instance of the class. @@ -29,18 +36,42 @@ 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.AccentColorPicker.ItemsSource = this.appAccentColors.List; + 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 +79,63 @@ 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; + this.AccentColorPicker.SelectedIndex = this.appAccentColors.GetIndexOrDefault(new SolidColorBrush(Settings.AppSetting.DisplaySetting.AppAccentColor)); + } + + /// 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(); + } + + /// Event handler. Called by AccentColorPicker for selection changed events. + /// Stubbfel, 26.11.2013. + /// Source of the event. + /// Selection changed event information. + private void AccentColorPicker_SelectionChanged(object sender, System.Windows.Controls.SelectionChangedEventArgs e) + { + if (e.AddedItems.Count == 1 && e.RemovedItems.Count == 1) + { + int selectedIndex = this.AccentColorPicker.SelectedIndex; + Color newColor = this.appAccentColors.List[selectedIndex].Value.Color; + Utilities.SwitchAccentColor(newColor); + Settings.AppSetting.DisplaySetting.AppAccentColor = newColor; + } + } + + #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/Impressum.xaml b/CampusAppWP8/CampusAppWP8/Pages/Setting/Impressum.xaml index cba5a15d..7f59967c 100644 --- a/CampusAppWP8/CampusAppWP8/Pages/Setting/Impressum.xaml +++ b/CampusAppWP8/CampusAppWP8/Pages/Setting/Impressum.xaml @@ -29,33 +29,79 @@ - - Name: BTU Campus-App - Version: 1.0 - Kontakt: - - - - - - - - - - - Email: - + + + Name + BTU CampusApp + Version + 1.1 + Kontakt: + + + + + + + + + + + Email: + - Website: - + Website: + - Facebook: - + Facebook: + - - + + Versionshinweise + Version 1.1: + + - neue Funktionen: + - Stundenplan + - Wahl der Akzentfarbe + - Änderungen + - Überarbeitetes Layout der Startseite + - Überarbeitetes Einstellungsmenu + - Überarbeitet Raumübersicht + + Version 1.0.0.1: + + - Bugfixes: + - Beseitigung eines Fehler beim starten der App + + Version 1.0: + + Initaler Release + Funktionsübersicht: + - Vorlesungsverzeichnis (Vorlesungen, Übungen, Prüfungen etc.) + - Mensaplan + - Lehrstuhlübersicht + - Fachschaftenübersicht + - Prüfungsordnung + - Personsuche (Mitarbeiter) + - BTU Webmail + - Öffnungszeiten + - Verzeichnis mit nützlichen Links + - News und Events rund um den Campus + - mit Text-to-Speech−Funktion + - Campusplan : + - Gebäudesuchfunktion + - Lokalisierung mittles GPS oder BTU-Tag (QR-Codes, NFC-Tags) + - Ebenenpläne für das IKMZ und MZG + + + © 2013 Brandenburgische Technische Universität Cottbus - Senftenberg + Die "BTU CampusApp" wird vom Multimediazentrum (MMZ) der BTU entwickelt und vertrieben. + Alle Rechte am Inhalt dieses Informationsangebotes liegen bei der Brandenburgischen Technischen Universität Cottbus - Senftenberg. Die Verwendung der hier veröffentlichten Informationen für BTU-externe Zwecke bedürfen einer Genehmigung. + + + + 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..5e002178 100644 --- a/CampusAppWP8/CampusAppWP8/Pages/StartPage.xaml +++ b/CampusAppWP8/CampusAppWP8/Pages/StartPage.xaml @@ -1,4 +1,4 @@ - @@ -27,9 +26,8 @@ - - - + + @@ -121,14 +119,12 @@ - - - + @@ -237,7 +233,7 @@ - + @@ -273,7 +269,6 @@ - - - + - + + - - - - \ No newline at end of file + \ No newline at end of file diff --git a/CampusAppWP8/CampusAppWP8/Pages/StartPage.xaml.cs b/CampusAppWP8/CampusAppWP8/Pages/StartPage.xaml.cs index 2b55eb1e..4a6a5eed 100644 --- a/CampusAppWP8/CampusAppWP8/Pages/StartPage.xaml.cs +++ b/CampusAppWP8/CampusAppWP8/Pages/StartPage.xaml.cs @@ -12,26 +12,23 @@ namespace CampusAppWP8.Pages using System.Runtime.InteropServices.WindowsRuntime; using System.Threading; using System.Windows; - using System.Windows.Controls; using System.Windows.Navigation; using CampusAppWP8.Feed.Utility; using CampusAppWP8.File.Places; using CampusAppWP8.Model.Setting; - using CampusAppWP8.Pages.TimeTable; using CampusAppWP8.Resources; using CampusAppWP8.Utility; using CampusAppWP8.Utility.Lui.MessageBoxes; using CampusAppWP8.Utility.Lui.Page; using CampusAppWP8.Utility.Lui.Tiles; using CampusAppWP8.Utility.NDEF; - using Microsoft.Phone.Controls; - using Microsoft.Phone.Shell; using Windows.Networking.Proximity; + using Microsoft.Phone.Controls; /// Class for the StartPage. /// Stubbfel, 15.10.2013. /// - public partial class StartPage : PortraitLandscapePage + public partial class StartPage : PhoneApplicationPage { #region Member @@ -56,22 +53,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; - } } } @@ -81,7 +72,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) @@ -90,7 +81,7 @@ namespace CampusAppWP8.Pages if (device != null) { this.ndefId = this.device.SubscribeForMessage(Constants.NCFMessageType_NDEF, this.NDEFHandler); - } + } } /// Methods overrides the OnNavigatedFrom-Method. @@ -129,7 +120,7 @@ namespace CampusAppWP8.Pages /// Stubbfel, 15.10.2013. /// Caller of the function. /// some EventArgs. - private void NFCButton_Click(object sender,RoutedEventArgs e) + private void NFCButton_Click(object sender, RoutedEventArgs e) { MessageBoxes.ShowMainModelInfoMessageBox(AppResources.ScarNfc_Search); } @@ -149,13 +140,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 +266,7 @@ namespace CampusAppWP8.Pages } else { - switch (Settings.AppSetting.TagDefaultHandler) + switch (Settings.AppSetting.FunctionSettings.TagSetting.TagDefaultHandler) { case BTUTagDefaultHandler.CampusMap: this.GoToCampusMappage(nfcContent); @@ -351,8 +342,29 @@ namespace CampusAppWP8.Pages } } - #endregion + /// Event handler. Called by TimeTable for click events. + /// Fiedler, 26.11.2013. + /// Caller of the function. + /// Routed event information. + private void TimeTable_Click(object sender, RoutedEventArgs e) + { + if (this.Orientation.Equals(PageOrientation.Landscape) + || this.Orientation.Equals(PageOrientation.LandscapeLeft) + || this.Orientation.Equals(PageOrientation.LandscapeRight)) + { + this.TimeTableAppButton.Url = Constants.PathTimeTable_Week; + } + else + if (this.Orientation.Equals(PageOrientation.Portrait) + || this.Orientation.Equals(PageOrientation.PortraitDown) + || this.Orientation.Equals(PageOrientation.PortraitUp)) + { + this.TimeTableAppButton.Url = Constants.PathTimeTable_Day; + } + } #endregion + + #endregion } } \ No newline at end of file diff --git a/CampusAppWP8/CampusAppWP8/Pages/TimeTable/AppointmentEdit.xaml b/CampusAppWP8/CampusAppWP8/Pages/TimeTable/AppointmentEdit.xaml index 7bc208a8..de35d210 100644 --- a/CampusAppWP8/CampusAppWP8/Pages/TimeTable/AppointmentEdit.xaml +++ b/CampusAppWP8/CampusAppWP8/Pages/TimeTable/AppointmentEdit.xaml @@ -86,7 +86,15 @@ - + + + + + + + + + diff --git a/CampusAppWP8/CampusAppWP8/Pages/TimeTable/TimeTableDay.xaml b/CampusAppWP8/CampusAppWP8/Pages/TimeTable/TimeTableDay.xaml index 4b8a3da3..827aa3c0 100644 --- a/CampusAppWP8/CampusAppWP8/Pages/TimeTable/TimeTableDay.xaml +++ b/CampusAppWP8/CampusAppWP8/Pages/TimeTable/TimeTableDay.xaml @@ -11,15 +11,18 @@ FontFamily="{StaticResource PhoneFontFamilyNormal}" FontSize="{StaticResource PhoneFontSizeNormal}" Foreground="{StaticResource PhoneForegroundBrush}" - SupportedOrientations="Portrait" Orientation="Portrait" - shell:SystemTray.IsVisible="True"> + SupportedOrientations="PortraitOrLandscape" Orientation="Portrait" + shell:SystemTray.IsVisible="True" + OrientationChanged="PhoneApplicationPage_OrientationChanged"> - + + + diff --git a/CampusAppWP8/CampusAppWP8/Pages/TimeTable/TimeTableDay.xaml.cs b/CampusAppWP8/CampusAppWP8/Pages/TimeTable/TimeTableDay.xaml.cs index b7efc4e2..a64539ed 100644 --- a/CampusAppWP8/CampusAppWP8/Pages/TimeTable/TimeTableDay.xaml.cs +++ b/CampusAppWP8/CampusAppWP8/Pages/TimeTable/TimeTableDay.xaml.cs @@ -22,15 +22,24 @@ namespace CampusAppWP8.Pages.TimeTable using CampusAppWP8.Model.TimeTable; using CampusAppWP8.Resources; + /// A time table day. + /// Fiedler, 25.11.2013. + /// public partial class TimeTableDay : PhoneApplicationPage { + /// The pivot item pages. private static readonly int PIVOT_ITEM_PAGES = 5; + /// The pivot item pages half down. private static readonly int PIVOT_ITEM_PAGES_HALF_DOWN = 2; + /// List of items. private ObservableCollection itemList = new ObservableCollection(); + /// Zero-based index of the last selected. private int lastSelectedIndex = 0; - + + /// Initializes a new instance of the TimeTableDay class. + /// Fiedler, 25.11.2013. public TimeTableDay() { this.InitializeComponent(); @@ -73,6 +82,9 @@ namespace CampusAppWP8.Pages.TimeTable ApplicationBar.Buttons.Add(addBtn); } + /// Wird aufgerufen, wenn eine Seite die aktive Seite in einem Frame wird. + /// Fiedler, 25.11.2013. + /// protected override void OnNavigatedTo(NavigationEventArgs e) { base.OnNavigatedTo(e); @@ -83,6 +95,22 @@ namespace CampusAppWP8.Pages.TimeTable } else { + string dayStr = string.Empty; + + if (NavigationContext.QueryString.TryGetValue(Constants.ParamDay, out dayStr)) + { + long dayTicks = long.Parse(dayStr); + DateTime dayDT = new DateTime(dayTicks); + + dayDT.AddDays(PIVOT_ITEM_PAGES_HALF_DOWN * -1); + + for (int i = 0; i < PIVOT_ITEM_PAGES; i++) + { + this.itemList[i].Day = dayDT; + dayDT = dayDT.AddDays(1); + } + } + this.ThePivot.ItemsSource = this.itemList; this.lastSelectedIndex = PIVOT_ITEM_PAGES_HALF_DOWN; this.ThePivot.SelectedIndex = PIVOT_ITEM_PAGES_HALF_DOWN; @@ -91,6 +119,29 @@ namespace CampusAppWP8.Pages.TimeTable } } + /// + /// Wird aufgerufen, wenn eine Seite nicht mehr die aktive Seite in einem Frame ist. + /// + /// Fiedler, 25.11.2013. + /// + protected override void OnNavigatedFrom(NavigationEventArgs e) + { + base.OnNavigatedFrom(e); + + List backStack = new List(NavigationService.BackStack); + + if (backStack.Count > 0 + && backStack[0].Source.OriginalString.Contains(Constants.PathTimeTable_Day) + && e.Uri.OriginalString.Contains(Constants.PathTimeTable_Week)) + { + NavigationService.RemoveBackEntry(); + } + } + + /// Event pivot selection changed. + /// Fiedler, 25.11.2013. + /// Source of the event. + /// Selection changed event information. private void EventPivotSelectionChanged(object sender, SelectionChangedEventArgs e) { int indexToChange = 0; @@ -122,6 +173,9 @@ namespace CampusAppWP8.Pages.TimeTable this.lastSelectedIndex = this.ThePivot.SelectedIndex; } + /// Executes the appointment click action. + /// Fiedler, 25.11.2013. + /// The model. private void OnAppointmentClick(AppointmentModel model) { int index = TimeTable.Feed.Model.Appointments.IndexOf(model); @@ -138,6 +192,10 @@ namespace CampusAppWP8.Pages.TimeTable } } + /// Raises the click week event. + /// Fiedler, 25.11.2013. + /// Source of the event. + /// Event information to send to registered event handlers. private void OnClickWeek(object sender, EventArgs e) { Uri url = new Uri(Constants.PathTimeTable_Week, UriKind.Relative); @@ -145,6 +203,10 @@ namespace CampusAppWP8.Pages.TimeTable page.NavigationService.Navigate(url); } + /// Raises the click to day event. + /// Fiedler, 25.11.2013. + /// Source of the event. + /// Event information to send to registered event handlers. private void OnClickToDay(object sender, EventArgs e) { int index = -1; @@ -179,6 +241,10 @@ namespace CampusAppWP8.Pages.TimeTable } } + /// Raises the click properties event. + /// Fiedler, 25.11.2013. + /// Source of the event. + /// Event information to send to registered event handlers. private void OnClickProperties(object sender, EventArgs e) { Uri url = new Uri(Constants.PathTimeTable_Properties, UriKind.Relative); @@ -186,6 +252,10 @@ namespace CampusAppWP8.Pages.TimeTable page.NavigationService.Navigate(url); } + /// Raises the click add event. + /// Fiedler, 25.11.2013. + /// Source of the event. + /// Event information to send to registered event handlers. private void OnClickAdd(object sender, EventArgs e) { TimeTable.Feed.Model.Appointments.CollectionChanged += this.OnListChanged; @@ -195,6 +265,10 @@ namespace CampusAppWP8.Pages.TimeTable page.NavigationService.Navigate(url); } + /// Raises the notify collection changed event. + /// Fiedler, 25.11.2013. + /// Source of the event. + /// Event information to send to registered event handlers. private void OnListChanged(object sender, NotifyCollectionChangedEventArgs e) { if (e.Action == NotifyCollectionChangedAction.Add) @@ -236,6 +310,9 @@ namespace CampusAppWP8.Pages.TimeTable } } + /// Check appointments. + /// Fiedler, 25.11.2013. + /// (Optional) zero-based index of the. private void CheckAppointments(int index = -1) { if (index < 0) @@ -268,5 +345,15 @@ namespace CampusAppWP8.Pages.TimeTable } } } + + private void PhoneApplicationPage_OrientationChanged(object sender, OrientationChangedEventArgs e) + { + if(e.Orientation.Equals(PageOrientation.Landscape) + || e.Orientation.Equals(PageOrientation.LandscapeLeft) + || e.Orientation.Equals(PageOrientation.LandscapeRight)) + { + NavigationService.Navigate(new Uri(Constants.PathTimeTable_Week, UriKind.Relative)); + } + } } } \ No newline at end of file diff --git a/CampusAppWP8/CampusAppWP8/Pages/TimeTable/TimeTableWeek.xaml b/CampusAppWP8/CampusAppWP8/Pages/TimeTable/TimeTableWeek.xaml index 9a39756a..07e8188d 100644 --- a/CampusAppWP8/CampusAppWP8/Pages/TimeTable/TimeTableWeek.xaml +++ b/CampusAppWP8/CampusAppWP8/Pages/TimeTable/TimeTableWeek.xaml @@ -11,10 +11,10 @@ FontFamily="{StaticResource PhoneFontFamilyNormal}" FontSize="{StaticResource PhoneFontSizeNormal}" Foreground="{StaticResource PhoneForegroundBrush}" - SupportedOrientations="Landscape" Orientation="Landscape" + SupportedOrientations="PortraitOrLandscape" Orientation="Landscape" mc:Ignorable="d" shell:SystemTray.IsVisible="True" - > + OrientationChanged="PhoneApplicationPage_OrientationChanged"> @@ -34,7 +34,8 @@ Appointments="{Binding Path=AppointmentList, Mode=OneWay}" WeekNumber="{Binding Path=WeekNr, Mode=OneWay}" Days="5" - ToDayColoring="True"/> + ToDayColoring="True" + SelectedDay="{Binding Path=SelectedDay, Mode=TwoWay}"/> diff --git a/CampusAppWP8/CampusAppWP8/Pages/TimeTable/TimeTableWeek.xaml.cs b/CampusAppWP8/CampusAppWP8/Pages/TimeTable/TimeTableWeek.xaml.cs index f259361d..2fa82c7d 100644 --- a/CampusAppWP8/CampusAppWP8/Pages/TimeTable/TimeTableWeek.xaml.cs +++ b/CampusAppWP8/CampusAppWP8/Pages/TimeTable/TimeTableWeek.xaml.cs @@ -8,6 +8,8 @@ namespace CampusAppWP8.Pages.TimeTable { using System; + using System.Collections; + using System.Collections.Generic; using System.Collections.Specialized; using System.Collections.ObjectModel; using System.Windows; @@ -20,15 +22,24 @@ namespace CampusAppWP8.Pages.TimeTable using CampusAppWP8.Model.TimeTable; using CampusAppWP8.Resources; + /// A time table week. + /// Fiedler, 22.11.2013. + /// public partial class TimeTableWeek : PhoneApplicationPage { + /// The pivot pages. private static readonly int PIVOT_PAGES = 3; + /// The pivot pages half down. private static readonly int PIVOT_PAGES_HALF_DOWN = 1; + /// Zero-based index of the last selected. private int lastSelectedIndex = 0; + /// List of items. private ObservableCollection itemList = new ObservableCollection(); + /// Initializes a new instance of the TimeTableWeek class. + /// Fiedler, 22.11.2013. public TimeTableWeek() { this.InitializeComponent(); @@ -74,6 +85,9 @@ namespace CampusAppWP8.Pages.TimeTable ApplicationBar.Buttons.Add(addBtn); } + /// Wird aufgerufen, wenn eine Seite die aktive Seite in einem Frame wird. + /// Fiedler, 22.11.2013. + /// protected override void OnNavigatedTo(NavigationEventArgs e) { base.OnNavigatedTo(e); @@ -92,13 +106,31 @@ namespace CampusAppWP8.Pages.TimeTable } } + /// + /// Wird aufgerufen, wenn eine Seite nicht mehr die aktive Seite in einem Frame ist. + /// + /// Fiedler, 22.11.2013. + /// protected override void OnNavigatedFrom(NavigationEventArgs e) { base.OnNavigatedFrom(e); + List backStack = new List(NavigationService.BackStack); + + if (backStack.Count > 0 + && backStack[0].Source.OriginalString.Contains(Constants.PathTimeTable_Week) + && e.Uri.OriginalString.Contains(Constants.PathTimeTable_Day)) + { + NavigationService.RemoveBackEntry(); + } + TimeTable.Feed.SaveData(); } + /// Gets the first day of week. + /// Fiedler, 22.11.2013. + /// The day in week Date/Time. + /// The first day of week. private DateTime GetFirstDayOfWeek(DateTime dayInWeek) { DateTime retValue = dayInWeek.Date; @@ -111,6 +143,10 @@ namespace CampusAppWP8.Pages.TimeTable return retValue; } + /// Gets week number. + /// Fiedler, 22.11.2013. + /// The date Date/Time. + /// The week number. private int GetWeekNumber(DateTime date) { int retValue = 0; @@ -121,6 +157,10 @@ namespace CampusAppWP8.Pages.TimeTable return retValue; } + /// Gets day of week index. + /// Fiedler, 22.11.2013. + /// The day in week Date/Time. + /// The day of week index. private int GetDayOfWeekIndex(DateTime dayInWeek) { int retValue = -1; @@ -139,6 +179,10 @@ namespace CampusAppWP8.Pages.TimeTable return retValue; } + /// Raises the click day view event. + /// Fiedler, 22.11.2013. + /// Source of the event. + /// Event information to send to registered event handlers. private void OnClickDayView(object sender, EventArgs e) { Uri url = new Uri(Constants.PathTimeTable_Day, UriKind.Relative); @@ -146,6 +190,10 @@ namespace CampusAppWP8.Pages.TimeTable page.NavigationService.Navigate(url); } + /// Raises the click today event. + /// Fiedler, 22.11.2013. + /// Source of the event. + /// Event information to send to registered event handlers. private void OnClickToday(object sender, EventArgs e) { DateTime firstDay = this.GetFirstDayOfWeek(DateTime.Now); @@ -183,6 +231,10 @@ namespace CampusAppWP8.Pages.TimeTable } } + /// Raises the click properties event. + /// Fiedler, 22.11.2013. + /// Source of the event. + /// Event information to send to registered event handlers. private void OnClickProperties(object sender, EventArgs e) { Uri url = new Uri(Constants.PathTimeTable_Properties, UriKind.Relative); @@ -190,6 +242,10 @@ namespace CampusAppWP8.Pages.TimeTable page.NavigationService.Navigate(url); } + /// Raises the click create event. + /// Fiedler, 22.11.2013. + /// Source of the event. + /// Event information to send to registered event handlers. private void OnClickCreate(object sender, EventArgs e) { TimeTable.Feed.Model.Appointments.CollectionChanged += new NotifyCollectionChangedEventHandler(this.OnListChanged); @@ -199,6 +255,10 @@ namespace CampusAppWP8.Pages.TimeTable page.NavigationService.Navigate(url); } + /// Raises the selection changed event. + /// Fiedler, 22.11.2013. + /// Source of the event. + /// Event information to send to registered event handlers. private void OnPivotSelectionChanged(object sender, SelectionChangedEventArgs e) { int delta = this.ThePivot.SelectedIndex - this.lastSelectedIndex; @@ -225,6 +285,9 @@ namespace CampusAppWP8.Pages.TimeTable this.lastSelectedIndex = this.ThePivot.SelectedIndex; } + /// Executes the appointment click action. + /// Fiedler, 22.11.2013. + /// The model. private void OnAppointmentClick(AppointmentModel model) { int index = TimeTable.Feed.Model.Appointments.IndexOf(model); @@ -241,6 +304,10 @@ namespace CampusAppWP8.Pages.TimeTable } } + /// Raises the notify collection changed event. + /// Fiedler, 22.11.2013. + /// Source of the event. + /// Event information to send to registered event handlers. private void OnListChanged(object sender, NotifyCollectionChangedEventArgs e) { AppointmentModel tempModel = null; @@ -273,6 +340,12 @@ namespace CampusAppWP8.Pages.TimeTable } } + /// Check appointments. + /// Fiedler, 22.11.2013. + /// + /// Thrown when a value was unexpectedly null. + /// + /// (Optional) zero-based index of the page. private void CheckAppointments(int pageIndex = -1) { if (TimeTable.Feed == null) @@ -318,5 +391,23 @@ namespace CampusAppWP8.Pages.TimeTable } } } + + private void PhoneApplicationPage_OrientationChanged(object sender, OrientationChangedEventArgs e) + { + if (e.Orientation.Equals(PageOrientation.Portrait) + || e.Orientation.Equals(PageOrientation.PortraitDown) + || e.Orientation.Equals(PageOrientation.PortraitUp)) + { + string url = Constants.PathTimeTable_Day; + + if ((this.ThePivot.SelectedItem as WeekViewPageItem).SelectedDay.Date.Equals(DateTime.MinValue.Date) == false) + { + url += "?" + Constants.ParamDay + "=" + (this.ThePivot.SelectedItem as WeekViewPageItem).SelectedDay.Ticks.ToString(); + } + + Uri newUri = new Uri(url , UriKind.Relative); + NavigationService.Navigate(newUri); + } + } } } \ No newline at end of file diff --git a/CampusAppWP8/CampusAppWP8/Pages/TimeTable/WeekViewPageItem.cs b/CampusAppWP8/CampusAppWP8/Pages/TimeTable/WeekViewPageItem.cs index a5564e04..727bdced 100644 --- a/CampusAppWP8/CampusAppWP8/Pages/TimeTable/WeekViewPageItem.cs +++ b/CampusAppWP8/CampusAppWP8/Pages/TimeTable/WeekViewPageItem.cs @@ -34,6 +34,9 @@ namespace CampusAppWP8.Pages.TimeTable /// List of appointments. private ObservableCollection appointmentList = null; + /// The selected day. + private DateTime selectedDay = DateTime.MinValue; + /// Tritt ein, wenn sich ein Eigenschaftswert ändert. public event PropertyChangedEventHandler PropertyChanged; @@ -149,6 +152,21 @@ namespace CampusAppWP8.Pages.TimeTable } } + /// Gets or sets the selected day. + /// The selected day. + public DateTime SelectedDay + { + get + { + return this.selectedDay; + } + + set + { + this.selectedDay = value; + } + } + /// Notifies a property changed. /// Fiedler, 06.11.2013. /// The information. 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 24cf4571..55e6f33d 100644 --- a/CampusAppWP8/CampusAppWP8/Resources/AppResources.Designer.cs +++ b/CampusAppWP8/CampusAppWP8/Resources/AppResources.Designer.cs @@ -60,6 +60,24 @@ namespace CampusAppWP8.Resources { } } + /// + /// Sucht eine lokalisierte Zeichenfolge, die Akzentfarbe ähnelt. + /// + public static string AccentColor { + get { + return ResourceManager.GetString("AccentColor", resourceCulture); + } + } + + /// + /// Sucht eine lokalisierte Zeichenfolge, die Akzentfarbe-Auswahl ähnelt. + /// + public static string AccentColorPicker { + get { + return ResourceManager.GetString("AccentColorPicker", resourceCulture); + } + } + /// /// Sucht eine lokalisierte Zeichenfolge, die Hinzufügen ähnelt. /// @@ -1131,6 +1149,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. /// @@ -1158,6 +1185,15 @@ namespace CampusAppWP8.Resources { } } + /// + /// Sucht eine lokalisierte Zeichenfolge, die Räume ähnelt. + /// + public static string Rooms { + get { + return ResourceManager.GetString("Rooms", resourceCulture); + } + } + /// /// Sucht eine lokalisierte Zeichenfolge, die Beispielwert für die Laufzeiteigenschaft ähnelt. /// @@ -1203,15 +1239,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. /// @@ -1222,7 +1249,61 @@ namespace CampusAppWP8.Resources { } /// - /// Sucht eine lokalisierte Zeichenfolge, die Über BTU Campus-App ähnelt. + /// 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 CampusApp ähnelt. /// public static string Setting_ImpressumTitle { get { @@ -1230,6 +1311,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. /// @@ -1303,11 +1411,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); } } @@ -1329,6 +1437,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. /// @@ -1571,5 +1688,23 @@ namespace CampusAppWP8.Resources { return ResourceManager.GetString("When", resourceCulture); } } + + /// + /// Sucht eine lokalisierte Zeichenfolge, die Zoom + ähnelt. + /// + public static string ZoomIn { + get { + return ResourceManager.GetString("ZoomIn", resourceCulture); + } + } + + /// + /// Sucht eine lokalisierte Zeichenfolge, die Zoom - ähnelt. + /// + public static string ZoomOut { + get { + return ResourceManager.GetString("ZoomOut", resourceCulture); + } + } } } diff --git a/CampusAppWP8/CampusAppWP8/Resources/AppResources.resx b/CampusAppWP8/CampusAppWP8/Resources/AppResources.resx index ca8f1dbc..f3d9f5fd 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. @@ -570,7 +570,7 @@ BTU-Tag-Standardfunktion - Über BTU Campus-App + Über BTU CampusApp Der eingescannte Tag ist kein BTU-Tag @@ -617,10 +617,55 @@ Wochenplan + + Zoom + + + + Zoom - + Termin erstellen Veranstaltungstermine + + Räume + + + autom. Mensa-Auswahl + + + Funktionseinstellungen + + + Ort. & Netz + + + Sonstige Einstellungen + + + BTU-Tag + + + zurück-setzen + + + Einstellung zurücksetzen + + + Darstellung + + + Funktionen + + + Mensa + + + Akzentfarbe + + + Akzentfarbe-Auswahl + \ No newline at end of file diff --git a/CampusAppWP8/CampusAppWP8/Resources/Constants.resx b/CampusAppWP8/CampusAppWP8/Resources/Constants.resx index 34d6095c..e341fd5a 100644 --- a/CampusAppWP8/CampusAppWP8/Resources/Constants.resx +++ b/CampusAppWP8/CampusAppWP8/Resources/Constants.resx @@ -274,7 +274,7 @@ 767 - 20131 + 20132 20121 @@ -609,6 +609,9 @@ http://www.tu-cottbus.de/campusapp-data/canteens.php?v=1 + + Zugangsbereich + isolated @@ -621,4 +624,103 @@ /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 + + + paramday + + + AppAccentColor + + + PhoneAccentColor + + + FacultyBrush1 + + + FacultyBrush2 + + + FacultyBrush3 + + + FacultyBrush4 + + + FacultyBrush5 + + + PhoneAccentBrush + + + FacultyColor1 + + + FacultyColor2 + + + FacultyColor3 + + + FacultyColor4 + + + FacultyColor5 + + + PhoneAccentColor + \ No newline at end of file diff --git a/CampusAppWP8/CampusAppWP8/Resources/Constants1.Designer.cs b/CampusAppWP8/CampusAppWP8/Resources/Constants1.Designer.cs index 58946cba..be3cb10f 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. /// @@ -195,6 +204,60 @@ namespace CampusAppWP8.Resources { } } + /// + /// Sucht eine lokalisierte Zeichenfolge, die FacultyBrush1 ähnelt. + /// + public static string Brush_Faculty1 { + get { + return ResourceManager.GetString("Brush_Faculty1", resourceCulture); + } + } + + /// + /// Sucht eine lokalisierte Zeichenfolge, die FacultyBrush2 ähnelt. + /// + public static string Brush_Faculty2 { + get { + return ResourceManager.GetString("Brush_Faculty2", resourceCulture); + } + } + + /// + /// Sucht eine lokalisierte Zeichenfolge, die FacultyBrush3 ähnelt. + /// + public static string Brush_Faculty3 { + get { + return ResourceManager.GetString("Brush_Faculty3", resourceCulture); + } + } + + /// + /// Sucht eine lokalisierte Zeichenfolge, die FacultyBrush4 ähnelt. + /// + public static string Brush_Faculty4 { + get { + return ResourceManager.GetString("Brush_Faculty4", resourceCulture); + } + } + + /// + /// Sucht eine lokalisierte Zeichenfolge, die FacultyBrush5 ähnelt. + /// + public static string Brush_Faculty5 { + get { + return ResourceManager.GetString("Brush_Faculty5", resourceCulture); + } + } + + /// + /// Sucht eine lokalisierte Zeichenfolge, die PhoneAccentBrush ähnelt. + /// + public static string Brush_PhoneAccent { + get { + return ResourceManager.GetString("Brush_PhoneAccent", resourceCulture); + } + } + /// /// Sucht eine lokalisierte Zeichenfolge, die BTU-CampusApp ähnelt. /// @@ -213,6 +276,60 @@ namespace CampusAppWP8.Resources { } } + /// + /// Sucht eine lokalisierte Zeichenfolge, die FacultyColor1 ähnelt. + /// + public static string Color_Faculty1 { + get { + return ResourceManager.GetString("Color_Faculty1", resourceCulture); + } + } + + /// + /// Sucht eine lokalisierte Zeichenfolge, die FacultyColor2 ähnelt. + /// + public static string Color_Faculty2 { + get { + return ResourceManager.GetString("Color_Faculty2", resourceCulture); + } + } + + /// + /// Sucht eine lokalisierte Zeichenfolge, die FacultyColor3 ähnelt. + /// + public static string Color_Faculty3 { + get { + return ResourceManager.GetString("Color_Faculty3", resourceCulture); + } + } + + /// + /// Sucht eine lokalisierte Zeichenfolge, die FacultyColor4 ähnelt. + /// + public static string Color_Faculty4 { + get { + return ResourceManager.GetString("Color_Faculty4", resourceCulture); + } + } + + /// + /// Sucht eine lokalisierte Zeichenfolge, die FacultyColor5 ähnelt. + /// + public static string Color_Faculty5 { + get { + return ResourceManager.GetString("Color_Faculty5", resourceCulture); + } + } + + /// + /// Sucht eine lokalisierte Zeichenfolge, die PhoneAccentColor ähnelt. + /// + public static string Color_PhoneAccent { + get { + return ResourceManager.GetString("Color_PhoneAccent", resourceCulture); + } + } + /// /// Sucht eine lokalisierte Zeichenfolge, die 8 ähnelt. /// @@ -438,6 +555,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 +636,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 +807,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. /// @@ -654,6 +825,15 @@ namespace CampusAppWP8.Resources { } } + /// + /// Sucht eine lokalisierte Zeichenfolge, die paramday ähnelt. + /// + public static string ParamDay { + get { + return ResourceManager.GetString("ParamDay", resourceCulture); + } + } + /// /// Sucht eine lokalisierte Zeichenfolge, die Studiengang ähnelt. /// @@ -1050,6 +1230,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. /// @@ -1275,6 +1464,15 @@ namespace CampusAppWP8.Resources { } } + /// + /// Sucht eine lokalisierte Zeichenfolge, die Zugangsbereich ähnelt. + /// + public static string PisInformationValue_Entrance { + get { + return ResourceManager.GetString("PisInformationValue_Entrance", resourceCulture); + } + } + /// /// Sucht eine lokalisierte Zeichenfolge, die pid ähnelt. /// @@ -1302,6 +1500,78 @@ namespace CampusAppWP8.Resources { } } + /// + /// Sucht eine lokalisierte Zeichenfolge, die AppAccentColor ähnelt. + /// + public static string Setting_AppAccentColor { + get { + return ResourceManager.GetString("Setting_AppAccentColor", resourceCulture); + } + } + + /// + /// 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. /// @@ -1312,7 +1582,7 @@ namespace CampusAppWP8.Resources { } /// - /// Sucht eine lokalisierte Zeichenfolge, die 20131 ähnelt. + /// Sucht eine lokalisierte Zeichenfolge, die 20132 ähnelt. /// public static string Setting_DefaultSemester { get { @@ -1320,6 +1590,42 @@ 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 PhoneAccentColor ähnelt. + /// + public static string Setting_PhoneAccentColor { + get { + return ResourceManager.GetString("Setting_PhoneAccentColor", 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/Resources/Icons.cs b/CampusAppWP8/CampusAppWP8/Resources/Icons.cs index d59a36d1..1bac578e 100644 --- a/CampusAppWP8/CampusAppWP8/Resources/Icons.cs +++ b/CampusAppWP8/CampusAppWP8/Resources/Icons.cs @@ -66,6 +66,17 @@ namespace CampusAppWP8.Resources } } + /// + /// Gets the uri string of the Cancel icon. + /// + public static string Cancel + { + get + { + return Themerize("cancel_159.png"); + } + } + /// /// Gets the uri string of the Cow icon. /// @@ -121,6 +132,17 @@ namespace CampusAppWP8.Resources } } + /// + /// Gets the uri string of the Edit icon. + /// + public static string Edit + { + get + { + return Themerize("edit_159.png"); + } + } + /// /// Gets the uri string of the Events icon. /// @@ -407,6 +429,17 @@ namespace CampusAppWP8.Resources } } + /// + /// Gets the uri string of the Reset icon. + /// + public static string Reset + { + get + { + return Themerize("reset_159.png"); + } + } + /// /// Gets the uri string of the Schedule icon. /// @@ -451,6 +484,39 @@ namespace CampusAppWP8.Resources } } + /// + /// Gets the uri string of the Setting icon. + /// + public static string Setting + { + get + { + return Themerize("prefs2_159.png"); + } + } + + /// + /// Gets the uri string of the ShowDay icon. + /// + public static string ShowDay + { + get + { + return Themerize("showDay_159.png"); + } + } + + /// + /// Gets the uri string of the ShowWeek icon. + /// + public static string ShowWeek + { + get + { + return Themerize("showWeek_159.png"); + } + } + /// /// Gets the uri string of the StudentCouncil icon. /// @@ -517,6 +583,28 @@ namespace CampusAppWP8.Resources } } + /// + /// Gets the uri string of the ZoomIn icon. + /// + public static string ZoomIn + { + get + { + return Themerize("zoomin_159.png"); + } + } + + /// + /// Gets the uri string of the ZoomOut icon. + /// + public static string ZoomOut + { + get + { + return Themerize("zoomout_159.png"); + } + } + /// /// Return the theme depending string of a icon. /// diff --git a/CampusAppWP8/CampusAppWP8/Resources/Icons.resx b/CampusAppWP8/CampusAppWP8/Resources/Icons.resx index 37370a4d..f1686b87 100644 --- a/CampusAppWP8/CampusAppWP8/Resources/Icons.resx +++ b/CampusAppWP8/CampusAppWP8/Resources/Icons.resx @@ -129,6 +129,9 @@ campus_159.png + + cancel_159.png + steak_159.png @@ -144,6 +147,9 @@ lehrstuehle_159.png + + edit_159.png + events_159.png @@ -222,6 +228,9 @@ practise_159.png + + reset_159.png + schedule_159.png @@ -234,6 +243,15 @@ seminar_159.png + + prefs2_159.png + + + showDay_159.png + + + showWeek_159.png + student_council_159.png @@ -252,4 +270,10 @@ wild dish_159.png + + zoomin_159.png + + + zoomout_159.png + \ No newline at end of file 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/Styles/StartPageStyles.xaml b/CampusAppWP8/CampusAppWP8/Styles/StartPageStyles.xaml index c6db84ac..73e98eca 100644 --- a/CampusAppWP8/CampusAppWP8/Styles/StartPageStyles.xaml +++ b/CampusAppWP8/CampusAppWP8/Styles/StartPageStyles.xaml @@ -22,8 +22,8 @@ - - + +