Merge branch 'feature/#282' into develop
This commit is contained in:
@@ -12,6 +12,7 @@
|
||||
<ResourceDictionary.MergedDictionaries>
|
||||
<ResourceDictionary Source="Styles/ListButton.xaml"/>
|
||||
<ResourceDictionary Source="Styles/StartPageStyles.xaml"/>
|
||||
<ResourceDictionary Source="Styles/Labels.xaml"/>
|
||||
<ResourceDictionary>
|
||||
<local:LocalizedStrings xmlns:local="clr-namespace:CampusAppWP8" x:Key="LocalizedStrings"/>
|
||||
<local:ThemelizedIcons xmlns:local="clr-namespace:CampusAppWP8" x:Key="ThemelizedIcons"/>
|
||||
|
||||
@@ -159,17 +159,17 @@ namespace CampusAppWP8
|
||||
|
||||
this.UserSettingsLoaded();
|
||||
|
||||
Settings.AppSetting.UniNetwork = Utilities.IsUniNetworkAvailable();
|
||||
if (!Settings.AppSetting.UniNetwork)
|
||||
Settings.AppSetting.NetworkSetting.UniNetwork = Utilities.IsUniNetworkAvailable();
|
||||
if (!Settings.AppSetting.NetworkSetting.UniNetwork)
|
||||
{
|
||||
Settings.AppSetting.WifiEnable = Utilities.IsWifiAvailable();
|
||||
Settings.AppSetting.NetworkSetting.WifiEnable = Utilities.IsWifiAvailable();
|
||||
}
|
||||
else
|
||||
{
|
||||
Settings.AppSetting.WifiEnable = true;
|
||||
Settings.AppSetting.NetworkSetting.WifiEnable = true;
|
||||
}
|
||||
|
||||
if (Settings.AppSetting.GeoWatchEnable)
|
||||
|
||||
if (Settings.AppSetting.LocatingSetting.GeoWatchEnable)
|
||||
{
|
||||
Thread thread = new Thread(new ThreadStart(this.PositionThread));
|
||||
thread.Start();
|
||||
|
||||
@@ -133,10 +133,22 @@
|
||||
<Compile Include="Model\Person\PersonWp8Model.cs" />
|
||||
<Compile Include="Model\Setting\AppSettings.cs" />
|
||||
<Compile Include="Model\Setting\BTUTagHandlerTypes.cs" />
|
||||
<Compile Include="Model\Setting\BTUTagSetting.cs" />
|
||||
<Compile Include="Model\Setting\FunctionSettings.cs" />
|
||||
<Compile Include="Model\Setting\ISetting.cs" />
|
||||
<Compile Include="Model\Setting\LocatingSetting.cs" />
|
||||
<Compile Include="Model\Setting\NetworkSetting.cs" />
|
||||
<Compile Include="Model\Setting\SettingsTypes.cs" />
|
||||
<Compile Include="Model\Setting\TagHandlerListPickerItemListModel.cs" />
|
||||
<Compile Include="Model\Setting\TimeTableSetting.cs" />
|
||||
<Compile Include="Model\Setting\UserProfilModel.cs" />
|
||||
<Compile Include="Model\TimeTable\AppointmentListModel.cs" />
|
||||
<Compile Include="Model\TimeTable\AppointmentModel.cs" />
|
||||
<Compile Include="Pages\Setting\FunctionSettingPage.xaml.cs">
|
||||
<DependentUpon>FunctionSettingPage.xaml</DependentUpon>
|
||||
</Compile>
|
||||
<Compile Include="Pages\Setting\IRefreshingPage.cs" />
|
||||
<Compile Include="Model\Setting\MensaSetting.cs" />
|
||||
<Compile Include="Pages\TimeTable\Appointment.xaml.cs">
|
||||
<DependentUpon>Appointment.xaml</DependentUpon>
|
||||
</Compile>
|
||||
@@ -248,6 +260,8 @@
|
||||
<Compile Include="Utility\Lui\Button\AddButton.cs" />
|
||||
<Compile Include="Utility\Lui\Button\AddPersonButton.cs" />
|
||||
<Compile Include="Utility\Lui\Button\DelButton.cs" />
|
||||
<Compile Include="Utility\Lui\Button\ResetSettingButtonAppBar.cs" />
|
||||
<Compile Include="Utility\Lui\Button\ToDefaultButton.cs" />
|
||||
<Compile Include="Utility\Lui\Header\DefaultHeader.xaml.cs">
|
||||
<DependentUpon>DefaultHeader.xaml</DependentUpon>
|
||||
</Compile>
|
||||
@@ -484,6 +498,10 @@
|
||||
<SubType>Designer</SubType>
|
||||
<Generator>MSBuild:Compile</Generator>
|
||||
</Page>
|
||||
<Page Include="Pages\Setting\FunctionSettingPage.xaml">
|
||||
<SubType>Designer</SubType>
|
||||
<Generator>MSBuild:Compile</Generator>
|
||||
</Page>
|
||||
<Page Include="Pages\Setting\Impressum.xaml">
|
||||
<SubType>Designer</SubType>
|
||||
<Generator>MSBuild:Compile</Generator>
|
||||
@@ -524,6 +542,10 @@
|
||||
<Generator>MSBuild:Compile</Generator>
|
||||
<SubType>Designer</SubType>
|
||||
</Page>
|
||||
<Page Include="Styles\Labels.xaml">
|
||||
<Generator>MSBuild:Compile</Generator>
|
||||
<SubType>Designer</SubType>
|
||||
</Page>
|
||||
<Page Include="Styles\StartPageStyles.xaml">
|
||||
<Generator>MSBuild:Compile</Generator>
|
||||
<SubType>Designer</SubType>
|
||||
|
||||
@@ -8,26 +8,79 @@
|
||||
//-----------------------------------------------------------------------
|
||||
namespace CampusAppWP8.Model.Setting
|
||||
{
|
||||
using CampusAppWP8.Pages.Setting;
|
||||
using CampusAppWP8.Resources;
|
||||
|
||||
/// <summary> Model for settings of the app. </summary>
|
||||
/// <remarks> Stubbfel, 15.10.2013. </remarks>
|
||||
public class AppSettings
|
||||
public class AppSettings : ISetting
|
||||
{
|
||||
#region member
|
||||
|
||||
/// <summary> The mensa setting. </summary>
|
||||
private static FunctionSettings functionSetting = new FunctionSettings();
|
||||
|
||||
/// <summary> The network setting. </summary>
|
||||
private static NetworkSetting networkSetting = new NetworkSetting();
|
||||
|
||||
/// <summary> The locating setting. </summary>
|
||||
private static LocatingSetting locatingSetting = new LocatingSetting();
|
||||
|
||||
#endregion
|
||||
|
||||
#region Property
|
||||
|
||||
/// <summary> Gets or sets a value indicating whether the GeoWatch-Flag. </summary>
|
||||
/// <value> true if geo watch enable, false if not. </value>
|
||||
public bool GeoWatchEnable
|
||||
/// <summary> Gets or sets the locating setting. </summary>
|
||||
/// <value> The locating setting. </value>
|
||||
public LocatingSetting LocatingSetting
|
||||
{
|
||||
get
|
||||
{
|
||||
return App.LoadFromAppState<bool>(Constants.AppSetting_GeoWatchEnable);
|
||||
return AppSettings.locatingSetting;
|
||||
}
|
||||
|
||||
set
|
||||
{
|
||||
App.SaveToAppState<bool>(Constants.AppSetting_GeoWatchEnable, value);
|
||||
if (AppSettings.locatingSetting != value)
|
||||
{
|
||||
AppSettings.locatingSetting = value;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary> Gets or sets the network setting. </summary>
|
||||
/// <value> The network setting. </value>
|
||||
public NetworkSetting NetworkSetting
|
||||
{
|
||||
get
|
||||
{
|
||||
return AppSettings.networkSetting;
|
||||
}
|
||||
|
||||
set
|
||||
{
|
||||
if (AppSettings.networkSetting != value)
|
||||
{
|
||||
AppSettings.networkSetting = value;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary> Gets or sets the function settings. </summary>
|
||||
/// <value> The function settings. </value>
|
||||
public FunctionSettings FunctionSettings
|
||||
{
|
||||
get
|
||||
{
|
||||
return AppSettings.functionSetting;
|
||||
}
|
||||
|
||||
set
|
||||
{
|
||||
if (AppSettings.functionSetting != value)
|
||||
{
|
||||
AppSettings.functionSetting = value;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -61,51 +114,6 @@ namespace CampusAppWP8.Model.Setting
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary> Gets or sets a value indicating whether the uni network. </summary>
|
||||
/// <value> true if uni network, false if not. </value>
|
||||
public bool UniNetwork
|
||||
{
|
||||
get
|
||||
{
|
||||
return App.LoadFromAppState<bool>(Constants.AppSetting_UniNet);
|
||||
}
|
||||
|
||||
set
|
||||
{
|
||||
App.SaveToAppState<bool>(Constants.AppSetting_UniNet, value);
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary> Gets or sets a value indicating whether this object is WiFi enable. </summary>
|
||||
/// <value> true if WiFi enable, false if not. </value>
|
||||
public bool WifiEnable
|
||||
{
|
||||
get
|
||||
{
|
||||
return App.LoadFromAppState<bool>(Constants.AppSetting_WifiEnable);
|
||||
}
|
||||
|
||||
set
|
||||
{
|
||||
App.SaveToAppState<bool>(Constants.AppSetting_WifiEnable, value);
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary> Gets or sets a value indicating whether the only WiFi. </summary>
|
||||
/// <value> true if only wifi, false if not. </value>
|
||||
public bool OnlyWifi
|
||||
{
|
||||
get
|
||||
{
|
||||
return App.LoadFromAppState<bool>(Constants.AppSetting_OnlyWifi);
|
||||
}
|
||||
|
||||
set
|
||||
{
|
||||
App.SaveToAppState<bool>(Constants.AppSetting_OnlyWifi, value);
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary> Gets or sets the DeploymentNumber of the app. </summary>
|
||||
/// <value> The deployment number. </value>
|
||||
public int DeploymentNumber
|
||||
@@ -121,21 +129,28 @@ namespace CampusAppWP8.Model.Setting
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary> Gets or sets the tag default handler. </summary>
|
||||
/// <value> The tag default handler. </value>
|
||||
public BTUTagDefaultHandler TagDefaultHandler
|
||||
#endregion
|
||||
|
||||
#region method
|
||||
|
||||
/// <summary> Sets setting to default. </summary>
|
||||
/// <remarks> Stubbfel, 25.11.2013. </remarks>
|
||||
public void SetSettingToDefault()
|
||||
{
|
||||
get
|
||||
// set Deploynumber
|
||||
int appDeploy;
|
||||
bool parseResult = int.TryParse(Constants.DeploymentNumber, out appDeploy);
|
||||
if (parseResult)
|
||||
{
|
||||
return App.LoadFromAppState<BTUTagDefaultHandler>(Constants.AppSetting_BTUTagDefaultHandler);
|
||||
this.DeploymentNumber = appDeploy;
|
||||
}
|
||||
|
||||
set
|
||||
{
|
||||
App.SaveToAppState<BTUTagDefaultHandler>(Constants.AppSetting_BTUTagDefaultHandler, value);
|
||||
}
|
||||
this.DevMode = false;
|
||||
this.InitApp = false;
|
||||
this.FunctionSettings.SetSettingToDefault();
|
||||
this.NetworkSetting.SetSettingToDefault();
|
||||
this.LocatingSetting.SetSettingToDefault();
|
||||
}
|
||||
|
||||
#endregion
|
||||
}
|
||||
}
|
||||
48
CampusAppWP8/CampusAppWP8/Model/Setting/BTUTagSetting.cs
Normal file
48
CampusAppWP8/CampusAppWP8/Model/Setting/BTUTagSetting.cs
Normal file
@@ -0,0 +1,48 @@
|
||||
//-----------------------------------------------------------------------
|
||||
// <copyright file="BTUTagSetting.cs" company="BTU/IIT">
|
||||
// The MIT License (MIT). Copyright (c) 2013 BTU/IIT.
|
||||
// </copyright>
|
||||
// <author>Stubbfel</author>
|
||||
// <date>25.11.2013</date>
|
||||
// <summary>Implements the btu tag setting class</summary>
|
||||
//-----------------------------------------------------------------------
|
||||
namespace CampusAppWP8.Model.Setting
|
||||
{
|
||||
using CampusAppWP8.Resources;
|
||||
|
||||
/// <summary> A btu tag setting. </summary>
|
||||
/// <remarks> Stubbfel, 25.11.2013. </remarks>
|
||||
/// <seealso cref="T:CampusAppWP8.Model.Setting.ISetting"/>
|
||||
public class BTUTagSetting : ISetting
|
||||
{
|
||||
#region property
|
||||
|
||||
/// <summary> Gets or sets the tag default handler. </summary>
|
||||
/// <value> The tag default handler. </value>
|
||||
public BTUTagDefaultHandler TagDefaultHandler
|
||||
{
|
||||
get
|
||||
{
|
||||
return App.LoadFromAppState<BTUTagDefaultHandler>(Constants.AppSetting_BTUTagDefaultHandler);
|
||||
}
|
||||
|
||||
set
|
||||
{
|
||||
App.SaveToAppState<BTUTagDefaultHandler>(Constants.AppSetting_BTUTagDefaultHandler, value);
|
||||
}
|
||||
}
|
||||
|
||||
#endregion
|
||||
|
||||
#region method
|
||||
|
||||
/// <summary> Sets setting to default. </summary>
|
||||
/// <remarks> Stubbfel, 25.11.2013. </remarks>
|
||||
/// <seealso cref="M:CampusAppWP8.Model.Setting.ISetting.SetSettingToDefault()"/>
|
||||
public void SetSettingToDefault()
|
||||
{
|
||||
this.TagDefaultHandler = BTUTagDefaultHandler.InfoPage;
|
||||
}
|
||||
#endregion
|
||||
}
|
||||
}
|
||||
97
CampusAppWP8/CampusAppWP8/Model/Setting/FunctionSettings.cs
Normal file
97
CampusAppWP8/CampusAppWP8/Model/Setting/FunctionSettings.cs
Normal file
@@ -0,0 +1,97 @@
|
||||
//-----------------------------------------------------------------------
|
||||
// <copyright file="FunctionSettings.cs" company="BTU/IIT">
|
||||
// The MIT License (MIT). Copyright (c) 2013 BTU/IIT.
|
||||
// </copyright>
|
||||
// <author>Stubbfel</author>
|
||||
// <date>25.11.2013</date>
|
||||
// <summary>Implements the function settings class</summary>
|
||||
//-----------------------------------------------------------------------
|
||||
namespace CampusAppWP8.Model.Setting
|
||||
{
|
||||
|
||||
/// <summary> A function settings. </summary>
|
||||
/// <remarks> Stubbfel, 25.11.2013. </remarks>
|
||||
/// <seealso cref="T:CampusAppWP8.Model.Setting.ISetting"/>
|
||||
public class FunctionSettings : ISetting
|
||||
{
|
||||
#region member
|
||||
|
||||
/// <summary> The mensa setting. </summary>
|
||||
private static MensaSetting mensaSetting = new MensaSetting();
|
||||
|
||||
/// <summary> The tag setting. </summary>
|
||||
private static BTUTagSetting tagSetting = new BTUTagSetting();
|
||||
|
||||
/// <summary> The time table setting. </summary>
|
||||
private static TimeTableSetting timeTableSetting = new TimeTableSetting();
|
||||
|
||||
#endregion
|
||||
|
||||
#region Property
|
||||
|
||||
/// <summary> Gets or sets the time table setting. </summary>
|
||||
/// <value> The time table setting. </value>
|
||||
public TimeTableSetting TimeTableSetting
|
||||
{
|
||||
get
|
||||
{
|
||||
return FunctionSettings.timeTableSetting;
|
||||
}
|
||||
|
||||
set
|
||||
{
|
||||
FunctionSettings.timeTableSetting = value;
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary> Gets or sets the tag setting. </summary>
|
||||
/// <value> The tag setting. </value>
|
||||
public BTUTagSetting TagSetting
|
||||
{
|
||||
get
|
||||
{
|
||||
return FunctionSettings.tagSetting;
|
||||
}
|
||||
|
||||
set
|
||||
{
|
||||
if (FunctionSettings.tagSetting != value)
|
||||
{
|
||||
FunctionSettings.tagSetting = value;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary> Gets or sets the mensa setting. </summary>
|
||||
/// <value> The mensa setting. </value>
|
||||
public MensaSetting MensaSetting
|
||||
{
|
||||
get
|
||||
{
|
||||
return FunctionSettings.mensaSetting;
|
||||
}
|
||||
|
||||
set
|
||||
{
|
||||
if (value != FunctionSettings.mensaSetting)
|
||||
{
|
||||
FunctionSettings.mensaSetting = value;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
#endregion
|
||||
|
||||
#region method
|
||||
|
||||
/// <summary> Sets setting to default. </summary>
|
||||
/// <remarks> Stubbfel, 25.11.2013. </remarks>
|
||||
/// <seealso cref="M:CampusAppWP8.Model.Setting.ISetting.SetSettingToDefault()"/>
|
||||
public void SetSettingToDefault()
|
||||
{
|
||||
this.TagSetting.SetSettingToDefault();
|
||||
this.MensaSetting.SetSettingToDefault();
|
||||
}
|
||||
#endregion
|
||||
}
|
||||
}
|
||||
18
CampusAppWP8/CampusAppWP8/Model/Setting/ISetting.cs
Normal file
18
CampusAppWP8/CampusAppWP8/Model/Setting/ISetting.cs
Normal file
@@ -0,0 +1,18 @@
|
||||
//-----------------------------------------------------------------------
|
||||
// <copyright file="ISetting.cs" company="BTU/IIT">
|
||||
// The MIT License (MIT). Copyright (c) 2013 BTU/IIT.
|
||||
// </copyright>
|
||||
// <author>Stubbfel</author>
|
||||
// <date>25.11.2013</date>
|
||||
// <summary>Declares the ISetting interface</summary>
|
||||
//-----------------------------------------------------------------------
|
||||
namespace CampusAppWP8.Model.Setting
|
||||
{
|
||||
/// <summary> Interface for setting. </summary>
|
||||
/// <remarks> Stubbfel, 25.11.2013. </remarks>
|
||||
public interface ISetting
|
||||
{
|
||||
/// <summary> Sets setting to default. </summary>
|
||||
void SetSettingToDefault();
|
||||
}
|
||||
}
|
||||
48
CampusAppWP8/CampusAppWP8/Model/Setting/LocatingSetting.cs
Normal file
48
CampusAppWP8/CampusAppWP8/Model/Setting/LocatingSetting.cs
Normal file
@@ -0,0 +1,48 @@
|
||||
//-----------------------------------------------------------------------
|
||||
// <copyright file="LocatingSetting.cs" company="BTU/IIT">
|
||||
// The MIT License (MIT). Copyright (c) 2013 BTU/IIT.
|
||||
// </copyright>
|
||||
// <author>Stubbfel</author>
|
||||
// <date>25.11.2013</date>
|
||||
// <summary>Implements the locating setting class</summary>
|
||||
//-----------------------------------------------------------------------
|
||||
namespace CampusAppWP8.Model.Setting
|
||||
{
|
||||
using CampusAppWP8.Resources;
|
||||
|
||||
/// <summary> A locating setting. </summary>
|
||||
/// <remarks> Stubbfel, 25.11.2013. </remarks>
|
||||
/// <seealso cref="T:CampusAppWP8.Model.Setting.ISetting"/>
|
||||
public class LocatingSetting : ISetting
|
||||
{
|
||||
#region property
|
||||
|
||||
/// <summary> Gets or sets a value indicating whether the GeoWatch-Flag. </summary>
|
||||
/// <value> true if geo watch enable, false if not. </value>
|
||||
public bool GeoWatchEnable
|
||||
{
|
||||
get
|
||||
{
|
||||
return App.LoadFromAppState<bool>(Constants.AppSetting_GeoWatchEnable);
|
||||
}
|
||||
|
||||
set
|
||||
{
|
||||
App.SaveToAppState<bool>(Constants.AppSetting_GeoWatchEnable, value);
|
||||
}
|
||||
}
|
||||
|
||||
#endregion
|
||||
|
||||
#region method
|
||||
|
||||
/// <summary> Sets setting to default. </summary>
|
||||
/// <remarks> Stubbfel, 25.11.2013. </remarks>
|
||||
/// <seealso cref="M:CampusAppWP8.Model.Setting.ISetting.SetSettingToDefault()"/>
|
||||
public void SetSettingToDefault()
|
||||
{
|
||||
this.GeoWatchEnable = false;
|
||||
}
|
||||
#endregion
|
||||
}
|
||||
}
|
||||
85
CampusAppWP8/CampusAppWP8/Model/Setting/MensaSetting.cs
Normal file
85
CampusAppWP8/CampusAppWP8/Model/Setting/MensaSetting.cs
Normal file
@@ -0,0 +1,85 @@
|
||||
//-----------------------------------------------------------------------
|
||||
// <copyright file="MensaSetting.cs" company="BTU/IIT">
|
||||
// The MIT License (MIT). Copyright (c) 2013 BTU/IIT.
|
||||
// </copyright>
|
||||
// <author>Stubbfel</author>
|
||||
// <date>25.11.2013</date>
|
||||
// <summary>Implements the mensa setting class</summary>
|
||||
//-----------------------------------------------------------------------
|
||||
namespace CampusAppWP8.Model.Setting
|
||||
{
|
||||
using CampusAppWP8.Resources;
|
||||
using CampusAppWPortalLib8.Model.Settings;
|
||||
|
||||
/// <summary> A mensa setting. </summary>
|
||||
/// <remarks> Stubbfel, 25.11.2013. </remarks>
|
||||
public class MensaSetting : ISetting
|
||||
{
|
||||
#region Property
|
||||
|
||||
/// <summary> Gets or sets a value indicating whether the atom mensa selection. </summary>
|
||||
/// <value> true if atom mensa selection, false if not. </value>
|
||||
public bool AtomMensaSelection
|
||||
{
|
||||
get
|
||||
{
|
||||
return App.LoadFromAppState<bool>(Constants.AppSetting_MensaSetting_AtomMensaSelection);
|
||||
}
|
||||
|
||||
set
|
||||
{
|
||||
App.SaveToAppState<bool>(Constants.AppSetting_MensaSetting_AtomMensaSelection, value);
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary> Gets or sets the default mensa. </summary>
|
||||
/// <value> The default mensa. </value>
|
||||
public Campus DefaultMensa
|
||||
{
|
||||
get
|
||||
{
|
||||
return App.LoadFromAppState<Campus>(Constants.Setting_Mensa_DefaultCampus);
|
||||
}
|
||||
|
||||
set
|
||||
{
|
||||
App.SaveToAppState<Campus>(Constants.Setting_Mensa_DefaultCampus, value);
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary> Gets or sets the selected mensa. </summary>
|
||||
/// <value> The selected mensa. </value>
|
||||
public Campus SelectedMensa
|
||||
{
|
||||
get
|
||||
{
|
||||
Campus mensa = App.LoadFromAppState<Campus>(Constants.Setting_Mensa_DefaultCampus);
|
||||
if (mensa == Campus.UserSettingCampus)
|
||||
{
|
||||
mensa = Settings.UserProfil.DefaultCampus;
|
||||
}
|
||||
return mensa;
|
||||
}
|
||||
|
||||
set
|
||||
{
|
||||
App.SaveToAppState<Campus>(Constants.Setting_Mensa_DefaultCampus, value);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
#endregion
|
||||
|
||||
#region method
|
||||
|
||||
/// <summary> Sets setting to default. </summary>
|
||||
/// <remarks> Stubbfel, 25.11.2013. </remarks>
|
||||
public void SetSettingToDefault()
|
||||
{
|
||||
// set Deploynumber
|
||||
this.AtomMensaSelection = true;
|
||||
this.DefaultMensa = Campus.UserSettingCampus;
|
||||
}
|
||||
#endregion
|
||||
}
|
||||
}
|
||||
89
CampusAppWP8/CampusAppWP8/Model/Setting/NetworkSetting.cs
Normal file
89
CampusAppWP8/CampusAppWP8/Model/Setting/NetworkSetting.cs
Normal file
@@ -0,0 +1,89 @@
|
||||
//-----------------------------------------------------------------------
|
||||
// <copyright file="NetworkSetting.cs" company="BTU/IIT">
|
||||
// The MIT License (MIT). Copyright (c) 2013 BTU/IIT.
|
||||
// </copyright>
|
||||
// <author>Stubbfel</author>
|
||||
// <date>25.11.2013</date>
|
||||
// <summary>Implements the network setting class</summary>
|
||||
//-----------------------------------------------------------------------
|
||||
namespace CampusAppWP8.Model.Setting
|
||||
{
|
||||
using CampusAppWP8.Resources;
|
||||
using CampusAppWP8.Utility;
|
||||
|
||||
/// <summary> A network setting. </summary>
|
||||
/// <remarks> Stubbfel, 25.11.2013. </remarks>
|
||||
/// <seealso cref="T:CampusAppWP8.Model.Setting.ISetting"/>
|
||||
public class NetworkSetting : ISetting
|
||||
{
|
||||
#region property
|
||||
|
||||
/// <summary> Gets or sets a value indicating whether the uni network. </summary>
|
||||
/// <value> true if uni network, false if not. </value>
|
||||
public bool UniNetwork
|
||||
{
|
||||
get
|
||||
{
|
||||
return App.LoadFromAppState<bool>(Constants.AppSetting_UniNet);
|
||||
}
|
||||
|
||||
set
|
||||
{
|
||||
App.SaveToAppState<bool>(Constants.AppSetting_UniNet, value);
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary> Gets or sets a value indicating whether this object is WiFi enable. </summary>
|
||||
/// <value> true if WiFi enable, false if not. </value>
|
||||
public bool WifiEnable
|
||||
{
|
||||
get
|
||||
{
|
||||
return App.LoadFromAppState<bool>(Constants.AppSetting_WifiEnable);
|
||||
}
|
||||
|
||||
set
|
||||
{
|
||||
App.SaveToAppState<bool>(Constants.AppSetting_WifiEnable, value);
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary> Gets or sets a value indicating whether the only WiFi. </summary>
|
||||
/// <value> true if only wifi, false if not. </value>
|
||||
public bool OnlyWifi
|
||||
{
|
||||
get
|
||||
{
|
||||
return App.LoadFromAppState<bool>(Constants.AppSetting_OnlyWifi);
|
||||
}
|
||||
|
||||
set
|
||||
{
|
||||
App.SaveToAppState<bool>(Constants.AppSetting_OnlyWifi, value);
|
||||
}
|
||||
}
|
||||
|
||||
#endregion
|
||||
|
||||
#region method
|
||||
|
||||
/// <summary> Sets setting to default. </summary>
|
||||
/// <remarks> Stubbfel, 25.11.2013. </remarks>
|
||||
/// <seealso cref="M:CampusAppWP8.Model.Setting.ISetting.SetSettingToDefault()"/>
|
||||
public void SetSettingToDefault()
|
||||
{
|
||||
this.OnlyWifi = false;
|
||||
|
||||
this.UniNetwork = Utilities.IsUniNetworkAvailable();
|
||||
if (!this.UniNetwork)
|
||||
{
|
||||
this.WifiEnable = Utilities.IsWifiAvailable();
|
||||
}
|
||||
else
|
||||
{
|
||||
this.WifiEnable = true;
|
||||
}
|
||||
}
|
||||
#endregion
|
||||
}
|
||||
}
|
||||
48
CampusAppWP8/CampusAppWP8/Model/Setting/SettingsTypes.cs
Normal file
48
CampusAppWP8/CampusAppWP8/Model/Setting/SettingsTypes.cs
Normal file
@@ -0,0 +1,48 @@
|
||||
//-----------------------------------------------------------------------
|
||||
// <copyright file="SettingsTypes.cs" company="BTU/IIT">
|
||||
// The MIT License (MIT). Copyright (c) 2013 BTU/IIT.
|
||||
// </copyright>
|
||||
// <author>Stubbfel</author>
|
||||
// <date>25.11.2013</date>
|
||||
// <summary>Implements the settings types class</summary>
|
||||
//-----------------------------------------------------------------------
|
||||
namespace CampusAppWP8.Model.Setting
|
||||
{
|
||||
/// <summary> Values that represent SettingType. </summary>
|
||||
/// <remarks> Stubbfel, 25.11.2013. </remarks>
|
||||
public enum SettingType
|
||||
{
|
||||
/// <summary> An enum constant representing the setting option. </summary>
|
||||
Setting,
|
||||
|
||||
/// <summary> An enum constant representing the appsetting option. </summary>
|
||||
Appsetting,
|
||||
|
||||
/// <summary> An enum constant representing the user setting option. </summary>
|
||||
UserSetting,
|
||||
|
||||
/// <summary> An enum constant representing the appsetting functionsetting option. </summary>
|
||||
Appsetting_Functionsetting,
|
||||
|
||||
/// <summary> An enum constant representing the appsetting networksetting option. </summary>
|
||||
Appsetting_Networksetting,
|
||||
|
||||
/// <summary> An enum constant representing the appsetting locatingsetting option. </summary>
|
||||
Appsetting_Locatingsetting,
|
||||
|
||||
/// <summary>
|
||||
/// An enum constant representing the appsetting functionsetting mensasetting option.
|
||||
/// </summary>
|
||||
Appsetting_Functionsetting_Mensasetting,
|
||||
|
||||
/// <summary>
|
||||
/// An enum constant representing the appsetting functionsetting tagsetting option.
|
||||
/// </summary>
|
||||
Appsetting_Functionsetting_Tagsetting,
|
||||
|
||||
/// <summary>
|
||||
/// An enum constant representing the appsetting functionsetting time tablesetting option.
|
||||
/// </summary>
|
||||
Appsetting_Functionsetting_TimeTablesetting
|
||||
}
|
||||
}
|
||||
32
CampusAppWP8/CampusAppWP8/Model/Setting/TimeTableSetting.cs
Normal file
32
CampusAppWP8/CampusAppWP8/Model/Setting/TimeTableSetting.cs
Normal file
@@ -0,0 +1,32 @@
|
||||
//-----------------------------------------------------------------------
|
||||
// <copyright file="TimeTableSetting.cs" company="BTU/IIT">
|
||||
// The MIT License (MIT). Copyright (c) 2013 BTU/IIT.
|
||||
// </copyright>
|
||||
// <author>Stubbfel</author>
|
||||
// <date>25.11.2013</date>
|
||||
// <summary>Implements the time table setting class</summary>
|
||||
//-----------------------------------------------------------------------
|
||||
namespace CampusAppWP8.Model.Setting
|
||||
{
|
||||
/// <summary> A time table setting. </summary>
|
||||
/// <remarks> Stubbfel, 25.11.2013. </remarks>
|
||||
/// <seealso cref="T:CampusAppWP8.Model.Setting.ISetting"/>
|
||||
public class TimeTableSetting : ISetting
|
||||
{
|
||||
|
||||
#region Property
|
||||
|
||||
|
||||
#endregion
|
||||
|
||||
#region method
|
||||
|
||||
/// <summary> Sets setting to default. </summary>
|
||||
/// <remarks> Stubbfel, 25.11.2013. </remarks>
|
||||
/// <seealso cref="M:CampusAppWP8.Model.Setting.ISetting.SetSettingToDefault()"/>
|
||||
public void SetSettingToDefault()
|
||||
{
|
||||
}
|
||||
#endregion
|
||||
}
|
||||
}
|
||||
@@ -8,14 +8,14 @@
|
||||
//-----------------------------------------------------------------------
|
||||
namespace CampusAppWP8.Model.Setting
|
||||
{
|
||||
using System;
|
||||
using System.Xml.Serialization;
|
||||
using CampusAppWP8.Resources;
|
||||
using CampusAppWPortalLib8.Model.Settings;
|
||||
|
||||
/// <summary> Model for the profile of an user. </summary>
|
||||
/// <remarks> Stubbfel, 15.10.2013. </remarks>
|
||||
[XmlRoot("root")]
|
||||
public class UserProfilModel
|
||||
public class UserProfilModel : ISetting
|
||||
{
|
||||
#region Members
|
||||
|
||||
@@ -116,6 +116,24 @@ namespace CampusAppWP8.Model.Setting
|
||||
|
||||
#region Methods
|
||||
|
||||
#region public
|
||||
|
||||
/// <summary> Sets setting to default. </summary>
|
||||
/// <remarks> Stubbfel, 25.11.2013. </remarks>
|
||||
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
|
||||
|
||||
/// <summary> Methods check if a value could be a valid semester. </summary>
|
||||
/// <remarks> Stubbfel, 15.10.2013. </remarks>
|
||||
/// <param name="possibleSemester"> value which has to be checked. </param>
|
||||
@@ -144,6 +162,30 @@ namespace CampusAppWP8.Model.Setting
|
||||
return true;
|
||||
}
|
||||
|
||||
/// <summary> Calculates the current semester. </summary>
|
||||
/// <remarks> Stubbfel, 25.11.2013. </remarks>
|
||||
/// <returns> The calculated current semester. </returns>
|
||||
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
|
||||
}
|
||||
}
|
||||
|
||||
@@ -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);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -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
|
||||
/// <seealso cref="M:System.Windows.Controls.Page.OnNavigatedFrom(NavigationEventArgs)"/>
|
||||
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
|
||||
/// <param name="message"> the message of the device. </param>
|
||||
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
|
||||
/// <param name="places"> The places. </param>
|
||||
/// <param name="type"> The type. </param>
|
||||
/// <param name="scroll"> (Optional) the scroll. </param>
|
||||
private void AddPins(List<PlaceModel> places,PinType type, bool scroll = true)
|
||||
private void AddPins(List<PlaceModel> places, PinType type, bool scroll = true)
|
||||
{
|
||||
foreach (PlaceModel place in places)
|
||||
{
|
||||
@@ -687,7 +688,7 @@ namespace CampusAppWP8.Pages.Campusmap
|
||||
/// <param name="scroll"> (Optional) the scroll. </param>
|
||||
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<GeoMapPoint>(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<string>() { 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
|
||||
|
||||
@@ -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);
|
||||
|
||||
@@ -49,7 +49,7 @@ namespace CampusAppWP8.Pages.Mensa
|
||||
private bool forceLoad = false;
|
||||
|
||||
/// <summary> Identifier for the location. </summary>
|
||||
public int locationID = -1;
|
||||
private int locationID = -1;
|
||||
|
||||
#endregion
|
||||
|
||||
@@ -231,7 +231,7 @@ namespace CampusAppWP8.Pages.Mensa
|
||||
/// <remarks> Stubbfel, 15.10.2013. </remarks>
|
||||
private void InitializeFeed()
|
||||
{
|
||||
if (Settings.AppSetting.GeoWatchEnable)
|
||||
if (Settings.AppSetting.LocatingSetting.GeoWatchEnable)
|
||||
{
|
||||
Thread thread = new Thread(new ThreadStart(this.DeterminCurrentCampusAndLoadFeed));
|
||||
thread.Start();
|
||||
@@ -445,7 +445,6 @@ namespace CampusAppWP8.Pages.Mensa
|
||||
copyText = Wp8StringManager.AddNewLine(copyText);
|
||||
}
|
||||
|
||||
|
||||
Clipboard.SetText(copyText);
|
||||
}
|
||||
|
||||
@@ -455,7 +454,6 @@ namespace CampusAppWP8.Pages.Mensa
|
||||
/// <param name="e"> Event information. </param>
|
||||
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 + " :";
|
||||
|
||||
@@ -9,6 +9,7 @@
|
||||
xmlns:toolkit="clr-namespace:Microsoft.Phone.Controls;assembly=Microsoft.Phone.Controls.Toolkit"
|
||||
xmlns:header="clr-namespace:CampusAppWP8.Utility.Lui.Header"
|
||||
xmlns:lui="clr-namespace:CampusAppWP8.Utility.Lui.Button"
|
||||
xmlns:page="clr-namespace:CampusAppWP8.Utility.Lui.Page"
|
||||
FontFamily="{StaticResource PhoneFontFamilyNormal}"
|
||||
FontSize="{StaticResource PhoneFontSizeNormal}"
|
||||
Foreground="{StaticResource PhoneForegroundBrush}"
|
||||
@@ -25,48 +26,116 @@
|
||||
|
||||
<!--TitlePanel enthält den Namen der Anwendung und den Seitentitel-->
|
||||
<StackPanel Grid.Row="0">
|
||||
<header:DefaultHeader Name="DefHeader" HeaderName="{Binding Path=LocalizedResources.Setting_App, Source={StaticResource LocalizedStrings}}"/>
|
||||
<header:DefaultHeader Name="DefHeader" HeaderName="{Binding Path=LocalizedResources.Setting_General, Source={StaticResource LocalizedStrings}}"/>
|
||||
</StackPanel>
|
||||
<ScrollViewer Grid.Row="1">
|
||||
<!--ContentPanel - zusätzliche Inhalte hier platzieren-->
|
||||
<Grid x:Name="ContentPanel" Margin="12,0,12,0">
|
||||
<Grid.RowDefinitions>
|
||||
<RowDefinition Height="auto"/>
|
||||
<RowDefinition Height="auto"/>
|
||||
<RowDefinition Height="auto"/>
|
||||
<RowDefinition Height="auto"/>
|
||||
<RowDefinition Height="*"/>
|
||||
</Grid.RowDefinitions>
|
||||
<StackPanel Grid.Row="0">
|
||||
<toolkit:ToggleSwitch Name="GeoWatchToggle" Content="{Binding Path=LocalizedResources.Setting_AppGeoWatch, Source={StaticResource LocalizedStrings}}"></toolkit:ToggleSwitch>
|
||||
</StackPanel>
|
||||
<StackPanel Grid.Row="1">
|
||||
<toolkit:ToggleSwitch Name="OnlyWiFiToggle" Content="{Binding Path=LocalizedResources.Setting_AppOnlyWifi, Source={StaticResource LocalizedStrings}}"></toolkit:ToggleSwitch>
|
||||
</StackPanel>
|
||||
<StackPanel Grid.Row="2">
|
||||
<lui:NavigateButton Content="{Binding Path=LocalizedResources.BTUTag_Title, Source={StaticResource LocalizedStrings}}" Url="{Binding Path=Constants.PathBTUTag_Info, Source={StaticResource Const}}" />
|
||||
</StackPanel>
|
||||
<StackPanel Grid.Row="3" >
|
||||
<TextBlock Margin="12,0,0,0" Text="{Binding Path=LocalizedResources.Setting_TagHandler, Source={StaticResource LocalizedStrings}}"/>
|
||||
<toolkit:ListPicker Name="TagHandler" ExpansionMode="FullScreenOnly" FullModeHeader="{Binding Path=LocalizedResources.ListPickerHeaderTag, Source={StaticResource LocalizedStrings}}" >
|
||||
<toolkit:ListPicker.ItemTemplate>
|
||||
<DataTemplate>
|
||||
<StackPanel>
|
||||
<TextBlock Text="{Binding Text}"/>
|
||||
</StackPanel>
|
||||
</DataTemplate>
|
||||
</toolkit:ListPicker.ItemTemplate>
|
||||
<toolkit:ListPicker.FullModeItemTemplate>
|
||||
<DataTemplate>
|
||||
<Border BorderBrush="{StaticResource PhoneAccentBrush}" BorderThickness="12,0,0,0" Margin="0,0,0,6">
|
||||
<TextBlock Text="{Binding Text}" Style="{StaticResource PhoneTextGroupHeaderStyle}" TextWrapping="Wrap"/>
|
||||
</Border>
|
||||
</DataTemplate>
|
||||
</toolkit:ListPicker.FullModeItemTemplate>
|
||||
</toolkit:ListPicker>
|
||||
</StackPanel>
|
||||
</Grid>
|
||||
</ScrollViewer>
|
||||
</Grid>
|
||||
<phone:Pivot Grid.Row="1" Name="GeneralSettingPivot">
|
||||
<phone:Pivot.HeaderTemplate>
|
||||
<DataTemplate>
|
||||
<Grid Margin="0,-36,0,0">
|
||||
<TextBlock Text="{Binding}"/>
|
||||
</Grid>
|
||||
</DataTemplate>
|
||||
</phone:Pivot.HeaderTemplate>
|
||||
<phone:PivotItem Header="{Binding Path=LocalizedResources.Setting_GeneralNetwork, Source={StaticResource LocalizedStrings}}">
|
||||
<ScrollViewer Grid.Row="1">
|
||||
<!--ContentPanel - zusätzliche Inhalte hier platzieren-->
|
||||
<Grid Margin="0">
|
||||
<Grid.RowDefinitions>
|
||||
<RowDefinition Height="auto"/>
|
||||
<RowDefinition Height="*"/>
|
||||
<RowDefinition Height="auto"/>
|
||||
</Grid.RowDefinitions>
|
||||
<StackPanel Grid.Row="0">
|
||||
<toolkit:ToggleSwitch Name="GeoWatchToggle" Content="{Binding Path=LocalizedResources.Setting_AppGeoWatch, Source={StaticResource LocalizedStrings}}"></toolkit:ToggleSwitch>
|
||||
</StackPanel>
|
||||
<StackPanel Grid.Row="1">
|
||||
<toolkit:ToggleSwitch Name="OnlyWiFiToggle" Content="{Binding Path=LocalizedResources.Setting_AppOnlyWifi, Source={StaticResource LocalizedStrings}}"></toolkit:ToggleSwitch>
|
||||
</StackPanel>
|
||||
<Grid Grid.Row="2">
|
||||
<Grid.ColumnDefinitions>
|
||||
<ColumnDefinition Width="*"/>
|
||||
<ColumnDefinition Width="auto"/>
|
||||
</Grid.ColumnDefinitions>
|
||||
<TextBlock
|
||||
Grid.Column="0"
|
||||
Text="{Binding Path=LocalizedResources.SettingToDefault, Source={StaticResource LocalizedStrings}}"
|
||||
Style="{StaticResource SettingLabel}"/>
|
||||
<lui:ToDefaultButton
|
||||
Grid.Column="1"
|
||||
SettingType="{Binding Path=Constants.Setting_AppSetting_NetworkSetting_Enum, Source={StaticResource Const}}" Height="100"/>
|
||||
</Grid>
|
||||
</Grid>
|
||||
</ScrollViewer>
|
||||
</phone:PivotItem>
|
||||
<phone:PivotItem
|
||||
Header="{Binding Path=LocalizedResources.Setting_Display_Short, Source={StaticResource LocalizedStrings}}">
|
||||
|
||||
</phone:PivotItem>
|
||||
|
||||
<phone:PivotItem
|
||||
Header="{Binding Path=LocalizedResources.Setting_Function_Short, Source={StaticResource LocalizedStrings}}">
|
||||
|
||||
<Grid>
|
||||
<Grid.RowDefinitions>
|
||||
<RowDefinition Height="*"/>
|
||||
<RowDefinition Height="auto"/>
|
||||
</Grid.RowDefinitions>
|
||||
<ListBox Grid.Row="0">
|
||||
<ListBox.ItemContainerStyle>
|
||||
<Style TargetType="ListBoxItem">
|
||||
<Setter Property="HorizontalContentAlignment" Value="Stretch"/>
|
||||
<Setter Property="HorizontalAlignment" Value="Stretch"/>
|
||||
</Style>
|
||||
</ListBox.ItemContainerStyle>
|
||||
<ListBoxItem>
|
||||
<lui:NavigateButton
|
||||
Style="{StaticResource ListButtonStyle}"
|
||||
Url="{Binding Path=Constants.PathSetting_Function, Source={StaticResource Const}}"
|
||||
QuerryStringName="{Binding Path=Constants.Param_FunctionSetting_Index, Source={StaticResource Const}}"
|
||||
QuerryStringValue="{Binding Path=Constants.FunctionSetting_Mensa, Source={StaticResource Const}}">
|
||||
<TextBlock Text="{Binding Path=LocalizedResources.MensaApp_Title, Source={StaticResource LocalizedStrings}}"/>
|
||||
</lui:NavigateButton>
|
||||
</ListBoxItem>
|
||||
<ListBoxItem>
|
||||
<lui:NavigateButton
|
||||
Style="{StaticResource ListButtonStyle}"
|
||||
Url="{Binding Path=Constants.PathSetting_Function, Source={StaticResource Const}}"
|
||||
QuerryStringName="{Binding Path=Constants.Param_FunctionSetting_Index, Source={StaticResource Const}}"
|
||||
QuerryStringValue="{Binding Path=Constants.FunctionSetting_TimeTable, Source={StaticResource Const}}">
|
||||
<TextBlock Text="{Binding Path=LocalizedResources.TimeTableApp_Title, Source={StaticResource LocalizedStrings}}"/>
|
||||
</lui:NavigateButton>
|
||||
</ListBoxItem>
|
||||
<ListBoxItem>
|
||||
<lui:NavigateButton
|
||||
Style="{StaticResource ListButtonStyle}"
|
||||
Url="{Binding Path=Constants.PathSetting_Function, Source={StaticResource Const}}"
|
||||
QuerryStringName="{Binding Path=Constants.Param_FunctionSetting_Index, Source={StaticResource Const}}"
|
||||
QuerryStringValue="{Binding Path=Constants.FunctionSetting_Tag, Source={StaticResource Const}}">
|
||||
<TextBlock Text="{Binding Path=LocalizedResources.Setting_Tag, Source={StaticResource LocalizedStrings}}"/>
|
||||
</lui:NavigateButton>
|
||||
</ListBoxItem>
|
||||
</ListBox>
|
||||
<Grid Grid.Row="1">
|
||||
<Grid.ColumnDefinitions>
|
||||
<ColumnDefinition Width="*"/>
|
||||
<ColumnDefinition Width="auto"/>
|
||||
</Grid.ColumnDefinitions>
|
||||
<TextBlock
|
||||
Grid.Column="0"
|
||||
Text="{Binding Path=LocalizedResources.SettingToDefault, Source={StaticResource LocalizedStrings}}"
|
||||
Style="{StaticResource SettingLabel}"/>
|
||||
<lui:ToDefaultButton
|
||||
Grid.Column="1"
|
||||
SettingType="{Binding Path=Constants.Setting_AppSetting_FunctionSetting_Enum, Source={StaticResource Const}}" Height="100"/>
|
||||
</Grid>
|
||||
</Grid>
|
||||
|
||||
</phone:PivotItem>
|
||||
</phone:Pivot>
|
||||
</Grid>
|
||||
<phone:PhoneApplicationPage.ApplicationBar>
|
||||
<shell:ApplicationBar IsVisible="True" IsMenuEnabled="False" Mode="Default" Opacity="1.0" >
|
||||
<lui:ResetSettingButtonAppBar Click="ResetSettingButtonAppBar_Click"/>
|
||||
</shell:ApplicationBar>
|
||||
</phone:PhoneApplicationPage.ApplicationBar>
|
||||
</phone:PhoneApplicationPage>
|
||||
@@ -9,19 +9,15 @@
|
||||
namespace CampusAppWP8.Pages.Setting
|
||||
{
|
||||
using System;
|
||||
using System.Windows.Navigation;
|
||||
using CampusAppWP8.Model.Setting;
|
||||
using System.Windows.Navigation;
|
||||
using CampusAppWP8.Resources;
|
||||
using Microsoft.Phone.Controls;
|
||||
|
||||
/// <summary> Class for the AppSettingPage. </summary>
|
||||
/// <remarks> Stubbfel, 15.10.2013. </remarks>
|
||||
/// <seealso cref="T:Microsoft.Phone.Controls.PhoneApplicationPage"/>
|
||||
public partial class AppSettingPage : PhoneApplicationPage
|
||||
public partial class AppSettingPage : PhoneApplicationPage, IRefreshingPage
|
||||
{
|
||||
#region Member
|
||||
/// <summary> The TagHandler model. </summary>
|
||||
private TagHandlerListPickerItemListModel taghandlerModel;
|
||||
#endregion
|
||||
#region Constructor
|
||||
|
||||
/// <summary> Initializes a new instance of the <see cref="AppSettingPage" /> class. </summary>
|
||||
@@ -29,18 +25,40 @@ namespace CampusAppWP8.Pages.Setting
|
||||
public AppSettingPage()
|
||||
{
|
||||
this.InitializeComponent();
|
||||
this.GeoWatchToggle.IsChecked = Settings.AppSetting.GeoWatchEnable;
|
||||
this.OnlyWiFiToggle.IsChecked = Settings.AppSetting.OnlyWifi;
|
||||
this.taghandlerModel = new TagHandlerListPickerItemListModel();
|
||||
this.TagHandler.ItemsSource = this.taghandlerModel.List;
|
||||
int tagselIndex = this.taghandlerModel.GetIndexOrDefault(Settings.AppSetting.TagDefaultHandler.ToString());
|
||||
this.TagHandler.SelectedIndex = tagselIndex;
|
||||
this.LoadSettings();
|
||||
}
|
||||
|
||||
#endregion
|
||||
|
||||
#region Method
|
||||
|
||||
#region public
|
||||
|
||||
/// <summary> Refresh page. </summary>
|
||||
/// <remarks> Stubbfel, 25.11.2013. </remarks>
|
||||
/// <seealso cref="M:CampusAppWP8.Pages.Setting.IRefreshingPage.RefreshPage()"/>
|
||||
public void RefreshPage()
|
||||
{
|
||||
this.LoadSettings();
|
||||
}
|
||||
#endregion
|
||||
|
||||
#region protected
|
||||
/// <summary> Override the OnNavigatedTo method. </summary>
|
||||
/// <remarks> Stubbfel, 15.10.2013. </remarks>
|
||||
/// <seealso cref="M:System.Windows.Controls.Page.OnNavigatedTo(NavigationEventArgs)"/>
|
||||
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<int>(Constants.IsolatedStorage_GeneralSettingPageIndex);
|
||||
this.GeneralSettingPivot.SelectedIndex = oldIndex;
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary> Override the OnNavigatedFrom method. </summary>
|
||||
/// <remarks> Stubbfel, 15.10.2013. </remarks>
|
||||
/// <seealso cref="M:System.Windows.Controls.Page.OnNavigatedFrom(NavigationEventArgs)"/>
|
||||
@@ -48,12 +66,46 @@ namespace CampusAppWP8.Pages.Setting
|
||||
{
|
||||
if (NavigationMode.Back == e.NavigationMode)
|
||||
{
|
||||
Settings.AppSetting.GeoWatchEnable = GeoWatchToggle.IsChecked.Value;
|
||||
Settings.AppSetting.OnlyWifi = OnlyWiFiToggle.IsChecked.Value;
|
||||
Settings.AppSetting.TagDefaultHandler = (CampusAppWP8.Model.Setting.BTUTagDefaultHandler)Enum.Parse(typeof(CampusAppWP8.Model.Setting.BTUTagDefaultHandler), ((CampusAppWPortalLib8.Model.Utility.ListPickerItemModel)this.TagHandler.SelectedItem).Value);
|
||||
this.SaveSettings();
|
||||
App.SaveToIsolatedStorage<int>(Constants.IsolatedStorage_GeneralSettingPageIndex, 0);
|
||||
}
|
||||
else
|
||||
{
|
||||
App.SaveToIsolatedStorage<int>(Constants.IsolatedStorage_FunctionSettingPageIndex, this.GeneralSettingPivot.SelectedIndex);
|
||||
}
|
||||
}
|
||||
|
||||
#endregion
|
||||
|
||||
#region private
|
||||
/// <summary> Loads the settings. </summary>
|
||||
/// <remarks> Stubbfel, 25.11.2013. </remarks>
|
||||
private void LoadSettings()
|
||||
{
|
||||
this.GeoWatchToggle.IsChecked = Settings.AppSetting.LocatingSetting.GeoWatchEnable;
|
||||
this.OnlyWiFiToggle.IsChecked = Settings.AppSetting.NetworkSetting.OnlyWifi;
|
||||
}
|
||||
|
||||
/// <summary> Saves the settings. </summary>
|
||||
/// <remarks> Stubbfel, 25.11.2013. </remarks>
|
||||
private void SaveSettings()
|
||||
{
|
||||
Settings.AppSetting.LocatingSetting.GeoWatchEnable = GeoWatchToggle.IsChecked.Value;
|
||||
Settings.AppSetting.NetworkSetting.OnlyWifi = OnlyWiFiToggle.IsChecked.Value;
|
||||
}
|
||||
|
||||
/// <summary> Event handler. Called by ResetSettingButtonAppBar for click events. </summary>
|
||||
/// <remarks> Stubbfel, 25.11.2013. </remarks>
|
||||
/// <param name="sender"> Source of the event. </param>
|
||||
/// <param name="e"> Event information. </param>
|
||||
private void ResetSettingButtonAppBar_Click(object sender, EventArgs e)
|
||||
{
|
||||
Settings.AppSetting.SetSettingToDefault();
|
||||
this.LoadSettings();
|
||||
}
|
||||
|
||||
#endregion
|
||||
|
||||
#endregion
|
||||
}
|
||||
}
|
||||
174
CampusAppWP8/CampusAppWP8/Pages/Setting/FunctionSettingPage.xaml
Normal file
174
CampusAppWP8/CampusAppWP8/Pages/Setting/FunctionSettingPage.xaml
Normal file
@@ -0,0 +1,174 @@
|
||||
<phone:PhoneApplicationPage
|
||||
x:Class="CampusAppWP8.Pages.Setting.FunctionSettingPage"
|
||||
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
|
||||
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
|
||||
xmlns:phone="clr-namespace:Microsoft.Phone.Controls;assembly=Microsoft.Phone"
|
||||
xmlns:shell="clr-namespace:Microsoft.Phone.Shell;assembly=Microsoft.Phone"
|
||||
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
|
||||
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"
|
||||
mc:Ignorable="d"
|
||||
FontFamily="{StaticResource PhoneFontFamilyNormal}"
|
||||
FontSize="{StaticResource PhoneFontSizeNormal}"
|
||||
Foreground="{StaticResource PhoneForegroundBrush}"
|
||||
SupportedOrientations="Portrait" Orientation="Portrait"
|
||||
shell:SystemTray.IsVisible="True">
|
||||
|
||||
<!--LayoutRoot ist das Stammraster, in dem alle anderen Seiteninhalte platziert werden-->
|
||||
<Grid x:Name="LayoutRoot" Background="Transparent">
|
||||
<!--Pivotsteuerelement-->
|
||||
<Grid.RowDefinitions>
|
||||
<RowDefinition Height="Auto"/>
|
||||
<RowDefinition Height="*"/>
|
||||
</Grid.RowDefinitions>
|
||||
|
||||
<!--TitlePanel enthält den Namen der Anwendung und den Seitentitel-->
|
||||
<StackPanel Grid.Row="0">
|
||||
<header:DefaultHeader
|
||||
Name="DefHeader"
|
||||
HeaderName="{Binding Path=LocalizedResources.Setting_Function, Source={StaticResource LocalizedStrings}}"/>
|
||||
</StackPanel>
|
||||
<phone:Pivot Grid.Row="1" Name="SettingFunctionPivot" SelectionChanged="SettingFunctionPivot_SelectionChanged">
|
||||
<phone:Pivot.HeaderTemplate>
|
||||
<DataTemplate>
|
||||
<Grid Margin="0,-36,0,0">
|
||||
<TextBlock Text="{Binding}"/>
|
||||
</Grid>
|
||||
</DataTemplate>
|
||||
</phone:Pivot.HeaderTemplate>
|
||||
|
||||
<!--Pivotelement eins-->
|
||||
<phone:PivotItem
|
||||
Tag="{Binding Path=Constants.FunctionSetting_Mensa, Source={StaticResource Const}}"
|
||||
Header="{Binding Path=LocalizedResources.MensaApp_Title, Source={StaticResource LocalizedStrings}}">
|
||||
<Grid>
|
||||
<Grid.RowDefinitions>
|
||||
<RowDefinition Height="*"/>
|
||||
<RowDefinition Height="auto"/>
|
||||
</Grid.RowDefinitions>
|
||||
<StackPanel Grid.Row="0">
|
||||
<toolkit:ToggleSwitch
|
||||
Name="AtomMensaToggle"
|
||||
Content="{Binding Path=LocalizedResources.Setting_AtomMensaSelection, Source={StaticResource LocalizedStrings}}"/>
|
||||
<StackPanel >
|
||||
<TextBlock
|
||||
Text="{Binding Path=LocalizedResources.Setting_Mensa, Source={StaticResource LocalizedStrings}}" Style="{StaticResource SettingLabel}"/>
|
||||
<!-- Listpicket of courses -->
|
||||
<toolkit:ListPicker Name="Mensa" ExpansionMode="FullScreenOnly" FullModeHeader="{Binding Path=LocalizedResources.ListPickerHeaderCampus, Source={StaticResource LocalizedStrings}}" >
|
||||
<toolkit:ListPicker.ItemTemplate>
|
||||
<DataTemplate>
|
||||
<StackPanel>
|
||||
<TextBlock Text="{Binding Text}"/>
|
||||
</StackPanel>
|
||||
</DataTemplate>
|
||||
</toolkit:ListPicker.ItemTemplate>
|
||||
<toolkit:ListPicker.FullModeItemTemplate>
|
||||
<DataTemplate>
|
||||
<Border BorderBrush="{StaticResource PhoneAccentBrush}" BorderThickness="12,0,0,0" Margin="0,0,0,6">
|
||||
<TextBlock Text="{Binding Text}" Style="{StaticResource PhoneTextGroupHeaderStyle}" TextWrapping="Wrap"/>
|
||||
</Border>
|
||||
</DataTemplate>
|
||||
</toolkit:ListPicker.FullModeItemTemplate>
|
||||
</toolkit:ListPicker>
|
||||
</StackPanel>
|
||||
</StackPanel>
|
||||
<Grid Grid.Row="1">
|
||||
<Grid.ColumnDefinitions>
|
||||
<ColumnDefinition Width="*"/>
|
||||
<ColumnDefinition Width="auto"/>
|
||||
</Grid.ColumnDefinitions>
|
||||
<TextBlock
|
||||
Grid.Column="0"
|
||||
Text="{Binding Path=LocalizedResources.SettingToDefault, Source={StaticResource LocalizedStrings}}"
|
||||
Style="{StaticResource SettingLabel}"/>
|
||||
<lui:ToDefaultButton
|
||||
Grid.Column="1"
|
||||
SettingType="{Binding Path=Constants.Setting_AppSetting_FunctionSetting_MensaSetting_Enum, Source={StaticResource Const}}" Height="100"/>
|
||||
</Grid>
|
||||
</Grid>
|
||||
</phone:PivotItem>
|
||||
|
||||
<!--Pivotelement zwei-->
|
||||
<phone:PivotItem
|
||||
Tag="{Binding Path=Constants.FunctionSetting_TimeTable, Source={StaticResource Const}}"
|
||||
Header="{Binding Path=LocalizedResources.TimeTableApp_Title, Source={StaticResource LocalizedStrings}}">
|
||||
<Grid>
|
||||
<Grid.RowDefinitions>
|
||||
<RowDefinition Height="*"/>
|
||||
<RowDefinition Height="auto"/>
|
||||
</Grid.RowDefinitions>
|
||||
<Grid Grid.Row="1">
|
||||
<Grid.ColumnDefinitions>
|
||||
<ColumnDefinition Width="*"/>
|
||||
<ColumnDefinition Width="auto"/>
|
||||
</Grid.ColumnDefinitions>
|
||||
<TextBlock
|
||||
Grid.Column="0"
|
||||
Text="{Binding Path=LocalizedResources.SettingToDefault, Source={StaticResource LocalizedStrings}}"
|
||||
Style="{StaticResource SettingLabel}"/>
|
||||
<lui:ToDefaultButton
|
||||
Grid.Column="1"
|
||||
SettingType="{Binding Path=Constants.Setting_AppSetting_FunctionSetting_TimeTableSetting_Enum, Source={StaticResource Const}}" Height="100"/>
|
||||
</Grid>
|
||||
</Grid>
|
||||
</phone:PivotItem>
|
||||
|
||||
<!--Pivotelement drei-->
|
||||
<phone:PivotItem
|
||||
Tag="{Binding Path=Constants.FunctionSetting_Tag, Source={StaticResource Const}}"
|
||||
Header="{Binding Path=LocalizedResources.Setting_Tag, Source={StaticResource LocalizedStrings}}">
|
||||
<Grid>
|
||||
<Grid.RowDefinitions>
|
||||
<RowDefinition Height="*"/>
|
||||
<RowDefinition Height="auto"/>
|
||||
</Grid.RowDefinitions>
|
||||
<StackPanel Grid.Row="0">
|
||||
<StackPanel>
|
||||
<lui:NavigateButton Content="{Binding Path=LocalizedResources.BTUTag_Title, Source={StaticResource LocalizedStrings}}" Url="{Binding Path=Constants.PathBTUTag_Info, Source={StaticResource Const}}" />
|
||||
</StackPanel>
|
||||
<StackPanel>
|
||||
<TextBlock Margin="12,0,0,0" Text="{Binding Path=LocalizedResources.Setting_TagHandler, Source={StaticResource LocalizedStrings}}"/>
|
||||
<toolkit:ListPicker Name="TagHandler" ExpansionMode="FullScreenOnly" FullModeHeader="{Binding Path=LocalizedResources.ListPickerHeaderTag, Source={StaticResource LocalizedStrings}}" >
|
||||
<toolkit:ListPicker.ItemTemplate>
|
||||
<DataTemplate>
|
||||
<StackPanel>
|
||||
<TextBlock Text="{Binding Text}"/>
|
||||
</StackPanel>
|
||||
</DataTemplate>
|
||||
</toolkit:ListPicker.ItemTemplate>
|
||||
<toolkit:ListPicker.FullModeItemTemplate>
|
||||
<DataTemplate>
|
||||
<Border BorderBrush="{StaticResource PhoneAccentBrush}" BorderThickness="12,0,0,0" Margin="0,0,0,6">
|
||||
<TextBlock Text="{Binding Text}" Style="{StaticResource PhoneTextGroupHeaderStyle}" TextWrapping="Wrap"/>
|
||||
</Border>
|
||||
</DataTemplate>
|
||||
</toolkit:ListPicker.FullModeItemTemplate>
|
||||
</toolkit:ListPicker>
|
||||
</StackPanel>
|
||||
</StackPanel>
|
||||
<Grid Grid.Row="1">
|
||||
<Grid.ColumnDefinitions>
|
||||
<ColumnDefinition Width="*"/>
|
||||
<ColumnDefinition Width="auto"/>
|
||||
</Grid.ColumnDefinitions>
|
||||
<TextBlock
|
||||
Grid.Column="0"
|
||||
Text="{Binding Path=LocalizedResources.SettingToDefault, Source={StaticResource LocalizedStrings}}"
|
||||
Style="{StaticResource SettingLabel}"/>
|
||||
<lui:ToDefaultButton
|
||||
Grid.Column="1"
|
||||
SettingType="{Binding Path=Constants.Setting_AppSetting_FunctionSetting_TagSetting_Enum, Source={StaticResource Const}}" Height="100"/>
|
||||
</Grid>
|
||||
</Grid>
|
||||
</phone:PivotItem>
|
||||
</phone:Pivot>
|
||||
</Grid>
|
||||
<phone:PhoneApplicationPage.ApplicationBar>
|
||||
<shell:ApplicationBar IsVisible="True" IsMenuEnabled="False" Mode="Default" Opacity="1.0" >
|
||||
<lui:ResetSettingButtonAppBar Click="ResetSettingButtonAppBar_Click"/>
|
||||
</shell:ApplicationBar>
|
||||
</phone:PhoneApplicationPage.ApplicationBar>
|
||||
</phone:PhoneApplicationPage>
|
||||
|
||||
@@ -0,0 +1,184 @@
|
||||
//-----------------------------------------------------------------------
|
||||
// <copyright file="FunctionSettingPage.xaml.cs" company="BTU/IIT">
|
||||
// The MIT License (MIT). Copyright (c) 2013 BTU/IIT.
|
||||
// </copyright>
|
||||
// <author>Stubbfel</author>
|
||||
// <date>25.11.2013</date>
|
||||
// <summary>Implements the function setting page.xaml class</summary>
|
||||
//-----------------------------------------------------------------------
|
||||
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;
|
||||
|
||||
/// <summary> A function setting page. </summary>
|
||||
/// <remarks> Stubbfel, 25.11.2013. </remarks>
|
||||
/// <seealso cref="T:Microsoft.Phone.Controls.PhoneApplicationPage"/>
|
||||
public partial class FunctionSettingPage : PhoneApplicationPage, IRefreshingPage
|
||||
{
|
||||
#region Member
|
||||
/// <summary> The TagHandler model. </summary>
|
||||
private TagHandlerListPickerItemListModel taghandlerModel;
|
||||
|
||||
/// <summary> List of campus. </summary>
|
||||
private CampusListPickerItemListModel campusList;
|
||||
#endregion
|
||||
|
||||
#region Constructor
|
||||
|
||||
/// <summary> Initializes a new instance of the FunctionSettingPage class. </summary>
|
||||
/// <remarks> Stubbfel, 25.11.2013. </remarks>
|
||||
public FunctionSettingPage()
|
||||
{
|
||||
this.InitializeComponent();
|
||||
this.LoadSettings();
|
||||
}
|
||||
|
||||
#endregion
|
||||
|
||||
#region Methods
|
||||
|
||||
#region public
|
||||
|
||||
/// <summary> Refresh page. </summary>
|
||||
/// <remarks> Stubbfel, 25.11.2013. </remarks>
|
||||
/// <seealso cref="M:CampusAppWP8.Pages.Setting.IRefreshingPage.RefreshPage()"/>
|
||||
public void RefreshPage()
|
||||
{
|
||||
this.LoadSettings();
|
||||
}
|
||||
#endregion
|
||||
|
||||
#region protected
|
||||
|
||||
/// <summary> Override the OnNavigatedTo method. </summary>
|
||||
/// <remarks> Stubbfel, 15.10.2013. </remarks>
|
||||
/// <seealso cref="M:System.Windows.Controls.Page.OnNavigatedTo(NavigationEventArgs)"/>
|
||||
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<string>(Constants.IsolatedStorage_FunctionSettingPageIndex);
|
||||
this.SetSelectedPivotItem(oldIndex);
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary> Override the OnNavigatedFrom method. </summary>
|
||||
/// <remarks> Stubbfel, 15.10.2013. </remarks>
|
||||
/// <seealso cref="M:System.Windows.Controls.Page.OnNavigatedFrom(NavigationEventArgs)"/>
|
||||
protected override void OnNavigatedFrom(NavigationEventArgs e)
|
||||
{
|
||||
base.OnNavigatedFrom(e);
|
||||
this.SaveSettings();
|
||||
|
||||
if (NavigationMode.Back == e.NavigationMode)
|
||||
{
|
||||
App.SaveToIsolatedStorage<string>(Constants.IsolatedStorage_FunctionSettingPageIndex, null);
|
||||
}
|
||||
else
|
||||
{
|
||||
FrameworkElement uiElement = this.SettingFunctionPivot.SelectedItem as FrameworkElement;
|
||||
if (uiElement != null && uiElement.Tag != null)
|
||||
{
|
||||
App.SaveToIsolatedStorage<string>(Constants.IsolatedStorage_FunctionSettingPageIndex, uiElement.Tag.ToString());
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
#endregion
|
||||
|
||||
#region private
|
||||
|
||||
/// <summary> Sets selected pivot item. </summary>
|
||||
/// <remarks> Stubbfel, 25.11.2013. </remarks>
|
||||
/// <param name="itemTag"> The item tag. </param>
|
||||
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;
|
||||
}
|
||||
|
||||
/// <summary> Loads the settings. </summary>
|
||||
/// <remarks> Stubbfel, 25.11.2013. </remarks>
|
||||
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());
|
||||
|
||||
}
|
||||
|
||||
/// <summary> Saves the settings. </summary>
|
||||
/// <remarks> Stubbfel, 25.11.2013. </remarks>
|
||||
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);
|
||||
}
|
||||
|
||||
|
||||
/// <summary>
|
||||
/// Event handler. Called by SettingFunctionPivot for selection changed events.
|
||||
/// </summary>
|
||||
/// <remarks> Stubbfel, 25.11.2013. </remarks>
|
||||
/// <param name="sender"> Source of the event. </param>
|
||||
/// <param name="e"> Selection changed event information. </param>
|
||||
private void SettingFunctionPivot_SelectionChanged(object sender, System.Windows.Controls.SelectionChangedEventArgs e)
|
||||
{
|
||||
this.SaveSettings();
|
||||
}
|
||||
|
||||
/// <summary> Event handler. Called by ResetSettingButtonAppBar for click events. </summary>
|
||||
/// <remarks> Stubbfel, 25.11.2013. </remarks>
|
||||
/// <param name="sender"> Source of the event. </param>
|
||||
/// <param name="e"> Event information. </param>
|
||||
private void ResetSettingButtonAppBar_Click(object sender, EventArgs e)
|
||||
{
|
||||
Settings.AppSetting.FunctionSettings.SetSettingToDefault();
|
||||
this.LoadSettings();
|
||||
}
|
||||
#endregion
|
||||
|
||||
#endregion
|
||||
}
|
||||
}
|
||||
18
CampusAppWP8/CampusAppWP8/Pages/Setting/IRefreshingPage.cs
Normal file
18
CampusAppWP8/CampusAppWP8/Pages/Setting/IRefreshingPage.cs
Normal file
@@ -0,0 +1,18 @@
|
||||
//-----------------------------------------------------------------------
|
||||
// <copyright file="IRefreshingPage.cs" company="BTU/IIT">
|
||||
// The MIT License (MIT). Copyright (c) 2013 BTU/IIT.
|
||||
// </copyright>
|
||||
// <author>Stubbfel</author>
|
||||
// <date>25.11.2013</date>
|
||||
// <summary>Declares the IRefreshingPage interface</summary>
|
||||
//-----------------------------------------------------------------------
|
||||
namespace CampusAppWP8.Pages.Setting
|
||||
{
|
||||
/// <summary> Interface for refreshing page. </summary>
|
||||
/// <remarks> Stubbfel, 25.11.2013. </remarks>
|
||||
public interface IRefreshingPage
|
||||
{
|
||||
/// <summary> Refresh page. </summary>
|
||||
void RefreshPage();
|
||||
}
|
||||
}
|
||||
@@ -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 @@
|
||||
</Grid>
|
||||
</ScrollViewer>
|
||||
</Grid>
|
||||
<phone:PhoneApplicationPage.ApplicationBar>
|
||||
<shell:ApplicationBar IsVisible="True" IsMenuEnabled="False" Mode="Default" Opacity="1.0" >
|
||||
<lui:ResetSettingButtonAppBar Click="ResetSettingButtonAppBar_Click"/>
|
||||
</shell:ApplicationBar>
|
||||
</phone:PhoneApplicationPage.ApplicationBar>
|
||||
</phone:PhoneApplicationPage>
|
||||
@@ -115,6 +115,16 @@ namespace CampusAppWP8.Pages.Setting
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary> Event handler. Called by ResetSettingButtonAppBar for click events. </summary>
|
||||
/// <remarks> Stubbfel, 25.11.2013. </remarks>
|
||||
/// <param name="sender"> Source of the event. </param>
|
||||
/// <param name="e"> Event information. </param>
|
||||
private void ResetSettingButtonAppBar_Click(object sender, EventArgs e)
|
||||
{
|
||||
Settings.UserProfil.SetSettingToDefault();
|
||||
this.LoadListPicker();
|
||||
}
|
||||
|
||||
#endregion
|
||||
|
||||
#endregion
|
||||
|
||||
@@ -308,10 +308,13 @@
|
||||
<ScrollViewer Name="scoller3">
|
||||
<StackPanel Background="{StaticResource PhoneSemitransparentBrush}" VerticalAlignment="Top">
|
||||
<lui:NavigateButton Url="{Binding Path=Constants.PathSetting_User, Source={StaticResource Const}}" BorderThickness="0" HorizontalContentAlignment="Left">
|
||||
<TextBlock Text="{Binding Path=LocalizedResources.Setting_UserProfilAppBarTitle, Source={StaticResource LocalizedStrings}}" HorizontalAlignment="Left" Style="{StaticResource PhoneTextTitle2Style}" />
|
||||
<TextBlock Text="{Binding Path=LocalizedResources.Setting_UserInfo, Source={StaticResource LocalizedStrings}}" HorizontalAlignment="Left" Style="{StaticResource PhoneTextTitle2Style}" />
|
||||
</lui:NavigateButton>
|
||||
<lui:NavigateButton Url="{Binding Path=Constants.PathSetting_App, Source={StaticResource Const}}" BorderThickness="0" HorizontalContentAlignment="Left">
|
||||
<TextBlock Text="{Binding Path=LocalizedResources.Setting_ApplAppBarTitle, Source={StaticResource LocalizedStrings}}" HorizontalAlignment="Left" Style="{StaticResource PhoneTextTitle2Style}" />
|
||||
<TextBlock Text="{Binding Path=LocalizedResources.Setting_General, Source={StaticResource LocalizedStrings}}" HorizontalAlignment="Left" Style="{StaticResource PhoneTextTitle2Style}" />
|
||||
</lui:NavigateButton>
|
||||
<lui:NavigateButton Url="{Binding Path=Constants.PathSetting_App, Source={StaticResource Const}}" BorderThickness="0" HorizontalContentAlignment="Left">
|
||||
<TextBlock Text="{Binding Path=LocalizedResources.Setting_Other, Source={StaticResource LocalizedStrings}}" HorizontalAlignment="Left" Style="{StaticResource PhoneTextTitle2Style}" />
|
||||
</lui:NavigateButton>
|
||||
<lui:NavigateButton Url="{Binding Path=Constants.PathSetting_Impressum, Source={StaticResource Const}}" BorderThickness="0" HorizontalContentAlignment="Left">
|
||||
<TextBlock Text="{Binding Path=LocalizedResources.Setting_ImpressumTitle, Source={StaticResource LocalizedStrings}}" HorizontalAlignment="Left" Style="{StaticResource PhoneTextTitle2Style}" />
|
||||
|
||||
@@ -56,22 +56,16 @@ namespace CampusAppWP8.Pages
|
||||
|
||||
TimeTable.TimeTable.InitFeed();
|
||||
|
||||
|
||||
if (!Settings.AppSetting.InitApp)
|
||||
{
|
||||
this.InitPlaceFile();
|
||||
this.initCourseList = new CourseFeed();
|
||||
this.initCourseList.OnLoaded += new CourseFeed.OnIO(this.StoreCourseFeed);
|
||||
this.initCourseList.LoadData();
|
||||
|
||||
Settings.SetSettingToDefault();
|
||||
this.ShowOptIns();
|
||||
Settings.AppSetting.InitApp = true;
|
||||
|
||||
int appDeploy;
|
||||
bool parseResult = int.TryParse(Constants.DeploymentNumber, out appDeploy);
|
||||
if (parseResult)
|
||||
{
|
||||
Settings.AppSetting.DeploymentNumber = appDeploy;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -149,13 +143,13 @@ namespace CampusAppWP8.Pages
|
||||
|
||||
if (result == MessageBoxResult.OK)
|
||||
{
|
||||
Settings.AppSetting.GeoWatchEnable = true;
|
||||
Settings.AppSetting.LocatingSetting.GeoWatchEnable = true;
|
||||
Thread thread = new Thread(new ThreadStart(this.PositionThread));
|
||||
thread.Start();
|
||||
}
|
||||
else
|
||||
{
|
||||
Settings.AppSetting.GeoWatchEnable = false;
|
||||
Settings.AppSetting.LocatingSetting.GeoWatchEnable = false;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -275,7 +269,7 @@ namespace CampusAppWP8.Pages
|
||||
}
|
||||
else
|
||||
{
|
||||
switch (Settings.AppSetting.TagDefaultHandler)
|
||||
switch (Settings.AppSetting.FunctionSettings.TagSetting.TagDefaultHandler)
|
||||
{
|
||||
case BTUTagDefaultHandler.CampusMap:
|
||||
this.GoToCampusMappage(nfcContent);
|
||||
|
||||
@@ -20,8 +20,8 @@
|
||||
<TemplateCycle>
|
||||
<SmallImageURI IsRelative="true" IsResource="false">Assets\ApplicationIcon.png</SmallImageURI>
|
||||
<Title>BTU CampusApp</Title>
|
||||
<Photo01ImageURI IsRelative="true" IsResource="false">Assets\Slides\Slide1.jpg</Photo01ImageURI>
|
||||
<Photo02ImageURI IsRelative="true" IsResource="false">Assets\Slides\Slide2.jpg</Photo02ImageURI>
|
||||
<Photo01ImageURI IsRelative="true" IsResource="false">Assets\Slides\Slide2.jpg</Photo01ImageURI>
|
||||
<Photo02ImageURI IsRelative="true" IsResource="false">Assets\Slides\Slide1.jpg</Photo02ImageURI>
|
||||
<Photo03ImageURI IsRelative="true" IsResource="false">Assets\Slides\Slide3.jpg</Photo03ImageURI>
|
||||
<Photo04ImageURI IsRelative="true" IsResource="false">Assets\Slides\Slide4.jpg</Photo04ImageURI>
|
||||
<Photo05ImageURI IsRelative="true" IsResource="false">Assets\Slides\Slide5.jpg</Photo05ImageURI>
|
||||
|
||||
@@ -1131,6 +1131,15 @@ namespace CampusAppWP8.Resources {
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Sucht eine lokalisierte Zeichenfolge, die zurück-setzen ähnelt.
|
||||
/// </summary>
|
||||
public static string ResetBtn {
|
||||
get {
|
||||
return ResourceManager.GetString("ResetBtn", resourceCulture);
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Sucht eine lokalisierte Zeichenfolge, die LeftToRight ähnelt.
|
||||
/// </summary>
|
||||
@@ -1212,15 +1221,6 @@ namespace CampusAppWP8.Resources {
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Sucht eine lokalisierte Zeichenfolge, die App-Einstellungen ähnelt.
|
||||
/// </summary>
|
||||
public static string Setting_ApplAppBarTitle {
|
||||
get {
|
||||
return ResourceManager.GetString("Setting_ApplAppBarTitle", resourceCulture);
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Sucht eine lokalisierte Zeichenfolge, die Nur mit Wlan laden ähnelt.
|
||||
/// </summary>
|
||||
@@ -1230,6 +1230,60 @@ namespace CampusAppWP8.Resources {
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Sucht eine lokalisierte Zeichenfolge, die autom. Mensa-Auswahl ähnelt.
|
||||
/// </summary>
|
||||
public static string Setting_AtomMensaSelection {
|
||||
get {
|
||||
return ResourceManager.GetString("Setting_AtomMensaSelection", resourceCulture);
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Sucht eine lokalisierte Zeichenfolge, die Darstellung ähnelt.
|
||||
/// </summary>
|
||||
public static string Setting_Display_Short {
|
||||
get {
|
||||
return ResourceManager.GetString("Setting_Display_Short", resourceCulture);
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Sucht eine lokalisierte Zeichenfolge, die Funktionseinstellungen ähnelt.
|
||||
/// </summary>
|
||||
public static string Setting_Function {
|
||||
get {
|
||||
return ResourceManager.GetString("Setting_Function", resourceCulture);
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Sucht eine lokalisierte Zeichenfolge, die Funktionen ähnelt.
|
||||
/// </summary>
|
||||
public static string Setting_Function_Short {
|
||||
get {
|
||||
return ResourceManager.GetString("Setting_Function_Short", resourceCulture);
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Sucht eine lokalisierte Zeichenfolge, die Allgemeine Einstellungen ähnelt.
|
||||
/// </summary>
|
||||
public static string Setting_General {
|
||||
get {
|
||||
return ResourceManager.GetString("Setting_General", resourceCulture);
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Sucht eine lokalisierte Zeichenfolge, die Ort. & Netz ähnelt.
|
||||
/// </summary>
|
||||
public static string Setting_GeneralNetwork {
|
||||
get {
|
||||
return ResourceManager.GetString("Setting_GeneralNetwork", resourceCulture);
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Sucht eine lokalisierte Zeichenfolge, die Über BTU Campus-App ähnelt.
|
||||
/// </summary>
|
||||
@@ -1239,6 +1293,33 @@ namespace CampusAppWP8.Resources {
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Sucht eine lokalisierte Zeichenfolge, die Mensa ähnelt.
|
||||
/// </summary>
|
||||
public static string Setting_Mensa {
|
||||
get {
|
||||
return ResourceManager.GetString("Setting_Mensa", resourceCulture);
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Sucht eine lokalisierte Zeichenfolge, die Sonstige Einstellungen ähnelt.
|
||||
/// </summary>
|
||||
public static string Setting_Other {
|
||||
get {
|
||||
return ResourceManager.GetString("Setting_Other", resourceCulture);
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Sucht eine lokalisierte Zeichenfolge, die BTU-Tag ähnelt.
|
||||
/// </summary>
|
||||
public static string Setting_Tag {
|
||||
get {
|
||||
return ResourceManager.GetString("Setting_Tag", resourceCulture);
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Sucht eine lokalisierte Zeichenfolge, die BTU-Tag-Standardfunktion ähnelt.
|
||||
/// </summary>
|
||||
@@ -1312,11 +1393,11 @@ namespace CampusAppWP8.Resources {
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Sucht eine lokalisierte Zeichenfolge, die Profileinstellungen ähnelt.
|
||||
/// Sucht eine lokalisierte Zeichenfolge, die Persönliche Einstellungen ähnelt.
|
||||
/// </summary>
|
||||
public static string Setting_UserProfilAppBarTitle {
|
||||
public static string Setting_UserInfo {
|
||||
get {
|
||||
return ResourceManager.GetString("Setting_UserProfilAppBarTitle", resourceCulture);
|
||||
return ResourceManager.GetString("Setting_UserInfo", resourceCulture);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1338,6 +1419,15 @@ namespace CampusAppWP8.Resources {
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Sucht eine lokalisierte Zeichenfolge, die Einstellung zurücksetzen ähnelt.
|
||||
/// </summary>
|
||||
public static string SettingToDefault {
|
||||
get {
|
||||
return ResourceManager.GetString("SettingToDefault", resourceCulture);
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Sucht eine lokalisierte Zeichenfolge, die klein ähnelt.
|
||||
/// </summary>
|
||||
|
||||
@@ -293,8 +293,8 @@
|
||||
<data name="Setting_UserDegree" xml:space="preserve">
|
||||
<value>Abschluss</value>
|
||||
</data>
|
||||
<data name="Setting_UserProfilAppBarTitle" xml:space="preserve">
|
||||
<value>Profileinstellungen</value>
|
||||
<data name="Setting_UserInfo" xml:space="preserve">
|
||||
<value>Persönliche Einstellungen</value>
|
||||
</data>
|
||||
<data name="Setting_UserRole" xml:space="preserve">
|
||||
<value>Rolle</value>
|
||||
@@ -332,8 +332,8 @@
|
||||
<data name="Setting_AppGeoWatch" xml:space="preserve">
|
||||
<value>Ortung</value>
|
||||
</data>
|
||||
<data name="Setting_ApplAppBarTitle" xml:space="preserve">
|
||||
<value>App-Einstellungen</value>
|
||||
<data name="Setting_General" xml:space="preserve">
|
||||
<value>Allgemeine Einstellungen</value>
|
||||
</data>
|
||||
<data name="MsgBox_ErrorCampusLoc" xml:space="preserve">
|
||||
<value>Der aktuelle Campus konnte nicht ermittelt werden. Es wird der im Profil festgelegten Campus verwendet.</value>
|
||||
@@ -632,4 +632,34 @@
|
||||
<data name="Rooms" xml:space="preserve">
|
||||
<value>Räume</value>
|
||||
</data>
|
||||
<data name="Setting_AtomMensaSelection" xml:space="preserve">
|
||||
<value>autom. Mensa-Auswahl</value>
|
||||
</data>
|
||||
<data name="Setting_Function" xml:space="preserve">
|
||||
<value>Funktionseinstellungen</value>
|
||||
</data>
|
||||
<data name="Setting_GeneralNetwork" xml:space="preserve">
|
||||
<value>Ort. & Netz</value>
|
||||
</data>
|
||||
<data name="Setting_Other" xml:space="preserve">
|
||||
<value>Sonstige Einstellungen</value>
|
||||
</data>
|
||||
<data name="Setting_Tag" xml:space="preserve">
|
||||
<value>BTU-Tag</value>
|
||||
</data>
|
||||
<data name="ResetBtn" xml:space="preserve">
|
||||
<value>zurück-setzen</value>
|
||||
</data>
|
||||
<data name="SettingToDefault" xml:space="preserve">
|
||||
<value>Einstellung zurücksetzen</value>
|
||||
</data>
|
||||
<data name="Setting_Display_Short" xml:space="preserve">
|
||||
<value>Darstellung</value>
|
||||
</data>
|
||||
<data name="Setting_Function_Short" xml:space="preserve">
|
||||
<value>Funktionen</value>
|
||||
</data>
|
||||
<data name="Setting_Mensa" xml:space="preserve">
|
||||
<value>Mensa</value>
|
||||
</data>
|
||||
</root>
|
||||
@@ -274,7 +274,7 @@
|
||||
<value>767</value>
|
||||
</data>
|
||||
<data name="Setting_DefaultSemester" xml:space="preserve">
|
||||
<value>20131</value>
|
||||
<value>20132</value>
|
||||
</data>
|
||||
<data name="Valid_FirstSemseter" xml:space="preserve">
|
||||
<value>20121</value>
|
||||
@@ -624,4 +624,58 @@
|
||||
<data name="PathSetting_Impressum" xml:space="preserve">
|
||||
<value>/Pages/Setting/Impressum.xaml</value>
|
||||
</data>
|
||||
<data name="AppSetting_MensaSetting_AtomMensaSelection" xml:space="preserve">
|
||||
<value>AtomMensaSelection</value>
|
||||
</data>
|
||||
<data name="FunctionSetting_Mensa" xml:space="preserve">
|
||||
<value>Mensafunction</value>
|
||||
</data>
|
||||
<data name="FunctionSetting_Tag" xml:space="preserve">
|
||||
<value>Tagfunction</value>
|
||||
</data>
|
||||
<data name="FunctionSetting_TimeTable" xml:space="preserve">
|
||||
<value>TimeTablefunction</value>
|
||||
</data>
|
||||
<data name="IsolatedStorage_FunctionSettingPageIndex" xml:space="preserve">
|
||||
<value>FunctionSettingPageIndex</value>
|
||||
</data>
|
||||
<data name="IsolatedStorage_GeneralSettingPageIndex" xml:space="preserve">
|
||||
<value>GeneralSettingPageIndex</value>
|
||||
</data>
|
||||
<data name="Param_FunctionSetting_Index" xml:space="preserve">
|
||||
<value>FunctionSettingIndex</value>
|
||||
</data>
|
||||
<data name="PathSetting_Function" xml:space="preserve">
|
||||
<value>/Pages/Setting/FunctionSettingPage.xaml</value>
|
||||
</data>
|
||||
<data name="Settingt_UserSetting_Enum" xml:space="preserve">
|
||||
<value>UserSetting</value>
|
||||
</data>
|
||||
<data name="Setting_AppSetting_Enum" xml:space="preserve">
|
||||
<value>AppSetting</value>
|
||||
</data>
|
||||
<data name="Setting_AppSetting_LocatingSetting_Enum" xml:space="preserve">
|
||||
<value>Appsetting_Locatingsetting</value>
|
||||
</data>
|
||||
<data name="Setting_AppSetting_NetworkSetting_Enum" xml:space="preserve">
|
||||
<value>Appsetting_Networksetting</value>
|
||||
</data>
|
||||
<data name="Setting_AppSetting_FunctionSetting_Enum" xml:space="preserve">
|
||||
<value>Appsetting_Functionsetting</value>
|
||||
</data>
|
||||
<data name="Setting_AppSetting_FunctionSetting_MensaSetting_Enum" xml:space="preserve">
|
||||
<value>Appsetting_Functionsetting_Mensasetting</value>
|
||||
</data>
|
||||
<data name="Setting_AppSetting_FunctionSetting_TagSetting_Enum" xml:space="preserve">
|
||||
<value>Appsetting_Functionsetting_Tagsetting</value>
|
||||
</data>
|
||||
<data name="Setting_AppSetting_FunctionSetting_TimeTableSetting_Enum" xml:space="preserve">
|
||||
<value>Appsetting_Functionsetting_TimeTablesetting</value>
|
||||
</data>
|
||||
<data name="Setting_Enum" xml:space="preserve">
|
||||
<value>Setting</value>
|
||||
</data>
|
||||
<data name="Setting_Mensa_DefaultCampus" xml:space="preserve">
|
||||
<value>MensaDefaultCampus</value>
|
||||
</data>
|
||||
</root>
|
||||
@@ -150,6 +150,15 @@ namespace CampusAppWP8.Resources {
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Sucht eine lokalisierte Zeichenfolge, die AtomMensaSelection ähnelt.
|
||||
/// </summary>
|
||||
public static string AppSetting_MensaSetting_AtomMensaSelection {
|
||||
get {
|
||||
return ResourceManager.GetString("AppSetting_MensaSetting_AtomMensaSelection", resourceCulture);
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Sucht eine lokalisierte Zeichenfolge, die OnlyWifi ähnelt.
|
||||
/// </summary>
|
||||
@@ -438,6 +447,33 @@ namespace CampusAppWP8.Resources {
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Sucht eine lokalisierte Zeichenfolge, die Mensafunction ähnelt.
|
||||
/// </summary>
|
||||
public static string FunctionSetting_Mensa {
|
||||
get {
|
||||
return ResourceManager.GetString("FunctionSetting_Mensa", resourceCulture);
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Sucht eine lokalisierte Zeichenfolge, die Tagfunction ähnelt.
|
||||
/// </summary>
|
||||
public static string FunctionSetting_Tag {
|
||||
get {
|
||||
return ResourceManager.GetString("FunctionSetting_Tag", resourceCulture);
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Sucht eine lokalisierte Zeichenfolge, die TimeTablefunction ähnelt.
|
||||
/// </summary>
|
||||
public static string FunctionSetting_TimeTable {
|
||||
get {
|
||||
return ResourceManager.GetString("FunctionSetting_TimeTable", resourceCulture);
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Sucht eine lokalisierte Zeichenfolge, die CurrentPositionPoint ähnelt.
|
||||
/// </summary>
|
||||
@@ -492,6 +528,24 @@ namespace CampusAppWP8.Resources {
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Sucht eine lokalisierte Zeichenfolge, die FunctionSettingPageIndex ähnelt.
|
||||
/// </summary>
|
||||
public static string IsolatedStorage_FunctionSettingPageIndex {
|
||||
get {
|
||||
return ResourceManager.GetString("IsolatedStorage_FunctionSettingPageIndex", resourceCulture);
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Sucht eine lokalisierte Zeichenfolge, die GeneralSettingPageIndex ähnelt.
|
||||
/// </summary>
|
||||
public static string IsolatedStorage_GeneralSettingPageIndex {
|
||||
get {
|
||||
return ResourceManager.GetString("IsolatedStorage_GeneralSettingPageIndex", resourceCulture);
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Sucht eine lokalisierte Zeichenfolge, die LectureAppointment ähnelt.
|
||||
/// </summary>
|
||||
@@ -645,6 +699,15 @@ namespace CampusAppWP8.Resources {
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Sucht eine lokalisierte Zeichenfolge, die FunctionSettingIndex ähnelt.
|
||||
/// </summary>
|
||||
public static string Param_FunctionSetting_Index {
|
||||
get {
|
||||
return ResourceManager.GetString("Param_FunctionSetting_Index", resourceCulture);
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Sucht eine lokalisierte Zeichenfolge, die BuildingId ähnelt.
|
||||
/// </summary>
|
||||
@@ -1050,6 +1113,15 @@ namespace CampusAppWP8.Resources {
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Sucht eine lokalisierte Zeichenfolge, die /Pages/Setting/FunctionSettingPage.xaml ähnelt.
|
||||
/// </summary>
|
||||
public static string PathSetting_Function {
|
||||
get {
|
||||
return ResourceManager.GetString("PathSetting_Function", resourceCulture);
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Sucht eine lokalisierte Zeichenfolge, die /Pages/Setting/Impressum.xaml ähnelt.
|
||||
/// </summary>
|
||||
@@ -1311,6 +1383,69 @@ namespace CampusAppWP8.Resources {
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Sucht eine lokalisierte Zeichenfolge, die AppSetting ähnelt.
|
||||
/// </summary>
|
||||
public static string Setting_AppSetting_Enum {
|
||||
get {
|
||||
return ResourceManager.GetString("Setting_AppSetting_Enum", resourceCulture);
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Sucht eine lokalisierte Zeichenfolge, die Appsetting_Functionsetting ähnelt.
|
||||
/// </summary>
|
||||
public static string Setting_AppSetting_FunctionSetting_Enum {
|
||||
get {
|
||||
return ResourceManager.GetString("Setting_AppSetting_FunctionSetting_Enum", resourceCulture);
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Sucht eine lokalisierte Zeichenfolge, die Appsetting_Functionsetting_Mensasetting ähnelt.
|
||||
/// </summary>
|
||||
public static string Setting_AppSetting_FunctionSetting_MensaSetting_Enum {
|
||||
get {
|
||||
return ResourceManager.GetString("Setting_AppSetting_FunctionSetting_MensaSetting_Enum", resourceCulture);
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Sucht eine lokalisierte Zeichenfolge, die Appsetting_Functionsetting_Tagsetting ähnelt.
|
||||
/// </summary>
|
||||
public static string Setting_AppSetting_FunctionSetting_TagSetting_Enum {
|
||||
get {
|
||||
return ResourceManager.GetString("Setting_AppSetting_FunctionSetting_TagSetting_Enum", resourceCulture);
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Sucht eine lokalisierte Zeichenfolge, die Appsetting_Functionsetting_TimeTablesetting ähnelt.
|
||||
/// </summary>
|
||||
public static string Setting_AppSetting_FunctionSetting_TimeTableSetting_Enum {
|
||||
get {
|
||||
return ResourceManager.GetString("Setting_AppSetting_FunctionSetting_TimeTableSetting_Enum", resourceCulture);
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Sucht eine lokalisierte Zeichenfolge, die Appsetting_Locatingsetting ähnelt.
|
||||
/// </summary>
|
||||
public static string Setting_AppSetting_LocatingSetting_Enum {
|
||||
get {
|
||||
return ResourceManager.GetString("Setting_AppSetting_LocatingSetting_Enum", resourceCulture);
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Sucht eine lokalisierte Zeichenfolge, die Appsetting_Networksetting ähnelt.
|
||||
/// </summary>
|
||||
public static string Setting_AppSetting_NetworkSetting_Enum {
|
||||
get {
|
||||
return ResourceManager.GetString("Setting_AppSetting_NetworkSetting_Enum", resourceCulture);
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Sucht eine lokalisierte Zeichenfolge, die 767 ähnelt.
|
||||
/// </summary>
|
||||
@@ -1321,7 +1456,7 @@ namespace CampusAppWP8.Resources {
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Sucht eine lokalisierte Zeichenfolge, die 20131 ähnelt.
|
||||
/// Sucht eine lokalisierte Zeichenfolge, die 20132 ähnelt.
|
||||
/// </summary>
|
||||
public static string Setting_DefaultSemester {
|
||||
get {
|
||||
@@ -1329,6 +1464,33 @@ namespace CampusAppWP8.Resources {
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Sucht eine lokalisierte Zeichenfolge, die Setting ähnelt.
|
||||
/// </summary>
|
||||
public static string Setting_Enum {
|
||||
get {
|
||||
return ResourceManager.GetString("Setting_Enum", resourceCulture);
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Sucht eine lokalisierte Zeichenfolge, die MensaDefaultCampus ähnelt.
|
||||
/// </summary>
|
||||
public static string Setting_Mensa_DefaultCampus {
|
||||
get {
|
||||
return ResourceManager.GetString("Setting_Mensa_DefaultCampus", resourceCulture);
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Sucht eine lokalisierte Zeichenfolge, die UserSetting ähnelt.
|
||||
/// </summary>
|
||||
public static string Settingt_UserSetting_Enum {
|
||||
get {
|
||||
return ResourceManager.GetString("Settingt_UserSetting_Enum", resourceCulture);
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Sucht eine lokalisierte Zeichenfolge, die 1 ähnelt.
|
||||
/// </summary>
|
||||
|
||||
@@ -1,39 +1,36 @@
|
||||
//-----------------------------------------------------------------------
|
||||
// <copyright file="Settings.cs" company="BTU/IIT">
|
||||
// Company copyright tag.
|
||||
// The MIT License (MIT). Copyright (c) 2013 BTU/IIT.
|
||||
// </copyright>
|
||||
// <author>stubbfel</author>
|
||||
// <sience>23.07.2013</sience>
|
||||
//----------------------------------------------------------------------
|
||||
|
||||
// <author>Stubbfel</author>
|
||||
// <date>25.11.2013</date>
|
||||
// <summary>Implements the settings class</summary>
|
||||
//-----------------------------------------------------------------------
|
||||
namespace CampusAppWP8
|
||||
{
|
||||
using System;
|
||||
using CampusAppWP8.Model.Setting;
|
||||
using CampusAppWP8.Resources;
|
||||
|
||||
/// <summary>
|
||||
/// Class handle all setting (files)
|
||||
/// </summary>
|
||||
/// <summary> Class handle all setting (files) </summary>
|
||||
/// <remarks> Stubbfel, 25.11.2013. </remarks>
|
||||
/// <seealso cref="T:CampusAppWP8.Model.Setting.ISetting"/>
|
||||
public static class Settings
|
||||
{
|
||||
#region Member
|
||||
|
||||
/// <summary>
|
||||
/// reference of the user-profile-file
|
||||
/// </summary>
|
||||
/// <summary> reference of the user-profile-file. </summary>
|
||||
private static UserProfilModel userProfil = new UserProfilModel();
|
||||
|
||||
/// <summary>
|
||||
/// reference of the appSettings
|
||||
/// </summary>
|
||||
/// <summary> reference of the appSettings. </summary>
|
||||
private static AppSettings appSetting = new AppSettings();
|
||||
|
||||
#endregion
|
||||
|
||||
#region Property
|
||||
|
||||
/// <summary>
|
||||
/// Gets or sets the user-profile-file
|
||||
/// </summary>
|
||||
/// <summary> Gets or sets the user-profile-file. </summary>
|
||||
/// <value> The user profile. </value>
|
||||
public static UserProfilModel UserProfil
|
||||
{
|
||||
get
|
||||
@@ -50,9 +47,8 @@ namespace CampusAppWP8
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Gets or sets the AppSetting
|
||||
/// </summary>
|
||||
/// <summary> Gets or sets the AppSetting. </summary>
|
||||
/// <value> The application setting. </value>
|
||||
public static AppSettings AppSetting
|
||||
{
|
||||
get
|
||||
@@ -70,5 +66,65 @@ namespace CampusAppWP8
|
||||
}
|
||||
|
||||
#endregion
|
||||
|
||||
#region method
|
||||
|
||||
/// <summary> Sets setting to default. </summary>
|
||||
/// <remarks> Stubbfel, 25.11.2013. </remarks>
|
||||
public static void SetSettingToDefault()
|
||||
{
|
||||
Settings.AppSetting.SetSettingToDefault();
|
||||
Settings.UserProfil.SetSettingToDefault();
|
||||
}
|
||||
|
||||
/// <summary> Sets setting to default. </summary>
|
||||
/// <remarks> Stubbfel, 25.11.2013. </remarks>
|
||||
/// <param name="settingKey"> The setting key. </param>
|
||||
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
|
||||
}
|
||||
}
|
||||
|
||||
13
CampusAppWP8/CampusAppWP8/Styles/Labels.xaml
Normal file
13
CampusAppWP8/CampusAppWP8/Styles/Labels.xaml
Normal file
@@ -0,0 +1,13 @@
|
||||
<ResourceDictionary xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
|
||||
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
|
||||
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
|
||||
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
|
||||
xmlns:toolkit="clr-namespace:Microsoft.Phone.Controls;assembly=Microsoft.Phone.Controls.Toolkit"
|
||||
mc:Ignorable="d">
|
||||
<Style x:Key="SettingLabel" TargetType="TextBlock">
|
||||
<Setter Property="FontWeight" Value="Light"/>
|
||||
<Setter Property="FontSize" Value="32"/>
|
||||
<Setter Property="Margin" Value="12,0,0,0"/>
|
||||
<Setter Property="VerticalAlignment" Value="Center" />
|
||||
</Style>
|
||||
</ResourceDictionary>
|
||||
@@ -0,0 +1,43 @@
|
||||
//-----------------------------------------------------------------------
|
||||
// <copyright file="UpdateButtonAppBar.cs" company="BTU/IIT">
|
||||
// The MIT License (MIT). Copyright (c) 2013 BTU/IIT.
|
||||
// </copyright>
|
||||
// <author>Stubbfel</author>
|
||||
// <date>15.10.2013</date>
|
||||
// <summary>Implements the update button application bar class</summary>
|
||||
//-----------------------------------------------------------------------
|
||||
namespace CampusAppWP8.Utility.Lui.Button
|
||||
{
|
||||
using System;
|
||||
using CampusAppWP8.Resources;
|
||||
using Microsoft.Phone.Shell;
|
||||
|
||||
/// <summary> This class create an Button which start the Email-Client. </summary>
|
||||
/// <remarks> Stubbfel, 15.10.2013. </remarks>
|
||||
/// <seealso cref="T:Microsoft.Phone.Shell.ApplicationBarIconButton"/>
|
||||
public class ResetSettingButtonAppBar : ApplicationBarIconButton
|
||||
{
|
||||
#region Members
|
||||
|
||||
/// <summary> IconUri of the Button. </summary>
|
||||
private static Uri iconUri = new Uri(Icons.Link, UriKind.Relative);
|
||||
|
||||
/// <summary> Text of the Button. </summary>
|
||||
private static string text = AppResources.ResetBtn;
|
||||
|
||||
#endregion
|
||||
|
||||
#region Constructors
|
||||
|
||||
/// <summary> Initializes a new instance of the <see cref="UpdateButtonAppBar" /> class. </summary>
|
||||
/// <remarks> Stubbfel, 15.10.2013. </remarks>
|
||||
public ResetSettingButtonAppBar()
|
||||
: base()
|
||||
{
|
||||
this.IconUri = ResetSettingButtonAppBar.iconUri;
|
||||
this.Text = ResetSettingButtonAppBar.text;
|
||||
}
|
||||
|
||||
#endregion
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,80 @@
|
||||
//-----------------------------------------------------------------------
|
||||
// <copyright file="ToDefaultButton.cs" company="BTU/IIT">
|
||||
// The MIT License (MIT). Copyright (c) 2013 BTU/IIT.
|
||||
// </copyright>
|
||||
// <author>Stubbfel</author>
|
||||
// <date>25.11.2013</date>
|
||||
// <summary>Implements to default button class</summary>
|
||||
//-----------------------------------------------------------------------
|
||||
namespace CampusAppWP8.Utility.Lui.Button
|
||||
{
|
||||
using System;
|
||||
using System.Windows;
|
||||
using System.Windows.Controls;
|
||||
using System.Windows.Media.Imaging;
|
||||
using CampusAppWP8.Pages.Setting;
|
||||
using CampusAppWP8.Resources;
|
||||
|
||||
|
||||
/// <summary> Add person button. </summary>
|
||||
/// <remarks> Stubbfel, 12.09.2013. </remarks>
|
||||
/// <seealso cref="T:System.Windows.Controls.Button"/>
|
||||
public class ToDefaultButton : System.Windows.Controls.Button
|
||||
{
|
||||
#region Member
|
||||
|
||||
/// <summary> The person identifier property. </summary>
|
||||
public static readonly DependencyProperty SettingTypeProperty = DependencyProperty.Register("SettingType", typeof(object), typeof(ToDefaultButton), new PropertyMetadata(false));
|
||||
|
||||
/// <summary> The icon. </summary>
|
||||
private static BitmapImage icon = new BitmapImage(new Uri(Icons.Link, UriKind.Relative));
|
||||
|
||||
#endregion
|
||||
|
||||
#region Constructor
|
||||
|
||||
/// <summary> Initializes a new instance of the ToDefaultButton class. </summary>
|
||||
/// <remarks> Stubbfel, 25.11.2013. </remarks>
|
||||
public ToDefaultButton()
|
||||
: base()
|
||||
{
|
||||
this.Content = new Image
|
||||
{
|
||||
Source = icon
|
||||
};
|
||||
}
|
||||
|
||||
#endregion
|
||||
|
||||
#region Property
|
||||
|
||||
/// <summary> Gets or sets the type of the setting. </summary>
|
||||
/// <value> The type of the setting. </value>
|
||||
public object SettingType
|
||||
{
|
||||
get { return (object)this.GetValue(SettingTypeProperty); }
|
||||
set { this.SetValue(SettingTypeProperty, value); }
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Löst das <see cref="E:System.Windows.Controls.Primitives.ButtonBase.Click" />-Ereignis
|
||||
/// aus.
|
||||
/// </summary>
|
||||
/// <remarks> Stubbfel, 25.11.2013. </remarks>
|
||||
/// <seealso cref="M:System.Windows.Controls.Button.OnClick()"/>
|
||||
protected override void OnClick()
|
||||
{
|
||||
if (this.SettingType != null)
|
||||
{
|
||||
Settings.SetSettingToDefault(this.SettingType.ToString());
|
||||
Page page = App.RootFrame.Content as Page;
|
||||
if (typeof(IRefreshingPage).IsInstanceOfType(page))
|
||||
{
|
||||
((IRefreshingPage)page).RefreshPage();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
#endregion
|
||||
}
|
||||
}
|
||||
@@ -169,7 +169,7 @@ namespace CampusAppWP8.Utility.Lui.Tiles
|
||||
{
|
||||
string path;
|
||||
string name = "NFC -> ";
|
||||
switch (Settings.AppSetting.TagDefaultHandler)
|
||||
switch (Settings.AppSetting.FunctionSettings.TagSetting.TagDefaultHandler)
|
||||
{
|
||||
case BTUTagDefaultHandler.CampusMap:
|
||||
path = Constants.PathCampusmap_Campusmap;
|
||||
|
||||
@@ -230,7 +230,7 @@ namespace CampusAppWP8.Utility
|
||||
/// <returns> the position of the phone. </returns>
|
||||
public static GeoPosition<GeoCoordinate> DetermineCurrentPosition(GeoPositionAccuracy accuracy = GeoPositionAccuracy.High)
|
||||
{
|
||||
if (!Settings.AppSetting.GeoWatchEnable)
|
||||
if (!Settings.AppSetting.LocatingSetting.GeoWatchEnable)
|
||||
{
|
||||
return null;
|
||||
}
|
||||
@@ -351,7 +351,7 @@ namespace CampusAppWP8.Utility
|
||||
/// <returns> The load modus< t> </returns>
|
||||
public static ForceType GetLoadModus<T>()
|
||||
{
|
||||
if (Settings.AppSetting.OnlyWifi && !Settings.AppSetting.WifiEnable)
|
||||
if (Settings.AppSetting.NetworkSetting.OnlyWifi && !Settings.AppSetting.NetworkSetting.WifiEnable)
|
||||
{
|
||||
return ForceType.FORCE_FILE;
|
||||
}
|
||||
@@ -381,8 +381,6 @@ namespace CampusAppWP8.Utility
|
||||
public static Campus DetermineCampus(GeoPositionAccuracy accuracy = GeoPositionAccuracy.Default)
|
||||
{
|
||||
Campus result = Campus.UserSettingCampus;
|
||||
|
||||
|
||||
Utilities.DetermineAndStoreCurrentPosition(accuracy);
|
||||
|
||||
MapPoint currentPoint = App.LoadFromAppState<GeoMapPoint>("CurrentGeoPoint");
|
||||
@@ -390,7 +388,6 @@ namespace CampusAppWP8.Utility
|
||||
{
|
||||
if (accuracy.Equals(GeoPositionAccuracy.High))
|
||||
{
|
||||
|
||||
return result;
|
||||
}
|
||||
else
|
||||
@@ -448,7 +445,6 @@ namespace CampusAppWP8.Utility
|
||||
obj.SelectedIndex = -1;
|
||||
}
|
||||
}
|
||||
|
||||
#endregion
|
||||
}
|
||||
}
|
||||
@@ -21,10 +21,11 @@ namespace CampusAppWPortalLib8.Model.Utility
|
||||
/// Initializes a new instance of the <see cref="CampusListPickerItemListModel" /> class.
|
||||
/// </summary>
|
||||
/// <remarks> Stubbfel, 15.10.2013. </remarks>
|
||||
public CampusListPickerItemListModel()
|
||||
/// <param name="userSettings"> (Optional) the user settings. </param>
|
||||
public CampusListPickerItemListModel(bool userSettings = false)
|
||||
: base()
|
||||
{
|
||||
this.LoadList();
|
||||
this.LoadList(userSettings);
|
||||
}
|
||||
|
||||
#endregion
|
||||
@@ -33,9 +34,15 @@ namespace CampusAppWPortalLib8.Model.Utility
|
||||
|
||||
/// <summary> Overrides the LoadList-Method <see cref="ListPickerItemListModel"/> </summary>
|
||||
/// <remarks> Stubbfel, 15.10.2013. </remarks>
|
||||
/// <param name="userSettings"> (Optional) the user settings. </param>
|
||||
/// <seealso cref="M:CampusAppWPortalLib8.Model.Utility.ListPickerItemListModel.LoadList()"/>
|
||||
protected override void LoadList()
|
||||
protected void LoadList(bool userSettings = false)
|
||||
{
|
||||
if (userSettings)
|
||||
{
|
||||
this.AddItem(new ListPickerItemModel(((int)CampusAppWPortalLib8.Model.Settings.Campus.UserSettingCampus).ToString(), AppResources.Campus_UserSetting);
|
||||
}
|
||||
|
||||
this.AddItem(new ListPickerItemModel(((int)CampusAppWPortalLib8.Model.Settings.Campus.CB_MAIN).ToString(), AppResources.Campus_CBMain));
|
||||
this.AddItem(new ListPickerItemModel(((int)CampusAppWPortalLib8.Model.Settings.Campus.CB_NORTH).ToString(), AppResources.Campus_CBNorth));
|
||||
this.AddItem(new ListPickerItemModel(((int)CampusAppWPortalLib8.Model.Settings.Campus.CB_SOUTH).ToString(), AppResources.Campus_CBSouth));
|
||||
|
||||
@@ -97,6 +97,15 @@ namespace CampusAppWPortalLib8.Resources {
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Sucht eine lokalisierte Zeichenfolge, die wie in Profileinstellungen ähnelt.
|
||||
/// </summary>
|
||||
public static string Campus_UserSetting {
|
||||
get {
|
||||
return ResourceManager.GetString("Campus_UserSetting", resourceCulture);
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Sucht eine lokalisierte Zeichenfolge, die Bachelor ähnelt.
|
||||
/// </summary>
|
||||
|
||||
@@ -129,6 +129,9 @@
|
||||
<data name="Campus_SFBMain" xml:space="preserve">
|
||||
<value>Senftenberg</value>
|
||||
</data>
|
||||
<data name="Campus_UserSetting" xml:space="preserve">
|
||||
<value>wie in Profileinstellungen</value>
|
||||
</data>
|
||||
<data name="Degree_Bachelor" xml:space="preserve">
|
||||
<value>Bachelor</value>
|
||||
</data>
|
||||
|
||||
Reference in New Issue
Block a user