Merge branch 'feature/#155' into develop

This commit is contained in:
stubbfel
2013-11-27 11:14:57 +01:00
23 changed files with 717 additions and 128 deletions

View File

@@ -13,6 +13,7 @@
<ResourceDictionary Source="Styles/ListButton.xaml"/>
<ResourceDictionary Source="Styles/StartPageStyles.xaml"/>
<ResourceDictionary Source="Styles/Labels.xaml"/>
<ResourceDictionary Source="Styles/UniColors.xaml"/>
<ResourceDictionary>
<local:LocalizedStrings xmlns:local="clr-namespace:CampusAppWP8" x:Key="LocalizedStrings"/>
<local:ThemelizedIcons xmlns:local="clr-namespace:CampusAppWP8" x:Key="ThemelizedIcons"/>

View File

@@ -10,6 +10,7 @@ using System.IO.IsolatedStorage;
using System.Threading;
using System.Windows;
using System.Windows.Markup;
using System.Windows.Media;
using System.Windows.Navigation;
@@ -157,6 +158,19 @@ namespace CampusAppWP8
Settings.AppSetting.InitApp = false;
}
Color appColor = ((SolidColorBrush)App.Current.Resources["PhoneAccentBrush"]).Color;
if (!Settings.AppSetting.DisplaySetting.PhoneAccentColor.Equals(appColor))
{
if (Settings.AppSetting.DisplaySetting.AppAccentColor.Equals(Settings.AppSetting.DisplaySetting.PhoneAccentColor))
{
Settings.AppSetting.DisplaySetting.AppAccentColor = appColor;
}
Settings.AppSetting.DisplaySetting.PhoneAccentColor = appColor;
}
appColor = Settings.AppSetting.DisplaySetting.AppAccentColor;
Utilities.SwitchAccentColor(appColor);
this.UserSettingsLoaded();
Settings.AppSetting.NetworkSetting.UniNetwork = Utilities.IsUniNetworkAvailable();

View File

@@ -134,6 +134,7 @@
<Compile Include="Model\Setting\AppSettings.cs" />
<Compile Include="Model\Setting\BTUTagHandlerTypes.cs" />
<Compile Include="Model\Setting\BTUTagSetting.cs" />
<Compile Include="Model\Setting\DisplaySetting.cs" />
<Compile Include="Model\Setting\FunctionSettings.cs" />
<Compile Include="Model\Setting\ISetting.cs" />
<Compile Include="Model\Setting\LocatingSetting.cs" />
@@ -144,6 +145,8 @@
<Compile Include="Model\Setting\UserProfilModel.cs" />
<Compile Include="Model\TimeTable\AppointmentListModel.cs" />
<Compile Include="Model\TimeTable\AppointmentModel.cs" />
<Compile Include="Model\Utility\AppAccentColorListPickerItemListModel.cs" />
<Compile Include="Model\Utility\ColorListPickerItemModel.cs" />
<Compile Include="Pages\Setting\FunctionSettingPage.xaml.cs">
<DependentUpon>FunctionSettingPage.xaml</DependentUpon>
</Compile>
@@ -542,6 +545,10 @@
<Generator>MSBuild:Compile</Generator>
<SubType>Designer</SubType>
</Page>
<Page Include="Styles\UniColors.xaml">
<Generator>MSBuild:Compile</Generator>
<SubType>Designer</SubType>
</Page>
<Page Include="Styles\Labels.xaml">
<Generator>MSBuild:Compile</Generator>
<SubType>Designer</SubType>

View File

@@ -26,10 +26,30 @@ namespace CampusAppWP8.Model.Setting
/// <summary> The locating setting. </summary>
private static LocatingSetting locatingSetting = new LocatingSetting();
private static DisplaySetting displaySetting = new DisplaySetting();
#endregion
#region Property
/// <summary> Gets or sets the display setting. </summary>
/// <value> The display setting. </value>
public DisplaySetting DisplaySetting
{
get
{
return AppSettings.displaySetting;
}
set
{
if (AppSettings.displaySetting != value)
{
AppSettings.displaySetting = value;
}
}
}
/// <summary> Gets or sets the locating setting. </summary>
/// <value> The locating setting. </value>
public LocatingSetting LocatingSetting
@@ -150,6 +170,7 @@ namespace CampusAppWP8.Model.Setting
this.FunctionSettings.SetSettingToDefault();
this.NetworkSetting.SetSettingToDefault();
this.LocatingSetting.SetSettingToDefault();
this.DisplaySetting.SetSettingToDefault();
}
#endregion
}

View File

