Merge branch 'feature/#281' into develop

This commit is contained in:
stubbfel
2013-11-18 17:10:45 +01:00
9 changed files with 76 additions and 50 deletions

View File

@@ -14,20 +14,6 @@ namespace CampusAppWP8.Model.Setting
/// <remarks> Stubbfel, 15.10.2013. </remarks>
public class AppSettings
{
#region Enum
/// <summary> Values that represent BTUTagDefaultHandler. </summary>
/// <remarks> Stubbfel, 15.10.2013. </remarks>
public enum BTUTagDefaultHandler
{
/// <summary> An enum constant representing the information page option. </summary>
InfoPage = 0,
/// <summary> An enum constant representing the campus map option. </summary>
CampusMap = 1
}
#endregion
#region Property
/// <summary> Gets or sets a value indicating whether the GeoWatch-Flag. </summary>

View File

@@ -16,6 +16,9 @@ namespace CampusAppWP8.Model.Setting
InfoPage = 0,
/// <summary> An enum constant representing the campus map option. </summary>
CampusMap = 1
CampusMap = 1,
/// <summary> An enum constant representing the date creation option. </summary>
DateCreation = 2
}
}

View File

@@ -37,8 +37,9 @@ namespace CampusAppWP8.Model.Setting
/// <seealso cref="M:CampusAppWPortalLib8.Model.Utility.ListPickerItemListModel.LoadList()"/>
protected override void LoadList()
{
this.AddItem(new ListPickerItemModel(AppSettings.BTUTagDefaultHandler.InfoPage.ToString(), AppResources.Setting_TagHandlerInfo));
this.AddItem(new ListPickerItemModel(AppSettings.BTUTagDefaultHandler.CampusMap.ToString(), AppResources.Setting_TagHandlerMap));
this.AddItem(new ListPickerItemModel(BTUTagDefaultHandler.InfoPage.ToString(), AppResources.Setting_TagHandlerInfo));
this.AddItem(new ListPickerItemModel(BTUTagDefaultHandler.CampusMap.ToString(), AppResources.Setting_TagHandlerMap));
this.AddItem(new ListPickerItemModel(BTUTagDefaultHandler.DateCreation.ToString(), AppResources.Setting_TagHandlerDate));
}
#endregion

View File

@@ -48,7 +48,7 @@ namespace CampusAppWP8.Pages.BTTTag
{
if (NavigationMode.Back == e.NavigationMode)
{
Settings.AppSetting.TagDefaultHandler = (CampusAppWP8.Model.Setting.AppSettings.BTUTagDefaultHandler)Enum.Parse(typeof(CampusAppWP8.Model.Setting.AppSettings.BTUTagDefaultHandler), ((CampusAppWPortalLib8.Model.Utility.ListPickerItemModel)this.TagHandler.SelectedItem).Value);
Settings.AppSetting.TagDefaultHandler = (CampusAppWP8.Model.Setting.BTUTagDefaultHandler)Enum.Parse(typeof(CampusAppWP8.Model.Setting.BTUTagDefaultHandler), ((CampusAppWPortalLib8.Model.Utility.ListPickerItemModel)this.TagHandler.SelectedItem).Value);
}
}

View File

@@ -226,7 +226,7 @@ namespace CampusAppWP8.Pages.Dev
var result = this.barcodeReader.Decode(this.bit);
if (result != null )
if (result != null)
{
Dispatcher.BeginInvoke(delegate
{
@@ -250,19 +250,24 @@ namespace CampusAppWP8.Pages.Dev
}
else
{
if (AppSettings.BTUTagDefaultHandler.CampusMap == Settings.AppSetting.TagDefaultHandler)
string qrContent = result.Text;
switch (Settings.AppSetting.TagDefaultHandler)
{
this.GoToCampusMappage(result.Text);
}
else
{
MessageBoxResult msgResult = MessageBoxes.ShowBtuTagInfoOkCancelMessageBox(result.Text);
if (msgResult.Equals(MessageBoxResult.OK))
{
string urlString = Constants.PathBTUTag_Info;
Uri url = new Uri(urlString as string, UriKind.Relative);
this.NavigationService.Navigate(url);
}
case BTUTagDefaultHandler.CampusMap:
this.GoToCampusMappage(qrContent);
break;
case BTUTagDefaultHandler.DateCreation:
this.GoToAppointment(qrContent);
break;
default:
MessageBoxResult msgResult = MessageBoxes.ShowBtuTagInfoOkCancelMessageBox(result.Text);
if (msgResult.Equals(MessageBoxResult.OK))
{
string urlString = Constants.PathBTUTag_Info;
Uri url = new Uri(urlString as string, UriKind.Relative);
this.NavigationService.Navigate(url);
}
break;
}
}
});
@@ -285,6 +290,25 @@ namespace CampusAppWP8.Pages.Dev
NavigationService.Navigate(url);
}
/// <summary> Go to appointment. </summary>
/// <remarks> Fiedler, 15.11.2013. </remarks>
/// <param name="tagContent"> The tag content. </param>
private void GoToAppointment(string tagContent)
{
string pid = Wp8StringManager.FilterPlaceIdinQRResultString(tagContent);
string urlStr = Constants.PathTimeTable_AppointmentEdit + "?" + Constants.ParamPID + "=" + pid;
Uri url = new Uri(urlStr, UriKind.Relative);
if (this.Dispatcher != null)
{
this.Dispatcher.BeginInvoke(new Action(() => NavigationService.Navigate(url)));
}
else
{
NavigationService.Navigate(url);
}
}
/// <summary> Capture thread function. </summary>
/// <remarks> fiedlchr, 15.10.2013. </remarks>
private void CaptureThreadFunc()