@@ -0,0 +1,64 @@
using CampusAppWP8.Resources;
//-----------------------------------------------------------------------
// <copyright file="DisplaySetting.cs" company="BTU/IIT">
// The MIT License (MIT). Copyright (c) 2013 BTU/IIT.
// </copyright>
// <author>Stubbfel</author>
// <date>26.11.2013</date>
// <summary>Implements the display setting class</summary>
//-----------------------------------------------------------------------
using System.Windows.Media;
namespace CampusAppWP8.Model.Setting
{
/// <summary> A display setting. </summary>
/// <remarks> Stubbfel, 26.11.2013. </remarks>
/// <seealso cref="T:CampusAppWP8.Model.Setting.ISetting"/>
public class DisplaySetting : ISetting
{
#region property
/// <summary> Gets or sets the color of the application accent. </summary>
/// <value> The color of the application accent. </value>
public Color AppAccentColor
{
get
{
return App.LoadFromAppState<Color>(Constants.Setting_AppAccentColor);
}
set
{
App.SaveToAppState<Color>(Constants.Setting_AppAccentColor, value);
}
}
/// <summary> Gets or sets the color of the phone accent. </summary>
/// <value> The color of the phone accent. </value>
public Color PhoneAccentColor
{
get
{
return App.LoadFromAppState<Color>(Constants.Setting_PhoneAccentColor);
}
set
{
App.SaveToAppState<Color>(Constants.Setting_PhoneAccentColor, 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.AppAccentColor = this.PhoneAccentColor;
}
#endregion
}
}

View File

@@ -0,0 +1,91 @@
//-----------------------------------------------------------------------
// <copyright file="AppAccentColorListPickerItemListModel.cs" company="BTU/IIT">
// The MIT License (MIT). Copyright (c) 2013 BTU/IIT.
// </copyright>
// <author>Stubbfel</author>
// <date>26.11.2013</date>
// <summary>Implements the application accent color list picker item list model class</summary>
//-----------------------------------------------------------------------
namespace CampusAppWP8.Model.Utility
{
using System.Windows.Media;
using CampusAppWP8.Resources;
/// <summary> A data Model for the application accent color list picker item list. </summary>
/// <remarks> Stubbfel, 26.11.2013. </remarks>
/// <seealso cref="T:CampusAppWPortalLib8.Model.Utility.ListPickerItemListTemplateModel{System.Windows.Media.Color}"/>
public class AppAccentColorListPickerItemListModel : CampusAppWPortalLib8.Model.Utility.ListPickerItemListTemplateModel<SolidColorBrush>
{
#region member
/// <summary> The faculty 1 color. </summary>
private static readonly SolidColorBrush Faculty1Color = (SolidColorBrush)App.Current.Resources[Constants.Brush_Faculty1];
/// <summary> The faculty 2 color. </summary>
private static readonly SolidColorBrush Faculty2Color = (SolidColorBrush)App.Current.Resources[Constants.Brush_Faculty2];
/// <summary> The faculty 3 color. </summary>
private static readonly SolidColorBrush Faculty3Color = (SolidColorBrush)App.Current.Resources[Constants.Brush_Faculty3];
/// <summary> The faculty 4 color. </summary>
private static readonly SolidColorBrush Faculty4Color = (SolidColorBrush)App.Current.Resources[Constants.Brush_Faculty4];
/// <summary> The faculty 5 color. </summary>
private static readonly SolidColorBrush Faculty5Color = (SolidColorBrush)App.Current.Resources[Constants.Brush_Faculty5];
/// <summary> The faculty. </summary>
private readonly string faculty = CampusAppWPortalLib8.Resources.AppResources.Faculty;
#endregion
#region Constructor
/// <summary>
/// Initializes a new instance of the AppAccentColorListPickerItemListModel class.
/// </summary>
/// <remarks> Stubbfel, 26.11.2013. </remarks>
public AppAccentColorListPickerItemListModel()
: base()
{
this.LoadList();
}
#endregion
#region Method
/// <summary> Gets index or default. </summary>
/// <remarks> Stubbfel, 27.11.2013. </remarks>
/// <param name="value"> The value. </param>
/// <returns> The index or default. </returns>
public override int GetIndexOrDefault(SolidColorBrush value)
{
int index = 0;
foreach (ColorListPickerItemModel brush in this.List)
{
if (brush.Value.Color.Equals(value.Color))
{
break;
}
index++;
}
return index;
}
/// <summary> Loads the list. </summary>
/// <remarks> Stubbfel, 26.11.2013. </remarks>
protected override void LoadList()
{
this.AddItem(new ColorListPickerItemModel(new SolidColorBrush(Settings.AppSetting.DisplaySetting.PhoneAccentColor), CampusAppWP8.Resources.AppResources.AccentColor));
this.AddItem(new ColorListPickerItemModel(AppAccentColorListPickerItemListModel.Faculty1Color, this.faculty + " 1"));
this.AddItem(new ColorListPickerItemModel(AppAccentColorListPickerItemListModel.Faculty2Color, this.faculty + " 2"));
this.AddItem(new ColorListPickerItemModel(AppAccentColorListPickerItemListModel.Faculty3Color, this.faculty + " 3"));
this.AddItem(new ColorListPickerItemModel(AppAccentColorListPickerItemListModel.Faculty4Color, this.faculty + " 4"));
this.AddItem(new ColorListPickerItemModel(AppAccentColorListPickerItemListModel.Faculty5Color, this.faculty + " 5"));
}
#endregion
}
}

View File

@@ -0,0 +1,34 @@
//-----------------------------------------------------------------------
// <copyright file="ColorListPickerItemModel.cs" company="BTU/IIT">
// The MIT License (MIT). Copyright (c) 2013 BTU/IIT.
// </copyright>
// <author>Stubbfel</author>
// <date>26.11.2013</date>
// <summary>Implements the color list picker item model class</summary>
//-----------------------------------------------------------------------
namespace CampusAppWP8.Model.Utility
{
using System.Windows.Media;
/// <summary> A data Model for the color list picker item. </summary>
/// <remarks> Stubbfel, 26.11.2013. </remarks>
/// <seealso cref="T:CampusAppWPortalLib8.Model.Utility.ListPickerItemTemplateModel{System.Windows.Media.Color}"/>
public class ColorListPickerItemModel : CampusAppWPortalLib8.Model.Utility.ListPickerItemTemplateModel<SolidColorBrush>
{
/// <summary> Initializes a new instance of the ColorListPickerItemModel class. </summary>
/// <remarks> Stubbfel, 26.11.2013. </remarks>
public ColorListPickerItemModel()
: base()
{
}
/// <summary> Initializes a new instance of the ColorListPickerItemModel class. </summary>
/// <remarks> Stubbfel, 26.11.2013. </remarks>
/// <param name="value"> The value. </param>
/// <param name="text"> The text. </param>
public ColorListPickerItemModel(SolidColorBrush value, string text)
: base(value, text)
{
}
}
}

View File

@@ -69,7 +69,29 @@
</phone:PivotItem>
<phone:PivotItem
Header="{Binding Path=LocalizedResources.Setting_Display_Short, Source={StaticResource LocalizedStrings}}">
<StackPanel >
<TextBlock
Text="{Binding Path=LocalizedResources.AccentColor, Source={StaticResource LocalizedStrings}}" Style="{StaticResource SettingLabel}"/>
<!-- Listpicket of courses -->
<toolkit:ListPicker Name="AccentColorPicker" FullModeHeader="{Binding Path=LocalizedResources.AccentColorPicker, Source={StaticResource LocalizedStrings}}" VerticalAlignment="Center" SelectionChanged="AccentColorPicker_SelectionChanged">
<toolkit:ListPicker.ItemTemplate>
<DataTemplate>
<StackPanel Orientation="Horizontal">
<Rectangle Fill="{Binding Value}" Height="24" Width="24" Stroke="Black"/>
<TextBlock Text="{Binding Text}" Margin="12,0,0,0"/>
</StackPanel>
</DataTemplate>
</toolkit:ListPicker.ItemTemplate>
<toolkit:ListPicker.FullModeItemTemplate>
<DataTemplate>
<StackPanel Orientation="Horizontal" Margin="0,12,0,0">
<Rectangle Fill="{Binding Value}" Height="48" Width="48" Stroke="Black"/>
<TextBlock Text="{Binding Text}" Style="{StaticResource PhoneTextGroupHeaderStyle}" TextWrapping="Wrap" Margin="24,0,0,0"/>
</StackPanel>
</DataTemplate>
</toolkit:ListPicker.FullModeItemTemplate>
</toolkit:ListPicker>
</StackPanel>
</phone:PivotItem>
<phone:PivotItem

View File

@@ -9,15 +9,26 @@
namespace CampusAppWP8.Pages.Setting
{
using System;
using System.Windows.Media;
using System.Windows.Navigation;
using CampusAppWP8.Model.Utility;
using CampusAppWP8.Resources;
using CampusAppWP8.Utility;
using Microsoft.Phone.Controls;
/// <summary> Class for the AppSettingPage. </summary>
/// <remarks> Stubbfel, 15.10.2013. </remarks>
/// <seealso cref="T:Microsoft.Phone.Controls.PhoneApplicationPage"/>
/// <seealso cref="T:CampusAppWP8.Pages.Setting.IRefreshingPage"/>
public partial class AppSettingPage : PhoneApplicationPage, IRefreshingPage
{
#region member
/// <summary> List of colors of the application accents. </summary>
private readonly AppAccentColorListPickerItemListModel appAccentColors = new AppAccentColorListPickerItemListModel();
#endregion
#region Constructor
/// <summary> Initializes a new instance of the <see cref="AppSettingPage" /> class. </summary>
@@ -25,6 +36,7 @@ namespace CampusAppWP8.Pages.Setting
public AppSettingPage()
{
this.InitializeComponent();
this.AccentColorPicker.ItemsSource = this.appAccentColors.List;
this.LoadSettings();
}
@@ -44,6 +56,7 @@ namespace CampusAppWP8.Pages.Setting
#endregion
#region protected
/// <summary> Override the OnNavigatedTo method. </summary>
/// <remarks> Stubbfel, 15.10.2013. </remarks>
/// <seealso cref="M:System.Windows.Controls.Page.OnNavigatedTo(NavigationEventArgs)"/>
@@ -78,12 +91,14 @@ namespace CampusAppWP8.Pages.Setting
#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;
this.AccentColorPicker.SelectedIndex = this.appAccentColors.GetIndexOrDefault(new SolidColorBrush(Settings.AppSetting.DisplaySetting.AppAccentColor));
}
/// <summary> Saves the settings. </summary>
@@ -104,6 +119,21 @@ namespace CampusAppWP8.Pages.Setting
this.LoadSettings();
}
/// <summary> Event handler. Called by AccentColorPicker for selection changed events. </summary>
/// <remarks> Stubbfel, 26.11.2013. </remarks>
/// <param name="sender"> Source of the event. </param>
/// <param name="e"> Selection changed event information. </param>
private void AccentColorPicker_SelectionChanged(object sender, System.Windows.Controls.SelectionChangedEventArgs e)
{
if (e.AddedItems.Count == 1 && e.RemovedItems.Count == 1)
{
int selectedIndex = this.AccentColorPicker.SelectedIndex;
Color newColor = this.appAccentColors.List[selectedIndex].Value.Color;
Utilities.SwitchAccentColor(newColor);
Settings.AppSetting.DisplaySetting.AppAccentColor = newColor;
}
}
#endregion
#endregion

View File

@@ -27,6 +27,7 @@ namespace CampusAppWP8.Pages
using Microsoft.Phone.Controls;
using Microsoft.Phone.Shell;
using Windows.Networking.Proximity;
using System.Windows.Media;
/// <summary> Class for the StartPage. </summary>
/// <remarks> Stubbfel, 15.10.2013. </remarks>
@@ -75,7 +76,7 @@ namespace CampusAppWP8.Pages
#region protected
/// <summary> Methods overrides the OnNavigatedTo-Method. </summary>
/// <summary> Methods overrides 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)
@@ -84,7 +85,7 @@ namespace CampusAppWP8.Pages
if (device != null)
{
this.ndefId = this.device.SubscribeForMessage(Constants.NCFMessageType_NDEF, this.NDEFHandler);
}
}
}
/// <summary> Methods overrides the OnNavigatedFrom-Method. </summary>
@@ -123,7 +124,7 @@ namespace CampusAppWP8.Pages
/// <remarks> Stubbfel, 15.10.2013. </remarks>
/// <param name="sender"> Caller of the function. </param>
/// <param name="e"> some EventArgs. </param>
private void NFCButton_Click(object sender,RoutedEventArgs e)
private void NFCButton_Click(object sender, RoutedEventArgs e)
{
MessageBoxes.ShowMainModelInfoMessageBox(AppResources.ScarNfc_Search);
}

View File

@@ -60,6 +60,24 @@ namespace CampusAppWP8.Resources {
}
}
/// <summary>
/// Sucht eine lokalisierte Zeichenfolge, die Akzentfarbe ähnelt.
/// </summary>
public static string AccentColor {
get {
return ResourceManager.GetString("AccentColor", resourceCulture);
}
}
/// <summary>
/// Sucht eine lokalisierte Zeichenfolge, die Akzentfarbe-Auswahl ähnelt.
/// </summary>
public static string AccentColorPicker {
get {
return ResourceManager.GetString("AccentColorPicker", resourceCulture);
}
}
/// <summary>
/// Sucht eine lokalisierte Zeichenfolge, die Hinzufügen ähnelt.
/// </summary>

View File

@@ -662,4 +662,10 @@
<data name="Setting_Mensa" xml:space="preserve">
<value>Mensa</value>
</data>
<data name="AccentColor" xml:space="preserve">
<value>Akzentfarbe</value>
</data>
<data name="AccentColorPicker" xml:space="preserve">
<value>Akzentfarbe-Auswahl</value>
</data>
</root>

View File

@@ -678,4 +678,46 @@
<data name="Setting_Mensa_DefaultCampus" xml:space="preserve">
<value>MensaDefaultCampus</value>
</data>
<data name="Setting_AppAccentColor" xml:space="preserve">
<value>AppAccentColor</value>
</data>
<data name="Setting_PhoneAccentColor" xml:space="preserve">
<value>PhoneAccentColor</value>
</data>
<data name="Brush_Faculty1" xml:space="preserve">
<value>FacultyBrush1</value>
</data>
<data name="Brush_Faculty2" xml:space="preserve">
<value>FacultyBrush2</value>
</data>
<data name="Brush_Faculty3" xml:space="preserve">
<value>FacultyBrush3</value>
</data>
<data name="Brush_Faculty4" xml:space="preserve">
<value>FacultyBrush4</value>
</data>
<data name="Brush_Faculty5" xml:space="preserve">
<value>FacultyBrush5</value>
</data>
<data name="Brush_PhoneAccent" xml:space="preserve">
<value>PhoneAccentBrush</value>
</data>
<data name="Color_Faculty1" xml:space="preserve">
<value>FacultyColor1</value>
</data>
<data name="Color_Faculty2" xml:space="preserve">
<value>FacultyColor2</value>
</data>
<data name="Color_Faculty3" xml:space="preserve">
<value>FacultyColor3</value>
</data>
<data name="Color_Faculty4" xml:space="preserve">
<value>FacultyColor4</value>
</data>
<data name="Color_Faculty5" xml:space="preserve">
<value>FacultyColor5</value>
</data>
<data name="Color_PhoneAccent" xml:space="preserve">
<value>PhoneAccentColor</value>
</data>
</root>