View File

@@ -50,7 +50,7 @@ namespace CampusAppWP8.Pages.Setting
{
Settings.AppSetting.GeoWatchEnable = GeoWatchToggle.IsChecked.Value;
Settings.AppSetting.OnlyWifi = OnlyWiFiToggle.IsChecked.Value;
Settings.AppSetting.TagDefaultHandler = (CampusAppWP8.Model.Setting.AppSettings.BTUTagDefaultHandler)Enum.Parse(typeof(CampusAppWP8.Model.Setting.AppSettings.BTUTagDefaultHandler), ((CampusAppWPortalLib8.Model.Utility.ListPickerItemModel)this.TagHandler.SelectedItem).Value);
Settings.AppSetting.TagDefaultHandler = (CampusAppWP8.Model.Setting.BTUTagDefaultHandler)Enum.Parse(typeof(CampusAppWP8.Model.Setting.BTUTagDefaultHandler), ((CampusAppWPortalLib8.Model.Utility.ListPickerItemModel)this.TagHandler.SelectedItem).Value);
}
}

View File

@@ -217,7 +217,7 @@ namespace CampusAppWP8.Pages
//this.ContentPanel.Margin = new Thickness(76, -24, 24, 0); // LandscapeRight
//this.ContentPanel.Margin = new Thickness(24, -24, 76, 0); // LandscapeLeft
//this.AppTitle.Margin = new Thickness(12, 17, 0, 28);
if (!this.Row3.Children.Contains(this.MailAppButton)
&& !this.Row3.Children.Contains(this.OpenHoursAppButton)
&& !this.Row3.Children.Contains(this.LinkAppButton))
@@ -437,25 +437,25 @@ namespace CampusAppWP8.Pages
}
else
{
this.GoToAppointment(nfcContent);
/* removed for testing
if (AppSettings.BTUTagDefaultHandler.CampusMap == Settings.AppSetting.TagDefaultHandler)
switch (Settings.AppSetting.TagDefaultHandler)
{
// search for placeId
this.GoToCampusMappage(nfcContent);
case BTUTagDefaultHandler.CampusMap:
this.GoToCampusMappage(nfcContent);
break;
case BTUTagDefaultHandler.DateCreation:
this.GoToAppointment(nfcContent);
break;
default:
if (this.Dispatcher != null)
{
this.Dispatcher.BeginInvoke(new Action(() => this.ShowBtuTagMessageBox()));
}
else
{
this.ShowBtuTagMessageBox();
}
break;
}
else
{
if (this.Dispatcher != null)
{
this.Dispatcher.BeginInvoke(new Action(() => this.ShowBtuTagMessageBox()));
}
else
{
this.ShowBtuTagMessageBox();
}
}
*/
}
this.ndefId = this.device.SubscribeForMessage(Constants.NCFMessageType_NDEF, this.NDEFHandler);

View File

@@ -1230,6 +1230,15 @@ namespace CampusAppWP8.Resources {
}
}
/// <summary>
/// Sucht eine lokalisierte Zeichenfolge, die Termin erstellen ähnelt.
/// </summary>
public static string Setting_TagHandlerDate {
get {
return ResourceManager.GetString("Setting_TagHandlerDate", resourceCulture);
}
}
/// <summary>
/// Sucht eine lokalisierte Zeichenfolge, die BTU-Tag-Informationsseite anzeigen ähnelt.
/// </summary>

View File

@@ -617,4 +617,7 @@
<data name="MensaApp_Weekplan" xml:space="preserve">
<value>Wochenplan</value>
</data>
<data name="Setting_TagHandlerDate" xml:space="preserve">
<value>Termin erstellen</value>
</data>
</root>