View File

@@ -204,6 +204,60 @@ namespace CampusAppWP8.Resources {
}
}
/// <summary>
/// Sucht eine lokalisierte Zeichenfolge, die FacultyBrush1 ähnelt.
/// </summary>
public static string Brush_Faculty1 {
get {
return ResourceManager.GetString("Brush_Faculty1", resourceCulture);
}
}
/// <summary>
/// Sucht eine lokalisierte Zeichenfolge, die FacultyBrush2 ähnelt.
/// </summary>
public static string Brush_Faculty2 {
get {
return ResourceManager.GetString("Brush_Faculty2", resourceCulture);
}
}
/// <summary>
/// Sucht eine lokalisierte Zeichenfolge, die FacultyBrush3 ähnelt.
/// </summary>
public static string Brush_Faculty3 {
get {
return ResourceManager.GetString("Brush_Faculty3", resourceCulture);
}
}
/// <summary>
/// Sucht eine lokalisierte Zeichenfolge, die FacultyBrush4 ähnelt.
/// </summary>
public static string Brush_Faculty4 {
get {
return ResourceManager.GetString("Brush_Faculty4", resourceCulture);
}
}
/// <summary>
/// Sucht eine lokalisierte Zeichenfolge, die FacultyBrush5 ähnelt.
/// </summary>
public static string Brush_Faculty5 {
get {
return ResourceManager.GetString("Brush_Faculty5", resourceCulture);
}
}
/// <summary>
/// Sucht eine lokalisierte Zeichenfolge, die PhoneAccentBrush ähnelt.
/// </summary>
public static string Brush_PhoneAccent {
get {
return ResourceManager.GetString("Brush_PhoneAccent", resourceCulture);
}
}
/// <summary>
/// Sucht eine lokalisierte Zeichenfolge, die BTU-CampusApp ähnelt.
/// </summary>
@@ -222,6 +276,60 @@ namespace CampusAppWP8.Resources {
}
}
/// <summary>
/// Sucht eine lokalisierte Zeichenfolge, die FacultyColor1 ähnelt.
/// </summary>
public static string Color_Faculty1 {
get {
return ResourceManager.GetString("Color_Faculty1", resourceCulture);
}
}
/// <summary>
/// Sucht eine lokalisierte Zeichenfolge, die FacultyColor2 ähnelt.
/// </summary>
public static string Color_Faculty2 {
get {
return ResourceManager.GetString("Color_Faculty2", resourceCulture);
}
}
/// <summary>
/// Sucht eine lokalisierte Zeichenfolge, die FacultyColor3 ähnelt.
/// </summary>
public static string Color_Faculty3 {
get {
return ResourceManager.GetString("Color_Faculty3", resourceCulture);
}
}
/// <summary>
/// Sucht eine lokalisierte Zeichenfolge, die FacultyColor4 ähnelt.
/// </summary>
public static string Color_Faculty4 {
get {
return ResourceManager.GetString("Color_Faculty4", resourceCulture);
}
}
/// <summary>
/// Sucht eine lokalisierte Zeichenfolge, die FacultyColor5 ähnelt.
/// </summary>
public static string Color_Faculty5 {
get {
return ResourceManager.GetString("Color_Faculty5", resourceCulture);
}
}
/// <summary>
/// Sucht eine lokalisierte Zeichenfolge, die PhoneAccentColor ähnelt.
/// </summary>
public static string Color_PhoneAccent {
get {
return ResourceManager.GetString("Color_PhoneAccent", resourceCulture);
}
}
/// <summary>
/// Sucht eine lokalisierte Zeichenfolge, die 8 ähnelt.
/// </summary>
@@ -1383,6 +1491,15 @@ namespace CampusAppWP8.Resources {
}
}
/// <summary>
/// Sucht eine lokalisierte Zeichenfolge, die AppAccentColor ähnelt.
/// </summary>
public static string Setting_AppAccentColor {
get {
return ResourceManager.GetString("Setting_AppAccentColor", resourceCulture);
}
}
/// <summary>
/// Sucht eine lokalisierte Zeichenfolge, die AppSetting ähnelt.
/// </summary>
@@ -1482,6 +1599,15 @@ namespace CampusAppWP8.Resources {
}
}
/// <summary>
/// Sucht eine lokalisierte Zeichenfolge, die PhoneAccentColor ähnelt.
/// </summary>
public static string Setting_PhoneAccentColor {
get {
return ResourceManager.GetString("Setting_PhoneAccentColor", resourceCulture);
}
}
/// <summary>
/// Sucht eine lokalisierte Zeichenfolge, die UserSetting ähnelt.
/// </summary>

View File

@@ -0,0 +1,16 @@
<ResourceDictionary
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:System="clr-namespace:System;assembly=mscorlib">
<Color x:Key="FacultyColor1">#d20078</Color>
<Color x:Key="FacultyColor2">#0050a0</Color>
<Color x:Key="FacultyColor3">#009bd2</Color>
<Color x:Key="FacultyColor4">#a5c300</Color>
<Color x:Key="FacultyColor5">#ff9900</Color>
<SolidColorBrush x:Key="FacultyBrush1">#d20078</SolidColorBrush>
<SolidColorBrush x:Key="FacultyBrush2">#0050a0</SolidColorBrush>
<SolidColorBrush x:Key="FacultyBrush3">#009bd2</SolidColorBrush>
<SolidColorBrush x:Key="FacultyBrush4">#a5c300</SolidColorBrush>
<SolidColorBrush x:Key="FacultyBrush5">#ff9900</SolidColorBrush>
</ResourceDictionary>

View File

@@ -445,6 +445,31 @@ namespace CampusAppWP8.Utility
obj.SelectedIndex = -1;
}
}
/// <summary> Switch color. </summary>
/// <remarks> Stubbfel, 26.11.2013. </remarks>
/// <param name="ressourceKey"> The ressource key. </param>
/// <param name="newColor"> The new color. </param>
public static void SwitchColor(string ressourceKey, Color newColor)
{
SolidColorBrush oldColor = App.Current.Resources[ressourceKey] as SolidColorBrush;
if (oldColor == null || oldColor.Color.Equals(newColor))
{
return;
}
App.Current.Resources.Remove(ressourceKey);
App.Current.Resources.Add(ressourceKey, newColor);
}
/// <summary> Switch accent color. </summary>
/// <remarks> Stubbfel, 26.11.2013. </remarks>
/// <param name="newColor"> The new color. </param>
public static void SwitchAccentColor(Color newColor)
{
Utilities.SwitchColor(Constants.Color_PhoneAccent, newColor);
((SolidColorBrush)App.Current.Resources[Constants.Brush_PhoneAccent]).Color = newColor;
}
#endregion
}
}

View File

@@ -91,7 +91,9 @@
<Compile Include="Model\Utility\DegreeListPickerItemListModel.cs" />
<Compile Include="Model\Utility\GeoMapPoint.cs" />
<Compile Include="Model\Utility\ListPickerItemListModel.cs" />
<Compile Include="Model\Utility\ListPickerItemListTemplateModel.cs" />
<Compile Include="Model\Utility\ListPickerItemModel.cs" />
<Compile Include="Model\Utility\ListPickerItemTemplateModel.cs" />
<Compile Include="Model\Utility\MapPoint.cs" />
<Compile Include="Model\Utility\RoleListPickerItemListModel.cs" />
<Compile Include="Model\Utility\SemesterListPickerItemListModel.cs">

View File

@@ -70,6 +70,10 @@ namespace CampusAppWPortalLib8.Model.Mensa
/// <returns> The canteen. </returns>
public PriceCanteenModel GetCanteen(Campus campus)
{
if (campus == Campus.CB_NORTH)
{
return this.GetCanteen((int)Campus.CB_MAIN - 1);
}
return this.GetCanteen((int)campus - 1);
}
}

View File

@@ -40,7 +40,7 @@ namespace CampusAppWPortalLib8.Model.Utility
{
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.UserSettingCampus).ToString(), AppResources.Campus_UserSetting));
}
this.AddItem(new ListPickerItemModel(((int)CampusAppWPortalLib8.Model.Settings.Campus.CB_MAIN).ToString(), AppResources.Campus_CBMain));

View File

@@ -12,15 +12,8 @@ namespace CampusAppWPortalLib8.Model.Utility
/// <summary> Class for a List of ListPickerItems. </summary>
/// <remarks> Stubbfel, 15.10.2013. </remarks>
public class ListPickerItemListModel
public class ListPickerItemListModel : ListPickerItemListTemplateModel<string>
{
#region Members
/// <summary> reference of the itemList. </summary>
private List<ListPickerItemModel> list;
#endregion
#region Constructor
/// <summary>
@@ -28,109 +21,10 @@ namespace CampusAppWPortalLib8.Model.Utility
/// </summary>
/// <remarks> Stubbfel, 15.10.2013. </remarks>
public ListPickerItemListModel()
: base()
{
this.list = new List<ListPickerItemModel>();
}
#endregion
#region Property
/// <summary> Gets or sets the ItemList. </summary>
/// <value> The list. </value>
public List<ListPickerItemModel> List
{
get
{
return this.list;
}
set
{
if (value != this.list)
{
this.list = value;
}
}
}
#endregion
#region Method
#region public
/// <summary> Method return a the Index of an item which has a certain value. </summary>
/// <remarks> Stubbfel, 15.10.2013. </remarks>
/// <param name="value"> a certain value. </param>
/// <returns> return index of value or default(0) </returns>
public virtual int GetIndexOrDefault(string value)
{
int index = 0;
int i = 0;
foreach (ListPickerItemModel item in this.list)
{
if (item.Value.Equals(value))
{
index = i;
break;
}
i++;
}
return index;
}
/// <summary> add an new item to the list. </summary>
/// <remarks> Stubbfel, 15.10.2013. </remarks>
/// <param name="value"> value of the item. </param>
/// <param name="text"> text of the item. </param>
public void AddItem(string value, string text)
{
this.AddItem(new ListPickerItemModel(value, text));
}
/// <summary> add an new item to the list. </summary>
/// <remarks> Stubbfel, 15.10.2013. </remarks>
/// <param name="item"> new item of the list. </param>
public void AddItem(ListPickerItemModel item)
{
this.list.Add(item);
}
/// <summary> remove an item. </summary>
/// <remarks> Stubbfel, 15.10.2013. </remarks>
/// <param name="value"> value of the item. </param>
/// <param name="text"> text of the item. </param>
/// <returns> true if removing was successful, otherwise false. </returns>
public bool RemoveItem(string value, string text)
{
return this.RemoveItem(new ListPickerItemModel(value, text));
}
/// <summary> remove an item. </summary>
/// <remarks> Stubbfel, 15.10.2013. </remarks>
/// <param name="item"> item which has to be remove. </param>
/// <returns> true if removing was successful, otherwise false. </returns>
public bool RemoveItem(ListPickerItemModel item)
{
return this.list.Remove(item);
}
#endregion
#region protected
/// <summary> Method load an default list. </summary>
/// <remarks> load an empty list. </remarks>
protected virtual void LoadList()
{
return;
}
#endregion
#endregion
}
}

View File

@@ -0,0 +1,135 @@
//-----------------------------------------------------------------------
// <copyright file="ListPickerItemListTemplateModel.cs" company="BTU/IIT">
// The MIT License (MIT). Copyright (c) 2013 BTU/IIT.
// </copyright>
// <author>Stubbfel</author>
// <date>26.11.2013</date>
// <summary>Implements the list picker item list template model class</summary>
//-----------------------------------------------------------------------
namespace CampusAppWPortalLib8.Model.Utility
{
using System.Collections.Generic;
/// <summary> A data Model for the list picker item list template. </summary>
/// <remarks> Stubbfel, 26.11.2013. </remarks>
/// <typeparam name="T"> Generic type parameter. </typeparam>
public class ListPickerItemListTemplateModel<T>
{
#region Members
/// <summary> reference of the itemList. </summary>
private List<ListPickerItemTemplateModel<T>> list;
#endregion
#region Constructor
/// <summary> Initializes a new instance of the ListPickerItemListTemplateModel class. </summary>
/// <remarks> Stubbfel, 26.11.2013. </remarks>
public ListPickerItemListTemplateModel()
{
this.list = new List<ListPickerItemTemplateModel<T>>();
}
#endregion
#region Property
/// <summary> Gets or sets the ItemList. </summary>
/// <value> The list. </value>
public List<ListPickerItemTemplateModel<T>> List
{
get
{
return this.list;
}
set
{
if (value != this.list)
{
this.list = value;
}
}
}
#endregion
#region Method
#region public
/// <summary> Method return a the Index of an item which has a certain value. </summary>
/// <remarks> Stubbfel, 15.10.2013. </remarks>
/// <param name="value"> a certain value. </param>
/// <returns> return index of value or default(0) </returns>
public virtual int GetIndexOrDefault(T value)
{
int index = 0;
int i = 0;
foreach (ListPickerItemTemplateModel<T> item in this.list)
{
if (item.Value.Equals(value))
{
index = i;
break;
}
i++;
}
return index;
}
/// <summary> add an new item to the list. </summary>
/// <remarks> Stubbfel, 15.10.2013. </remarks>
/// <param name="value"> value of the item. </param>
/// <param name="text"> text of the item. </param>
public void AddItem(T value, string text)
{
this.AddItem(new ListPickerItemTemplateModel<T>(value, text));
}
/// <summary> add an new item to the list. </summary>
/// <remarks> Stubbfel, 15.10.2013. </remarks>
/// <param name="item"> new item of the list. </param>
public void AddItem(ListPickerItemTemplateModel<T> item)
{
this.list.Add(item);
}
/// <summary> remove an item. </summary>
/// <remarks> Stubbfel, 15.10.2013. </remarks>
/// <param name="value"> value of the item. </param>
/// <param name="text"> text of the item. </param>
/// <returns> true if removing was successful, otherwise false. </returns>
public bool RemoveItem(T value, string text)
{
return this.RemoveItem(new ListPickerItemTemplateModel<T>(value, text));
}
/// <summary> remove an item. </summary>
/// <remarks> Stubbfel, 15.10.2013. </remarks>
/// <param name="item"> item which has to be remove. </param>
/// <returns> true if removing was successful, otherwise false. </returns>
public bool RemoveItem(ListPickerItemTemplateModel<T> item)
{
return this.list.Remove(item);
}
#endregion
#region protected
/// <summary> Method load an default list. </summary>
/// <remarks> load an empty list. </remarks>
protected virtual void LoadList()
{
return;
}
#endregion
#endregion
}
}

View File

@@ -10,7 +10,7 @@ namespace CampusAppWPortalLib8.Model.Utility
{
/// <summary> Model for the ListPickerItems. </summary>
/// <remarks> Stubbfel, 15.10.2013. </remarks>
public class ListPickerItemModel
public class ListPickerItemModel : ListPickerItemTemplateModel<string>
{
#region Constructor
@@ -19,6 +19,7 @@ namespace CampusAppWPortalLib8.Model.Utility
/// </summary>
/// <remarks> Stubbfel, 15.10.2013. </remarks>
public ListPickerItemModel()
: base()
{
}
@@ -29,23 +30,10 @@ namespace CampusAppWPortalLib8.Model.Utility
/// <param name="value"> string for the value property of an item. </param>
/// <param name="text"> string for the text property of an item. </param>
public ListPickerItemModel(string value, string text)
: base(value, text)
{
this.Value = value;
this.Text = text;
}
#endregion
#region Property
/// <summary> Gets or sets the Value of an Item. </summary>
/// <value> The value. </value>
public string Value { get; set; }
/// <summary> Gets or sets the Text (caption) of an Item. </summary>
/// <value> The text. </value>
public string Text { get; set; }
#endregion
}
}

View File

@@ -0,0 +1,48 @@
//-----------------------------------------------------------------------
// <copyright file="ListPickerItemTemplateModel.cs" company="BTU/IIT">
// The MIT License (MIT). Copyright (c) 2013 BTU/IIT.
// </copyright>
// <author>Stubbfel</author>
// <date>26.11.2013</date>
// <summary>Implements the list picker item template model class</summary>
//-----------------------------------------------------------------------
namespace CampusAppWPortalLib8.Model.Utility
{
/// <summary> A data Model for the list picker item template. </summary>
/// <remarks> Stubbfel, 26.11.2013. </remarks>
/// <typeparam name="V"> Generic type parameter. </typeparam>
public class ListPickerItemTemplateModel<V>
{
#region Constructor
/// <summary> Initializes a new instance of the ListPickerItemTemplateModel class. </summary>
/// <remarks> Stubbfel, 26.11.2013. </remarks>
public ListPickerItemTemplateModel()
{
}
/// <summary> Initializes a new instance of the ListPickerItemTemplateModel class. </summary>
/// <remarks> Stubbfel, 26.11.2013. </remarks>
/// <param name="value"> The value. </param>
/// <param name="text"> The text. </param>
public ListPickerItemTemplateModel(V value, string text)
{
this.Value = value;
this.Text = text;
}
#endregion
#region Property
/// <summary> Gets or sets the Value of an Item. </summary>
/// <value> The value. </value>
public V Value { get; set; }
/// <summary> Gets or sets the Text (caption) of an Item. </summary>
/// <value> The text. </value>
public string Text { get; set; }
#endregion
}
}